Skip to content

Instantly share code, notes, and snippets.

@claybridges
Created December 12, 2014 18:21
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save claybridges/4b787873a3efad4cfe3f to your computer and use it in GitHub Desktop.
clojure example
(defn center-y-for-note
; arity = 2
([{:keys [origin size]} note]
(let [{:keys [height]} size]
(center-y-for-note (origin :y) (size :height) note)))
; arity = 3
([origin-y height note]
(let [note-increment (/ height 8)
ymin (+ origin-y height)]
(- ymin (* note-increment (notes/canonical-staff-position-for-note note))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment