Topics
Using midi output with Midishare and msOMSDriver
Functions used
pitchwheel, pgmout, repeat-n and CHORD-SEQ.
Introduction
OpenMusic outputs MIDI data thru Midishare or OMS drivers. It can play an external device such as an expander, and may also receive midi data from a controller. In this tutorial we will see how to play MIDI internally via Midishare or OMS or thru an external device.
When OM is launched all drivers in the 'MidiShare Folder' located at the root of your 'System Folder' are automatically launched at MidiShare wakeup time (except those in the 'Disabled folder') . If msOMSDriver is found in this folder, you will have the possibility to use OMS via Midishare.
First of all one must set each port in the OM Preferences (in the OM File menu).
Now let us examine a patch using QuickTime GM Synth
A: Input some program changes in the list A. These correspond to General MIDI instruments.
B: Input the Channel number for each instrument. Notice that we avoid using channel 10 which is reserved for percussion instruments.
C: pgmout once evaluated will send these program changes to the designated port in its third input (D). This function always returns nil in the Listener. It only sends midi messages.
E: Now input some midicents in the list E and connect list B to the seventh input of CHORD-SEQ (F). This argument will assign for each note a midi channel. Evaluate the CHORD-SEQ object and open its editor.
You can notice that for each note we have a different channel as it is the case of a 'Klangfarbenmelodie'. If you play the CHORD-SEQ, each note will play a different instrument. That is because we have assigned to each channel a different program change with pgmout.
G: Now if you want all the notes to play the piano instrument , evaluate the pgmout (G) which will reset the program changes of all channels we have modified.
B.Playing microtones using pitchwheel
Now let us build a simple patch that will play microtones using CHORD-SEQ.
|
|
|
|
|
|
One eight tone | MIDI channel 2 |
One quarter tone | MIDI channel 3 |
Three eight tone | MIDI channel 4 |
0 to channel 1 which stands for no pitch bend
1024 to channel 2 which stands for one eight tone
2048 to channel 3 which stands for one quarter tone
3072 to channel 4 which stands for one eight + quarter tone.
For further information concerning Midishare please consult midishare's documentation