Monday, May 19, 2014

Theremin-friendly handling of non-diatonic notes

Regarding non-diatonic note handling, I discovered a fourth mapping mode mode, which will be very useful when using a continuous controller (e.g. a theremin) to generate input notes. In this new mode, which I call "Skip", the non-diatonic notes are skipped over instead of merely being disabled. This effectively normalizes the diatonic scale, and makes the diatonic notes evenly spaced in controller steps. On a keyboard, the mapping looks like this (for the chord scale of C Lydian):

in out
C3 C3
Db3 D3
D3 E3
Eb3 F#3
E3 G3
F3 A3
Gb3 B3
G3 C4 (octave)
Ab3 D4


Note that the octave is now reduced to a fifth. All other intervals are similarly compressed. This might be of interest to those with unusually short fingers (children?) or other physical challenges. This mode also facilitates "wild" gestural playing, because it not only eliminates the need to avoid hitting black keys, but also ensures that all keys are "live" and play a unique diatonic note. It might be interesting to try it on a MIDI guitar. Chromatic playing would become diatonic playing. The range of a given instrument is increased by approximately half, e.g. a 61-note keyboard would cover more than eight octaves, instead of five octaves (61 / 7 = 8.71)

I have not actually implemented this mode yet, but I believe I have the math figured out and will begin implementing it ASAP. It's actually very simple, just a multiply, a divide, a modulo, and a table lookup:

int Diatonic[7] = {0, 2, 4, 5, 7, 9, 11}
int NoteOut = NoteIn / 7 * 12 + Diatonic[NoteIn % 7];

So to recap, the proposed non-diatonic note methods are: Allow, Quantize, Disable*, and Skip.

"Allow": a black key creates an accidental unless the adjacent white keys are mapped such that they're a half-step apart, in which case the black key generates a redundant note. This is the default and what I normally use, because it (sometimes) allows chromatic notes. A theremin player would be obliged not only to maintain correct absolute position (to avoid the "black keys" floating in space), but also to move different distances depending on the absolute sizes of the intervals between diatonic tones. In other words, if two diatonic tones are separated by a whole step, the motion required to jump from one to the other is twice as big as the motion required if the two diatonic tones that are separated by a half step. It would be easier to play than a real theremin, due to the elimination of microtones, but still quite difficult.

"Quantize": a black key is mapped to the nearest diatonic tone; i.e. all black keys generate redundant notes. A theremin player would probably find this mode annoying, because it would generate many duplicate notes. However this mode may be useful for MIDI guitar or other fretted but "sloppy" instruments, because misses are corrected instead of being discarded as they are in "Disable".

"Disable": a black key does nothing, i.e. it's dead wood. There are no longer any "black keys" to trip over, and for a theremin player this would probably be a huge improvement. However the diatonic tones still aren't evenly spaced in controller coordinates, so a theremin player would still have to move different distances depending on the absolute sizes of the intervals between diatonic tones, i.e. if the distance between two diatonic notes is bigger, the player has to move further. Some might find this preferable to "Skip", it could be a matter of preference.

"Skip": the chromatic scale is mapped to the diatonic scale, such that the octave fits within a fifth, as described above. All keys are enabled, and none of them generate redundant notes. The diatonic is normalized, such that the amount of physical motion required to jump from one scale tone to an adjacent one is always the same. This would be ideal for a theremin, in my view.

*Disable was previously called "suppress" or "reject".

Note that the above explanations become inaccurate if a non-octave input transposition is specified, however if one substitutes "diatonic tone" for "white key" and "non-diatonic tone" for "black key" the explanations remain correct. For example if input transposition is 2, to get diatonic notes, one must play down a whole step, i.e. in Bb major. This means the "white keys" are now Bb, C, D, Eb, F, G, A, and Bb, and the "black keys" are B, Db, E, Gb, and Ab. This would be true in "Allow", "Quantize" and "Disable", but in "Skip", the result will be more complicated.

No comments:

Post a Comment