From 408d6a9f49f4ecac6abccfd993e72a44b1bc8103 Mon Sep 17 00:00:00 2001 From: Jake Zerrer Date: Tue, 14 Oct 2025 08:52:12 -0400 Subject: Convert set operations to note on/off values --- src/notation.clj | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 src/notation.clj (limited to 'src/notation.clj') diff --git a/src/notation.clj b/src/notation.clj new file mode 100644 index 0000000..aff26e3 --- /dev/null +++ b/src/notation.clj @@ -0,0 +1,73 @@ +(ns notation + "Experimental notation") + +(comment + ;; Parallel groups + ;; Notes 1, 2, and 3 simultaneously + ;; = should remind you of amb= + ;; implicit duration of 1 + [= 1 2 3] + + ;; Same as above, but with duration 3 + ([= 1 2 3] 3) + + ;; Notes 1, 2, and 3 all with different durations + [= + (1 2) + (2 3) + (3 4)] + + ;; Inner values override outer values + ;; In this chord, 1 would have a duration of 3 while 2 and 3 would have a duration of 2 + ([= (1 3) 2 3] 2) + + ;; Notes 1, 2, and 3 all with different durations and velocities + [= + (1 2 100) + (2 3 110) + (3 4 123)] + + ;; Sequential groups + ;; Note 1, then note 2, then note 3 + [1 2 3] + + ;; Note 1 duration 1, then note 2 duration 2, then note 3 duration 1 + [(1 1) + (2 2) + (3 1)] + + ;; Three chords played sequentially + [[= 1 2 3] + [= 1 2 3] + [= 1 2 3]] + + + ;; Note 1, followed by a rest, followed by note 3 + [1 (r) 3] + + ;; Unlike notes, rests are at most 2-tuples + ;; (Think about it: Rests never have a note value) + + ;; Assign the note sequence 1 2 3 to the name loop1 + ;; The first argument is always the name; the last argument is always either + ;; a sequential or parallel group + (=loop1 [1 2 3]) + + ;; Use loop1 + [1 (loop1) 2 3] + + ;; Middle arguments are variable names + (=loop2 dur ([1 2 3] dur)) + + + ;; TODO: + ;; - Note literals turn into numbers + ;; - Represent keyboard as byte array of shorts + ;; - play a note increments, stop a note decrements + ;; - Multiple instruments + ;; - Mapping inputs to vars + ;; - Inputs get declared at the top of a track + ;; - Devices get mapped to declared inputs + ;; - Notion of scenes that change mapping of inputs to vars + ;; - Loops + ) -- cgit v1.2.3