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
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
Is a macro necessary?
https://gist.github.com/alexpw/8476780
On Friday, January 17, 2014 10:21:52 AM UTC-6, Kashyap CK 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
Thanks Alex ... I believe, pre-computing the map upfront would be more
efficient.
But yeah, looks like macros are not required as Timothy has shown.
Regards,
Kashyap
On Friday, January 17, 2014 10:20:31 PM UTC+5:30, Alex Walker wrote:
Is a macro necessary?
Thank you so much Timothy .. this is just what I was looking for ...
On Friday, January 17, 2014 10:03:12 PM UTC+5:30, tbc++ wrote:
perhaps something like:
(zipmap (range)
(for [octave (range 8)
key [C C# D D# ...]]
(keyword (str key