perhaps something like: (zipmap (range) (for [octave (range 8) key ["C" "C#" "D" "D# ...]] (keyword (str key octave))))
Timothy On Fri, Jan 17, 2014 at 9:21 AM, Kashyap CK <ckkash...@gmail.com> wrote: > Hi, > > I am exploring javax.sound.midi using clojure and while creating keywords > for notes I wonder if I could use macros to generate the keywords - > > (defn note-2-num [n] > (let [ > m { > :C1 0 > :C#1 1 > :D1 2 > :D#1 3 > :E1 4 > :F1 5 > :F#1 6 > :G1 7 > :G#1 8 > :A1 9 > :A#1 10 > :B1 11 > }] (m n))) > > > I want to repeat this sequence such that note-2-num returns 12 for C2 13 > for C#2 etc . Could someone please suggest how I can do that? > > btw I am exploring overtone as well. > > Regards, > Kashyap > > -- > -- > You received this message because you are subscribed to the Google > Groups "Clojure" group. > To post to this group, send email to clojure@googlegroups.com > Note that posts from new members are moderated - please be patient with > your first post. > To unsubscribe from this group, send email to > clojure+unsubscr...@googlegroups.com > For more options, visit this group at > http://groups.google.com/group/clojure?hl=en > --- > You received this message because you are subscribed to the Google Groups > "Clojure" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to clojure+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- “One of the main causes of the fall of the Roman Empire was that–lacking zero–they had no way to indicate successful termination of their C programs.” (Robert Firth) -- -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en --- You received this message because you are subscribed to the Google Groups "Clojure" group. To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.