Function
(keynumfreq {keyword value}*)
Returns the key number of freq, which can be a note name, key number, Hertz value or list of the same. If freq is in Hertz then the return value will be a floating point keynum where the fractional portion times 100 represents that may cents above the integer keynum. For example, the floating point keynum 60.5 stands for the Hertz value 50 cents above Middle C, or 269.291 Hz.
keynum supports the following keyword arguments:
:hz boolean:from { tuning | mode}*scale*.
If mode is specified then freq is a modal key
number and the value returned is the equivalent key number in the
mode's tuning. if tuning is specified then freq
is an integer key number and the value returned is the corresponding,
possibly floating point, key number in the standard chromatic scale.
:in? { tuning | mode}:to mode:through { tuning | mode};; Converting Hertz and note names to keynums. (keynum 'c4) ⇒ 60 (keynum 440 :hz #t) ⇒ 69 (keynum 446.4 :hz #t) ⇒ 69.25 (keynum 446.4 :hz #t :through *scale*) ⇒ 69 (keynum '(cs5 ds fs gs as cs6)) ⇒ (73 75 78 80 82 85)
;; Modal keynums. (define dorian (new mode :notes '(c d ef f g a b c))) (keynum 60 :to dorian) ⇒ 35 (keynum 35 :from dorian) ⇒ 60 (keynum 61 :in? dorian) ⇒ #f (keynum 61 :through dorian) ⇒ 60