MIDI Helper Modules
Posted: Fri Apr 12, 2019 7:57 pm
Hi All,
In the process of getting started in my latest project, I had need of a few tools to help me with debugging a lot of MIDI processing. I thought I'd share a few here that folks might find handy. Inside each module is a comment containing instruction for how to use it. Only the MIDI monitor has a module GUI; the others only have properties pages (locked open as saved.)
Note: FlowStone 3.0.6 is required for some of these modules to function. Others may work with earlier versions, but I can't guarantee it!
MIDI Monitor
This is just a (very slightly) updated version of my old MIDI Monitor. Not much has changed, but a few Ruby bugs here and there have been fixed, and the code has been made a little more efficient.
- Running display of incoming MIDI messages and a count of them.
- Closer inspection of MIDI events to show their byte values, including full SysEx dumps.
- Real-time display of what notes are currently playing.
- Four 'sequence' memories for storing and replaying any selection of received messages.
Next up are a couple of tools for when you need a handy source of MIDI messages, but don't have a hand free, or if (like me) you get very confused when the PC keyboard is selected as the MIDI input and think you've forgotten the keyboard shortcuts again!
MIDI Test Message
A quick way to generate any kind of 3-byte MIDI message on any channel. The message can be sent either from a button press, movement of a knob, or only when the knob is released. The knob value is assigned to whichever of data1 or data2 is most appropriate to the message type, and a value for data1 can be set when data2 is the knob value..
Random MIDI Generator
Exactly as it says - it generates a stream of random MIDI messages, with full control over what messages the stream is allowed to include, and how they should be timed. The stream can also be set to stop after a pre-determined period. Notes are given a random length upon creation to make sure that every note-on gets a matching note-off.
Simple MIDI Recorder
Record a short snippet of MIDI from the input, then play it back either one-shot or in a repeating loop. The MIDI sequence is remembered when the schematic is saved or when the module gets put into the toolbox - so you can keep a selection of them handy with different "test signals". Notes are adjusted to ensure note-ons always get a note-off even if you start/stop recording mid-note.
Note that there's no attempt to synchronise playback with VST etc. - the timing is tight enough for testing purposes, but loops would drift out of time very quickly, I think!
MIDI Note Hold
A module for holding/sustaining MIDI notes, with three different modes...
- Sustain: Typical sustain pedal action; new notes are held until sustain is turned off.
- Chord Hold: Overlapping notes create a chord which is held after key release until a new chord is started.
- Mono Hold: Holds the most recently played note.
Note hold can be turned on/off either by a 'green' input or by choosing a MIDI CC to use (e.g. 64 = sustain pedal.) The mode can be changed at any time, even while notes are currently being played or held.
SysEx Builder
And, since my big project is all to do with MIDI SysEx, a little module to allow SysEx test strings to be built a little more easily. You can type a SysEx message into this in a format like the one shown below, making it much easier to apply small edits...
In the process of getting started in my latest project, I had need of a few tools to help me with debugging a lot of MIDI processing. I thought I'd share a few here that folks might find handy. Inside each module is a comment containing instruction for how to use it. Only the MIDI monitor has a module GUI; the others only have properties pages (locked open as saved.)
Note: FlowStone 3.0.6 is required for some of these modules to function. Others may work with earlier versions, but I can't guarantee it!
MIDI Monitor
This is just a (very slightly) updated version of my old MIDI Monitor. Not much has changed, but a few Ruby bugs here and there have been fixed, and the code has been made a little more efficient.
- Running display of incoming MIDI messages and a count of them.
- Closer inspection of MIDI events to show their byte values, including full SysEx dumps.
- Real-time display of what notes are currently playing.
- Four 'sequence' memories for storing and replaying any selection of received messages.
Next up are a couple of tools for when you need a handy source of MIDI messages, but don't have a hand free, or if (like me) you get very confused when the PC keyboard is selected as the MIDI input and think you've forgotten the keyboard shortcuts again!
MIDI Test Message
A quick way to generate any kind of 3-byte MIDI message on any channel. The message can be sent either from a button press, movement of a knob, or only when the knob is released. The knob value is assigned to whichever of data1 or data2 is most appropriate to the message type, and a value for data1 can be set when data2 is the knob value..
Random MIDI Generator
Exactly as it says - it generates a stream of random MIDI messages, with full control over what messages the stream is allowed to include, and how they should be timed. The stream can also be set to stop after a pre-determined period. Notes are given a random length upon creation to make sure that every note-on gets a matching note-off.
Simple MIDI Recorder
Record a short snippet of MIDI from the input, then play it back either one-shot or in a repeating loop. The MIDI sequence is remembered when the schematic is saved or when the module gets put into the toolbox - so you can keep a selection of them handy with different "test signals". Notes are adjusted to ensure note-ons always get a note-off even if you start/stop recording mid-note.
Note that there's no attempt to synchronise playback with VST etc. - the timing is tight enough for testing purposes, but loops would drift out of time very quickly, I think!
MIDI Note Hold
A module for holding/sustaining MIDI notes, with three different modes...
- Sustain: Typical sustain pedal action; new notes are held until sustain is turned off.
- Chord Hold: Overlapping notes create a chord which is held after key release until a new chord is started.
- Mono Hold: Holds the most recently played note.
Note hold can be turned on/off either by a 'green' input or by choosing a MIDI CC to use (e.g. 64 = sustain pedal.) The mode can be changed at any time, even while notes are currently being played or held.
SysEx Builder
And, since my big project is all to do with MIDI SysEx, a little module to allow SysEx test strings to be built a little more easily. You can type a SysEx message into this in a format like the one shown below, making it much easier to apply small edits...
- Code: Select all
# A helpful comment to say what this SysEx does.
# Blank lines can be used to split things up.
F0 # An in-line comment.
0A 0B # Hex bytes.
"Hello" # ASCII Bytes quoted.
[10 11 12] # Decimal bytes inside [].
3A3B3C # Adjacent Hex OK.
3A,3B,3C # Or with just about any separator.
[61, 62] # Likewise for decimals.
# Blank lines and line comments can go anywhere!
"Goodbye"
3D,3E
F7 # THE END!