JythonMusic supports microtonal material.
Microtonality is possible through creating Notes with float numbers as pitches (e.g., 443.1). If a pitch is float, it is considered to be in Hertz. If a pitch is integer, it is considered to be in MIDI (e.g., A4 or 69). In other words, pitch 440.0 is equivalent to pitch 69 (or A4) – they sound exactly the same.
from music import * note = Note(443.1, HN) # create a note a bit over A4 (440.0) Play.midi(note) # and play it!
Microtonality with Audio Instruments
Microtonality works very well with Audio Samples.
Simply create polyphonic material using float numbers as pitches (e.g., 432.3 – that’s in Hz).
Then, play it using Play.audio().
Microtonality with MIDI Instruments
Microtonality is limited for MIDI instruments. The MIDI standard does not support them. Here, we implement microtonal pitches using MIDI pitch bent. There is only one pitch bend per channel, so you can only play one microtonal note at a time, per channel. If there are concurrent notes (e.g., chords), you need to spread them across different channels (0-8 and 10-15 – remember, channel 9 is reserved for percussion).
One way is this:
- store each concurrent voice in its own Phrase, and
- store each Phrase in its own Part, using a unique channel (0-8 and 10-15).
Another way is this:
- use Play.noteOn() interactively, and manually send concurrent notes to different channels.
In summary, the best way to do microtonality is to use Audio Samples. Simply create polyphonic material using float numbers as pitches. Then, play it via Play.audio().