Keeps track of key changes and adjusts the tuning of the current scale accordingly. This class works for any tuning system.
Also can quantize a given semitone, cents value or frequency into the currently used scale
create a Key
scale |
The current scale |
root |
The index of the scale root |
Change the current Key. This works correctly with both ET and JI.
degree |
The degree of the scale to modulate by. If it and chromatic are nil, revert to previous state. |
chromatic |
the chromatic interval to modulate by |
changes the mode of the current key
mode |
an array of degrees or a key from ScaleInfo. If nil, it revcerts to previous mode |
Snaps a semitone to the nearest semitone in the current key
semitone |
the tone to be quantized, or an array of semitones |
round |
round: has three modes:
|
gravity |
determines how strong the attraction is:
|
quantised semitone
Snaps the feq value in Hz to the nearest Hz value in the current key
freq |
in Hz |
base |
The base frequency, or root frequency |
round |
has three modes:
|
gravity |
determines how strong the attraction is:
|
quantised frequency
snaps a cents value to the nearest semitone in the current key
cent |
the cents value to be quantized, or an array of cents |
round |
has three modes:
|
gravity |
determines how strong the attraction is:
|
quantised cents
rounds a frequency to the neast degree in the current key
freq |
in Hz |
base |
The base frequency, or root frequency |
round |
has three modes:
|
the quantized degree.