Last active
December 20, 2015 14:59
-
-
Save fronx/6150730 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ; (this is all fantasy code.) | |
| ; | |
| ; a response is a thing that takes in a trigger, and outputs a sequence of intensities. | |
| ; | |
| ; parentheses are used for zooming in. | |
| ; if a sequence has three items, it is automatically interpreted as a triplet. (same for any number of notes.) | |
| ; symbols can be mapped to note configurations using a "let"-like construct. | |
| ; parsing of strings using "notes": add spaces between all characters, then interpret as list. | |
| ; example: | |
| (notation [o {:intensity 60} O {:intensity 100}] | |
| (let [a (response [t] (match t o (notes "(Oo)"))) ; parentheses for zooming in | |
| b (response [t] (match t o (notes "(OoO)"))) ; triplets! | |
| ts (trigger (notes "____o___"))] | |
| (concat (a ts) (b ts)))) | |
| ; => (notes "____(Oo)___ ____(OoO)___") | |
| ; => '(_ _ _ _ ({:intensity 100} {:intensity 60}) _ _ _ | |
| ; _ _ _ _ ({:intensity 100} {:intensity 60} {:intensity 100}) _ _ _) | |
| ; shorter syntax (assuming a scope that defines the "Oo" notation): | |
| (fold-notes "____o___" "(Oo)") | |
| ; => '(_ _ _ _ ({:intensity 100} {:intensity 60}) _ _ _) | |
| ; depending on things like trigger intensity, a response might prefire: | |
| (response [trigger] | |
| (on (> (:intensity trigger) 70) (left-shift (notes "oO") 1) ; prefire! | |
| (> (:intensity trigger) 20) (notes "Oo"))) |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@pje the fantasy program introduces it in line 11.