WAV Trigger Pro - MIDI and Presets

The WAV Trigger Pro can certainly be used without considering MIDI. Tracks can be started using the 8 digital (contact closure) input triggers, and complex track control and mixing can be accomplished using the Qwiic Arduino library. But many of the new and enhanced features are unlocked only when using MIDI. In the following discussion, keep it mind that MIDI can come from any number of sources: As a USB MIDI Device, the WAV Trigger Pro can receive MIDI from any MIDI Host, such as your Digital Audio Workstation software or even a Raspberry Pi. As a USB MIDI Host, MIDI comes from any USB MIDI Device (keyboard, control surface) plugged into the WAV Trigger Pro. MIDI can even come over Qwiic interface using the functions in the Qwiic Arduino library. Please refer to the connection diagrams on the previous page.

Presets

To control how the WAV Tirigger Pro responds to MIDI, we introduce the concept of a preset. A preset is a .csv file stored on the same microSD card as your tracks, given the name “set_nnnn.csv”, where n is the preset number with leading 0’s. For example, preset 32 will have the filename “set_0032.csv”. Presets can be created and edited using any spreadsheet application that can export .csv files using commas as a delimiter. I use Google Sheets and will provide examples and templates as such, but you can also use Excel or any other spreadsheet app.

In a preset spreadsheet, any row that does not begin with the character “#” as the first character in the first column is considered to be a comment, and will be ignored by the parser. Otherwise, that row is considered to contain an assignment. At the moment, the only assignment recognized is “#NOTE” appearing in the first column. For this discussion, we’ll refer to our columns using letters.

Each row with “#NOTE” appearing in column A, will assign one action to the MIDI Note number contained in column B. A single MIDI Note number can appear in up to eight rows with different actions, making it possible to assign multiple actions to a single note. Any more than eight rows for a given note number will be ignored. Because there are 128 MIDI note numbers (0 - 127) and each note number can be assigned 8 actions, there can be up to 1024 #NOTE assignment rows in a single preset file.

As an example, I’ve created a sound set of stereo piano and string samples along with a Google Sheets preset that assigns 2 actions to each note within the range of samples. One action plays the piano, panned somewhat left with a release of 500ms, and the other action plays the strings, panned somewhat right with a release time of 1 second. We’ll use this example to cover how to create a note action.

Here’s an explanation of each column:

Column 1/A: To assign one action to a given MIDI Note number, “#NOTE” must appear in this column. Any thing else and the row will be considered a comment and will be ignored by the parser.

Column 2/B: MIDI Note number, 0 to 127. The same note number can appear in up to 8 rows with different actions. The occurrences do not need to be in any particular order.

Column 3/C: MIDI Channel number. (MIDI Channels are actually 0 to 15 but are sometimes referred to as 1 to 16 in user interfaces.) If the channel number in this column is 0 to 15, then the action will only occur for the corresponding MIDI Channel. If the channel number in this column is 16, then the action will occur for any MIDI Channel (Omni.)

Column 4/D: Action Type. The action type is determined by the 2-digit number at the start of this field, but in this spreadsheet, I’ve created an annotated action type list (highlighted in red) that names each action, and then used a drop-down selection constraint to make it easy to specify the action type. The parser only pays attention to the 2-digit number. The action types are as follows:

  • Action type 01: Play Note - This is the normal action for a MIDI Note: The track number specified in column 5/E will start with a MIDI Note-On using a target volume proportional to the MIDI Velocity. The Track will stop with the corresponding MIDI Note-Off.

  • Action type 02: Trigger, Edge - This action ignores both MIDI Velocity and the corresponding MIDI Note-Off. A track started by this action will be polyphonic and be mixed with any previous instance of this action’s track.

  • Action type 03: Trigger, Level - this action ignores MIDI Velocity but will stop the track upon receipt of the corresponding Note-Off.

  • Action type 04: Trigger, Conditional - this action ignores MIDI Velocity, and the track will not start if a previous instance of this action’s track is still playing

  • Action type 05: Stop Track - this action will stop a track using the specified release time.

  • Action type 06: Stop All - this action will stop any and all tracks currently playing.

  • Action type 07: Load Preset - this action will load the preset number specified in column 5/E.

Column 5/E: Track or Preset number. For actions that refer to a track, this is the track number. For Action type 07, this is the preset number.

Column 6/F: Pitch Offset. This value is the sample-rate offset applied to the track when started. The units are cents, where 100 cents is a musical semitone, and the allowed values are -700 to +700. You can see in the example above that I’ve extended the range of both sample sets by 2 notes on both the low and high end, by re-using the lowest track 2 semitones down and the highest track 2 semitones up.

Columns 7/G and 8/H: Attack and Release times. Specified in milliseconds.

Column 9/I: Loop Flag. A 1 in this column will cause the track to seamlessly loop from the end back to the beginning.

Column 10/J: Lock Flag. A 1 in this column will prevent this track from being stopped by the WAV Trigger Pro’s voice stealing algorithm.

Column 11/K: Pitch Bend Flag: A 1 in this column will cause the track to be subject to any MIDI Pitch Bend messages.

Columns 12/L and 13/M: Minimum and Maximum Velocity. For action type 01, any MIDI Note-On message with a velocity outside this range will be ignored.

Columns 14/N and 15/O: Minimum and Maximum Velocity Gain. For action type 01, this is the gain range scaled to the velocity range. In other words, the gain at the Min Velocity with be the Min Velocity Gain, and the gain at the Max Velocity will be the Max Velocity Gain.

Column 16/P: Balance. A value of 0 means panned full left channel only, a value of 127 means panned full right channel only, and a value of 64 means center panned.

In the above example preset, MIDI Notes 46 through 86 appear twice, in order to mix two different instrument samples using different release values and panned a bit left and right.

Next: Triggers and The Default Preset

Contents:

Overview

MIDI Implementation and Presets

Triggers and the Default Preset

Preset Tips and Tricks

Performance and the Serial Console

Examples