Skip to content

Instantly share code, notes, and snippets.

@mharju
Created July 29, 2012 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mharju/3200531 to your computer and use it in GitHub Desktop.
Save mharju/3200531 to your computer and use it in GitHub Desktop.
Is this good?
(defmacro play-chord
[ts notes]
(let [note-on (map #(list 'sampled-piano %) (eval notes))]
`(at ~ts ~@note-on)))
(play-chord (+ 1000 (now)) (chord :A4 :major7))
; expands to
(overtone.live/at
(+ 1000 (now))
(sampled-piano 69)
(sampled-piano 73)
(sampled-piano 76)
(sampled-piano 80))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment