Created
December 12, 2014 18:21
-
-
Save claybridges/4b787873a3efad4cfe3f to your computer and use it in GitHub Desktop.
clojure example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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