Created
December 21, 2011 04:21
-
-
Save soulflyer/1504575 to your computer and use it in GitHub Desktop.
Possible additions to overtone.music.pitch
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 find-name | |
"Returnd the name of the first matching thing found in things | |
or nil if not found" | |
([thing things] | |
(if (= (val (first things)) thing) | |
(key (first things)) | |
(if (< 1 (count things)) | |
(find-name thing (rest things)))))) | |
(defn find-scale-name | |
"Return the name of the first matching scale found in SCALE | |
or nil if not found | |
ie: (find-scale-name [2 1 2 2 2 2 1] | |
:melodic-minor-asc" | |
[scale] | |
(find-name scale SCALE)) | |
(defn find-chord-name | |
"Return the name of the first matching chord in CHORD | |
or nil if not found | |
ie: (find-chord-name #{0 3 7} | |
:minor" | |
[chord] | |
(find-name chord CHORD)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment