Put the options first in :modify vector

This commit is contained in:
Jeremy Dormitzer 2018-07-28 16:17:49 -04:00
parent b51c574149
commit 3d7142f94d

View File

@ -22,8 +22,10 @@
[:= note1 note2] ;; note1 simultaneous with note2 [:= note1 note2] ;; note1 simultaneous with note2
[:+ note1 note3] ;; note1 followed by note3 [:+ note1 note3] ;; note1 followed by note3
[:+ [:= note1 note2] note3] ;; note1 simultaneous with note2, followed by note3 [:+ [:= note1 note2] note3] ;; note1 simultaneous with note2, followed by note3
[:modify note1 {::tempo 120}] ;; note1 modified to have tempo 120 [:modify {::tempo 120} note1] ;; note1 modified to have tempo 120
[:modify [:= note1 note2] {::tempo 120 ::instrument "Dope Organ"}] ;; note1 simultaneous with note2 modified with tempo and instrument [:modify {::tempo 120
::instrument "Dope Organ"}
[:= note1 note2]] ;; note1 simultaneous with note2 modified with tempo and instrument
;; can be nested to arbitrary complexity ;; can be nested to arbitrary complexity
(def song (def song
@ -41,22 +43,22 @@
{:duration duration}) {:duration duration})
(defn tempo [tempo music] (defn tempo [tempo music]
[:modify music {::tempo tempo}]) [:modify {::tempo tempo} music])
(defn transpose [abs-pitch music] (defn transpose [abs-pitch music]
[:modify music {::transpose abs-pitch}]) [:modify {::transpose abs-pitch} music])
(defn instrument [instrument music] (defn instrument [instrument music]
[:modify music {::instrument instrument}]) [:modify {::instrument instrument} music])
(defn phrase [phrase-attributes music] (defn phrase [phrase-attributes music]
[:modify music {::phrase phrase-attributes}]) [:modify {::phrase phrase-attributes} music])
(defn player [player-name music] (defn player [player-name music]
[:modify music {::player player-name}]) [:modify {::player player-name} music])
(defn keysig [pitch-class mode music] (defn keysig [pitch-class mode music]
[:modify music {::keysig [pitch-class mode]}]) [:modify {::keysig [pitch-class mode]} music])
(defn pc-to-int [pitch-class] (defn pc-to-int [pitch-class]
(case pitch-class (case pitch-class