Skip to content

-- hide: - navigation - toc icon: fontawesome/solid/scroll


Hookup Guide

Introduction

  • SparkFun Qwiic WAV Trigger Pro
    SKU: WIG-25860


    Product Thumbnail

  • The Qwiic WAV Trigger Pro is the latest evolution of the line of high-fidelity polyphonic audio players from robertsonics. The Qwiic WAV Trigger Pro improves on the previous versions with a more powerful processor, enhanced MIDI processing - including velocity switching and multi-timbral support - and MIDI USB Device (Default) and MIDI USB Host support, all in a smaller 1.75" x 1.5" footprint!

    The Qwiic WAV Trigger Pro supports up to 4096 uncompressed 16-bit, 44.1kHz mono and stereo WAV files matching CD audio quality. The WAV Trigger Pro supports polyphony and can play and mix up to 24 tracks simultaneously and independently with exceptionally low latency (7ms typically). Control track playback via either 8 programmable trigger inputs, I2C (Qwiic), or MIDI (USB, Serial UART, or Qwiic). The board can function as both a USB MIDI device and host meaning if the WAV Trigger Pro has power in USB MIDI Host mode it can supply up to 500mA@5V to a connected MIDI device over USB-C allowing for USB MIDI control with no computer required.

    Purchase from SparkFun

Required Materials

The Qwiic WAV Trigger Pro requires a few additional items as well as some through-hole soldering to get up and running properly. If you'd like to follow along with the examples in this tutorial, you'll want at least the following items along with a pair of corded headphones. If you'd like to follow the USB MIDI Host example, make sure you have a USB MIDI device like a MIDI Keyboard or Pad.

Qwiic & Arduino Materials

Users who wish to use the Qwiic WAV Trigger Pro with the Qwiic ecosystem and Arduino library, you may need one or more of the following products:

Soldering Tools & Accessories

The Qwiic WAV Trigger Pro does require some through-hole soldering for the best, permanent installation and uses. Users will need to at least solder to the audio output pins as they are routed to a 0.1"-spaced PTH header. If you need any soldering tools or materials, check out the following products:

Suggested Reading

Before getting started with this guide and the Qwiic WAV Trigger Pro, you may want to read through some of the tutorials linked below if you're not familiar with the concepts covered in them:

Hardware Overview

In this section we'll take a closer look at the components on the WAV Trigger Pro (Qwiic).

STM32H Microcontroller

The WAV Trigger Pro uses the STM32H750VBTx central processor from ST Microelectronics©.

Photo highlighting STM32 IC

The STM32 features a 32-bit Arm® Cortex®-M7 core with 128 Kb of Flash memory and 1Mb of RAM. It has an integrated USB converter that allows for easy updating of firmware over the USB-C connector on the board using STM's Cube Programmer tool. Updating the WAV Trigger Pro's firmware is covered in more detail in the Updating Firmware section of this guide.

Power Inputs

The WAV Trigger Pro has three options for powering the board; USB-C, Qwiic, or dedicated through-hole pins.

Photo highlighting power inputs. USB, Qwiic & through-hole.

USB-C

The USB-C connector on the board provides both a serial connection along with a power input. By default, when plugging the board in over USB-C to a computer, it will appear as a USB MIDI Device. When the WAV Trigger Pro is configured to act as a USB MIDI Host and powered through the dedicated through-hole power pins, the USB-C connector can supply 500mA@5V to a connected USB MIDI device. Running the WAV Trigger Pro as a USB MIDI Host requires uploading alternate firmware as well as modifying the appropriate solder jumpers. Read on to the MIDI Host Assembly section for detailed information on this configuration.

Qwiic Connector

The board includes a pair of Qwiic connectors to integrate it into SparkFun's Qwiic ecosystem. These connectors provide both an I2C connection as well as power (3.3V) to the WAV Trigger Pro. The WAV Trigger Pro Arduino library works over I2C to control the board using an Arduino microcontroller.

Through-Hole Power Pins

This pair of 0.1"-spaced plated through-hole (PTH) pins labeled 5V and GND accept a supply voltage of 5V. This power input is primarily intended for running the WAV Trigger Pro as a USB MIDI Host to provide 5V/500mA to a MIDI device connected to the board's USB-C connector.

Polyphonic Engine

The operation of the WAV Trigger Pro's polyphonic engine is proprietary to Robertsonics. While we cannot go into exact details on how this works, here are some highlights of the engine's functionality:

Photo highlighting components for the WAV Trigger polyphonic engine.

  • Up to 4096 uncompressed 16-bit, 44.1kHz mono and stereo WAV files (CD Quality)
  • Polyphonic - Play and mix up to 24 tracks independently and simultaneously with independent pitch control
  • Low Latency - Timing from triggering a track to playback typically takes only 2.5ms (4ms max)
  • MIDI notes can trigger up to 8 independent actions, routing tracks to any combination of outputs
  • Up to 8 velocity range assignments per note to trigger alternate samples
  • Each event provides independent pitch offset (in cents) allowing for true multi-sampling
  • Seamless looping over arbitrary track length

MIDI Control

The WAV Trigger Pro introduces MIDI-USB host and device capabilities. The board can function as either a USB-MIDI device or USB-MIDI host. When acting as a USB-MIDI host and powered independently it can power a connected MIDI device with 500mA@5V. This means you can have complete USB-MIDI interactivity with the WAV Trigger Pro with no computer required! Do note, running the WAV Trigger Pro as a MIDI-USB host requires uploading alternate firmware as well as physically adjusting the appropriate solder jumpers. Read on to the "MIDI Host Assembly" section for complete instructions.

Trigger Control

The board also includes eight independent trigger inputs routed to through-hole pins. All eight trigger pins can be individually configured. All trigger pins a 3.3V tolerant.

Qwiic (I2C) Control

This WAV Trigger also includes a pair of Qwiic connectors to integrate with SparkFun's Qwiic ecosystem. Users can use this in tandem with the [WAV Trigger Pro Arduino Library]((https://github.com/robertsonics/WAV_Trigger_Pro_Qwiic_Arduino_Library) to control the WAV Trigger Pro using an Arduino development board.

Audio Output

The WAV Trigger Pro has two channels for audio output routed to through-hole pins. Soldering to these pins is required for the audio output to work properly. If you have never soldered before or want some tips, check out our How to Solder: Through Hole Soldering Tutorial.

Presets

The WAV Trigger Pro introduces Presets! Presets are managed through spreadsheet .csv files (Excel or Google Sheets) loaded onto a connected µSD card which describe up to 8 actions per MIDI note, based on channel and velocity. Each action can start and independent track with individual gain, balance, attack, release, and pitch. This allows multiple sounds to be mixed in performance. If you've used previous WAV Triggers before, these Preset files take the place of the configuration app. You can have multiple presets stored on the file that you can switch between. Read on to the Preset File section of this guide for detailed information on how to setup and use these files.

µSD Card Slot

The µSD card holder on the WAV Trigger Pro is on the back/reverse side of the board. This card is used to store .wav audio files and preset .csv files.

Photo highlighting microSD card slot.

PTH Pins

The Qwiic WAV Trigger Pro has several plated through-hole (PTH) headers around the board. Let's take a closer look at each of these headers and how they work.

Photo highlighting through-hole pins. "Click to enlarge"

Trigger Pins

The board has eight PTH trigger pins mapped to the first 8 MIDI notes meaning activating Trigger pin 1 sends a MIDI Note-on message for note 1 and releasing Trigger pin 1 sends a MIDI-Note-off message for note 1. The trigger pins pulled HIGH to 3.3V internally and are active LOW. Pulling them to ground through either a button, switch, relay, or active output (eg. microcontroller I/O pin) activates the trigger.

All trigger pins are 3.3V tolerant so if you're using an active output to control the triggers make sure the inactive state of the triggers does not exceed 3.3V. Users can adjust how these trigger inputs behave in the Preset file. Read on to the Preset File of this guide for more information on configuring the triggers and other MIDI note behavior.

Audio Output

The WAV Trigger Pro has two channel (stereo) output routed only to PTH pins labeled L, R, and G.

Serial/UART & Boot Pins

The STM32's serial UART (RX/TX) pins and BOOT pin are routed to PTHs. Connecting the BOOT pin to ground puts the STM32 into BOOT mode for uploading new firmware to the board over either USB-C or a serial connection. The BOOT pin is routed directly next to a Ground pin to make closing this pin jumper easy. The UART pins operate at 3.3V logic.

The WAV Trigger Pro firmware (both Device & Host) also sets these pins up to be used with as a serial console interface over a serial terminal like the Arduino Serial monitor. The serial console accepts ASCII commands to as play, loop and stop tracks, loading presets and also return device status which can help provide important information about a connected µSD card's performance. The serial console interface works simultaneously with everything else running on the board. Read on to the Audio Output & Serial Console Interface section of this guide for more information.

STM SWD Header

The board includes a 5x2 Software Debug (SWD) header for low-level debugging of the STM32. The header connects to the STM32's SWD pins: SWDIO, SWCLK & SWO. For more information about using the SWD interface, refer to the STM32's Datasheet, Reference Manual & Hardware Development App Note.

Power Input

When not using USB or Qwiic for power, connect a 5V supply to power the board.

LEDs

The board has two LEDs on board labeled PWR and STAT.

Photo highlighting LEDs.

The red PWR LED indicates whenever the board is powered. The green STAT LED provides helpful information on the current status of the WAV Trigger. On reset, the STAT LED blinks in the following patterns:

  • 3 Quick Blinks - No problems. Both the µSD card and WAV files were found
    • After the initial pattern, the STAT LED will flash quickly every couple seconds as a "Heartbeat"
    • Goes solid while audio is playing
  • 1 Long then 1 Short Blink (Repeating) - No µSD card found
  • 1 Long then 2 Short Blinks (Repeating) - File system error
  • 1 Long then 3 Short Blinks (Repeating) - No WAV Fils found on µSD card
  • 1 Long then 4 Short Blinks (Repeating) - Memory error

Solder Jumpers

The WAV Trigger Pro has six solder jumpers labeled HST/DEV, VBUS, ANLG, I2C and LED.

Photo highlighting solder jumpers.

The list below outlines their names, functionality, default states and any notes on their use.

  • HST/DEV - This pair of three-way solder jumpers work with the VBUS jumper to switch the functionality of USB-MIDI control between acting as a Device or Host. The HST/DEV jumpers default to set the board to act as a MIDI Device.1
  • VBUS - This jumper controls whether the USB-C connector accepts or supplies 5V. It is OPEN by default to use the USB-C connector to receive power from a USB-C source. Closing it nets the output from VIN (5V/GND PTHs) to VUSB so the USB-C connector outputs 5V to a device connected to it.1
  • ANLG - This jumper ties the audio output's ground to the common ground on the board. It is CLOSED by default. Open it to isolate the audio's ground from the rest of the WAV Trigger Pro's ground plane.
  • I2C - Pulls the SDA/SCL lines to 3.3V through a pair of 2kΩ resistors. It is CLOSED by default. Open it to disable pullup on the I2C bus.
  • LED - Completes the Power LED circuit. CLOSED by default. Open it to disable the Power LED to help reduce the current draw.

Note 1: HST/DEV & VBUS Jumpers

How to use and set these jumpers is covered in more detail in the MIDI Host Assembly section of this guide.

Board Dimensions

The Qwiic WAV Trigger Pro measures 1.5" x 1.75" (38.10mm x 44.45mm) with four mounting holes that fit a 4-40 screw.

Board dimensions screenshot.

Preset File

Preset File Overview

The Qwiic WAV Trigger Pro assigns functions to MIDI notes using a spreadsheet format we'll refer to as "Presets". These presets can be made using any spreadsheet application (Excel, Google Sheets, etc.) that can export to a .csv file. The Presets configure how all 127 MIDI notes function including which track to play, playback actions, pitch offset, attack/release velocity, and even to call another Preset stored on the µSD card.

As you may imagine, the Preset contains a lot of information so we'll go into detail below on how each column in the file works.

Preset File Naming Convention

When creating a Preset, make sure to export it to a .csv file named "set_nnnn.csv" where "nnnn" is a 4-digit number with leading zeroes. For example, a preset file named "set_0001.csv" would be Preset 1, "set_0002" would be Preset 2 and so on. On reset, the WAV Trigger Pro looks for and loads the preset “set_0001.csv” automatically, if present, otherwise it will initialize to a default preset.

Functions that load presets (Column 4 - Action and Column 5 - Track/Preset) refer to the preset number in the filename. For example, setting a MIDI note to load a preset named "set_0123.csv" requires setting the action in Column 4 to "Load Preset" and the Track/Preset value in Column 5 to "123".

Default Preset

On power up or reset, the WAV Trigger looks for and attempts to automatically load Preset 1 (set_0001.csv). If that file does not exist on the SD card then it loads an internal default preset with the following action assignments:

MIDI Notes 1-8 have an action type 2, Trigger, Edge and set to trigger the corresponding track number with a gain of 0, center panned, attack/release time of 0ms and no flags set. This sets the eight trigger pins to toggle tracks 1-8 polyphonically, very similar to the behavior from the original WAV Trigger and Tsunami.

MIDI Notes 9-127 have an action type 1, Play and set to play the corresponding track number with a gain of 0, center panned, attack/release time of 0ms, full velocity and gain scaling with no flags set. This sets MIDI notes 9-127 to play tracks 9-127 as velocity sensitive MIDI notes that respond to both Note-On and Note-Off messages.

Column Overview

Each line in Preset files use fourteen columns that cover all MIDI notes' possible function and behavior assignments. The list below outlines each column and how to use them:

  • Column 1/A - Command: Assigning an action to a MIDI note number requires entering "#NOTE" in this column. Anything else here will cause the entire row to be considered a comment and ignored.

  • Column 2/B - MIDI Note number (0 - 127): Each MIDI Note number may appear in a Note Action line up to 8 times in any particular order in the Preset file (any more than 8 will be ignored.) Each Action line will assign one function to the corresponding MIDI Note to be executed on Note-On/Note-Off events. In this way, a single MIDI Note can perform up to 8 actions.

  • Column 3/C - MIDI Channel number (0 - 15): Each action can be assigned to either a specific MIDI channel or any channel (Omni). If the number in this column is 0 - 15 the action only occurs for the corresponding MIDI channel. A value of 16 sets the action to occur for any MIDI channel (Omni). Using multiple actions, a single MIDI note can play different sounds on different channels.

  • Column 4/D - Action: There are currently 7 available actions defined. These are contained within a list at the top of the spreadsheet (within the red box) and the action field is a drop-down selection for that list. The available actions are:

    • Action Type 01: Play Note: This is the normal behavior of a MIDI Note. The track number set in column 5/E starts with a MIDI Note-On message with a target volume proportional to the MIDI velocity. A MIDI Note-Off commessagemand stops the track.

    • Action Type 02: Trigger, Edge: This action ignores both MIDI velocity and the corresponding MIDI Note-Off message. A track with this action is polyphonic and mixed with any previous instance of this action's track.

    • Action Type 03: Trigger, Level: This action ignores MIDI velocity and stops the track with the corresponding Note-Off message.

    • Action Type 04: Trigger, Conditional: This action type ignores MIDI velocity and the track will not start if a previous instance of this track is still playing.

    • Action Type 05: Stop Track: This action stops a track with the specified release time.

    • Action Type 06: Stop All: This action stops all tracks currently playing.

    • Action Type 07: Load Preset: This action loads the specified preset file in Column 5/E.

  • Column 5/E - Track/Preset: This field sets the target track number or preset number for the action specified in Column 4/D. For action types 1-6 this refers to the track number. For action type 7 this refers to the preset number. Tracks are numbered 0 to 4095, while presets are numbered 0 to 9999.

  • Column 6/F - Pitch Offset: This value refers to the sample-rate offset applied to the track when started. Any action that causes a track to play can specify a pitch offset of -700 to +700 cents (100 cents equalling one musical semitone.) A pitch offset of 0 will cause the track to play with no offset.

  • Columns 7/G and 8/H - Attack and Release: MIDI note attack and release time specified in milliseconds.

  • Column 9/I - Loop Flag: A value of 1 in this column causes the track to seamlessly loop from end to beginning until it is stopped.

  • Column 10/J - Lock Flag: The WAV Trigger Pro has a voice stealing algorithm. If when a track is started, there are no voices available, the oldest running voice will be “stolen” to play the new track. Putting a value of 1 in the Lock field prevents the track from having its voice stolen if this happens. This can be useful if you have a backing track that you don’t want to get cut off.

  • Column 11/K - Pitch Bend Flag: A value of 1 in this column causes the track to be modified by any MIDI Pitch Bend messages.

  • Columns 12/L and 13/M - Min and Max Velocity: For action type 1, any MIDI Note-On message with a velocity outside this range is ignored.

  • Column 14/N and 15/O - Min and Max Velocity Gain: For action type 1, sets the gain range scaled to the velocity range. This means the gain at the min velocity matches the min velocity gain and the gain at the max velocity matches the max velocity gain.

  • Column 16/P - Balance (0 - 127): This value controls the Left/Right channel balance of the track. A value of 0 is Left channel only, while a value of 127 is Right channel only. A value of 64 means center panned audio between Left and Right channels.

Preset Demos

Robertsonics has created a couple of sample SD card images for Keyboard and Percussion USB MIDI demos. Each image includes sets of WAV and Preset files in a ZIP download. All you need to do is download the image, unzip it and load it onto an empty and formatted µSD card and plug the card into the WAV Trigger Pro.

Keyboard Demo

The Keyboard demo is intended for use with a MIDI keyboard and includes three sets of instrument sounds - piano, strings and organ - over the same 3-octave range. It also includes four presets that select one or more of the instruments to be available with different performance parameters. You can download the SD image and Preset spreadsheet file from the links below:

WAV Trigger Pro Keyboard Demo SD Image

WAV Trigger Pro Keyboard Demo Preset Sheet

Percussion Demo

The Percussion demo is intended for use with a velocity-sensitive pad MIDI controller to demonstrate things like velocity mapping and multiple actions per MIDI note. It includes a selection of effects, dialog and percussion. The preset file includes comments to help explain

WAV Trigger Pro Percussion Demo SD Image

WAV Trigger Pro Percussion Demo Preset Sheet

MicroSD Card Preperation

The Qwiic WAV Trigger Pro requires a µSD card to store and load WAV and Preset files.

This and other WAV Trigger boards from robertsonics interact differently with SD cards than what manufacturers typically expect. WAV Triggers rely on fast and, more importantly, reliable file access with small timeout windows. The WAV Trigger Pro firmware is only compatible with SD cards formatted to either a FAT16 or FAT32.

We strongly recommend using cards that use one of these formats by default. If you are using a larger capacity SD card that uses another format (exFAT, etc.), you must format it to FAT32 and set the max allocation size to 32k. You can set both of these using the Qwiic Format application in Windows.

Robertsonics has done some fairly extensive testing with his previous WAV Trigger boards and has some great write ups on SD card performance and the unique requirements of the WAV Trigger boards. These offer a few recommendations though some of the recommended cards may no longer be available or have updated versions of them:

Format µSD Card

If you're using a brand new SD card, you may not need to format it though it may come with pre-installed files that could cause performance issues with the WAV Trigger Pro. The Quick Format option in Windows is the usually the simplest method to properly format the µSD card.

µSD Card Contents & Naming Convention

The SD Card should only contain .wav audio files and .csv Preset files following the proper naming convention. Preset files, as covered in the previous section, should be named "set_nnnn.csv" where "nnnn" is a 4-digit number with leading zeroes (eg. "set_0001.csv" would be Preset 1). WAV files should be named "nnnn.wav" where "nnnn" is a 4-digit number with leading zeros. If you'd like, you can add a descriptor to the audio filenames by adding an underscore to the file name followed by the descriptor (eg. "0123_piano.wav").

Audio File Format

If your audio files are using another format, you'll need to convert them to 16-bit, 44.1kHz mono or stereo WAV format. There's many options for converting audio files but the WAV Trigger Pro does not support WAV files with any additional header information or metadata. Some audio recording programs, such as Pro Tools, write additional information at the start of the file. An easy way to remove the unnecessary header information is to utilize Audacity. Users can use this software to export a file as WAV (Microsoft) signed 16-bit PCM and clear out the metadata containing the header infromation (i.e. title, artist, genre, etc.).

The following video gives a brief demonstration of the Audacity export process.

Updating Firmware

The Qwiic WAV Trigger Pro comes pre-loaded with firmware to use it as a MIDI device but, as covered previously, the WAV Trigger Pro can be used as either a MIDI device or MIDI host with the approrpiate firmware. In the future, there may be updates to the WAV Trigger Pro's firmware users can upload to the board if necessary. In this section we'll go over how to upload the MIDI Host firmware to the board but these steps also work for updating or reverting firmware versions.

STM32 CubeProgrammer Software

Uploading new firmware is best done using the STM32 CubeProgrammer software. You can upload new firmware to the board over USB-C, USB-to-Serial converter like the Serial Basic Breakout - 3.3V USB-C connected to the serial PTH pins, or with an STLink debugger and the SWD header. We strongly recommend uploading over USB since all you need is a USB-C cable, closing the BOOT jumper/tying BOOT to GND, and a computer with the STM32 Cube Programmer software. This guide only covers uploading new firmware over USB-C.

Start by downloading the CubeProgrammer software for your operating system from this page. Note, downloading does require submitting a valid e-mail and clicking a confirmation link sent to that e-mail. Once downloaded, follow the installation instructions and then open Cube Programmer and you should be greeted by a screen similar to the image below:

Screenshot of CubeProgrammer main window.

Updloading New WAV Trigger Firmware

All versions of the WAV Trigger Pro firmware are hosted on robertsonics' downloads page under the "WAV Trigger Pro" header. The WAV Trigger Pro ships with the MIDI Device Firmware so let's take a look at uploading the MIDI Host Firmware.

MIDI Host Firmware

Start by downloading the MIDI Host firmware from robertsonics' downloads page. Take note of where that downloads to as we'll need to direct the STM32 CubeProgrammer software to that file.

BOOT Jumper

Prior to connecting the WAV Trigger Pro to your computer, close the BOOT PTH jumper (either using headers and a jumper connector/jumper wire or simply temporarily pulling BOOT to GND) to set the STM32 into BOOT Mode. The board should stay in BOOT mode until reset or power cycle. The photo below shows the BOOT jumper closed using a jumper wire plugged into male headers on the board:

Photo showing BOOT jumper closed.

Upload New Firmware

With the board in BOOT mode, return to the Cube Programmer software and switch to the "Erasing & Programming" view by clicking the second icon on the left side of the window. Next, either enter the filepath for the new firmware or click "Browse" to naivgate to the firmware file. On the right side of the window, select "USB" on the drop-down menu for programmer type. The USB port should automatically detect which port the WAV Trigger is on but if not, click the refresh button and manually select the port, then click "Connect".

Screenshot of CubeProgrammer with WAV Trigger connected.

Make sure everything is configured properly and then click "Start Programming" to begin uploading the new firmware. This should take only a few seconds and once it's complete, disconnect the BOOT jumper (if needed) and press the RESET button. The WAV Trigger Pro should now appear as a USB audio device.

Hardware Assembly

Audio Output & Serial Console

Audio Output Pins (Required)

The audio output of the WAV Trigger Pro is routed to three 0.1"-spaced headers labeled L, G and R. This requires some through-hole soldering of either wires or headers to connect to your preferred audio output. For the purposes of this guide we'll be soldering headers to these pins to connect to a SparkFun TRRS 3.5MM Jack Breakout to plug a pair of headphones into.

The WAV Trigger Pro requires soldering to these pins regardless of how it is configured and used so make sure to complete this step at some point during your preferred assembly.

Soldering

New to soldering?

If you have never soldered before or need a quick refresher, check out our How to Solder: Through-Hole Soldering guide.

Tutorial's thumbnail
How to Solder: Through-Hole Soldering

Start by locating the three-pin PTH header with the labels R, G and L. Depending on whether you prefer a permanent soldered connection or something removeable, solder either wire or male/female headers to these pins like the photo below shows with male headers soldered:

Photo showing male headers soldered to the Audio PTHs

If you're using the TRRS Breakout like we are, make sure to solder male/female headers or wire to the pins on that breakout like this:

Photo showing headers soldered to TRRS breakout.

Wiring

Next connect the TRRS Breakout (or your preferred audio output) to the WAV Trigger's audio pins. Make the following connections if you're connecting the WAV Trigger to the TRRS 3.5mm Breakout:

WAV Trigger Pro TRR Breakout Color
R RING1 RED
G SLEEVE BLACK
L TIP YELLOW

Photo showing WAV Trigger Pro connected to TRRS Breakout

Serial Console Interface

The WAV Trigger Pro features a serial console interface that works over the board's RX/TX pins (@3.3V Logic) allowing users to connect a USB-to-Serial converter like the Serial Basic Breakout - 3.3V USB-C to send and receive information over that serial connection. The serial console works in all WAV Trigger Pro assembly options we cover in the following sections to provide helpful information about and control of the board.

Serial Assembly

Connect to the serial console interface using the TX/RX and GND pins on the WAV Trigger Pro making sure to use either a 3.3V serial converter like the one linked above or by properly level shifting one that runs at a different logic to 3.3V. The table and photo below outline the connections between the WAV Trigger and Serial Basic Breakout - 3.3V:

WAV Trigger Pro Serial Basic Color
TX RX ORANGE
RX TX GREEN
G GND BLACK

Photo showing Serial Basic connected to WAV Trigger serial pins.

After connecting the boards together, connect the Serial Basic to your computer over USB and connect the WAV Trigger Pro either over USB-C or another of the power inputs (Qwiic, 5V). Next, open the serial monitor in the Arudino IDE (or if you prefer, another terminal program) at 57.6k baud with Carriage Return line ending enabled.

Next, type in "help" (enter this and all other commands in all lowercase) and it will print out a list of available commands along with any available parameters to customize the command. Commands with just one parameter can be sent with a single space between the command and parameter. For commands with multiple parameters, separate the command and parameters using a comma. The list below outlines each command and what it does:

  • help - Displays the available commands and their parameters
  • stat - Returns a string that includes the WAV Trigger Pro's firmware version and build info as well as info about the µSD card currently in the board
  • play - Plays the specified track number (if it exists). If this command is sent with just one parameter the track plays at full volume, center panned, 0 pitch offset, attack and release times of 0ms and is not looped or locked. Use the optional additional parameters outlined in the "help" menu to customize the playback.
  • stop - If sent with a track number, this stops the track immediately. The track fades out over the specified number of milliseconds before stopping if sent with a release value. If no track number is sent, this stops all tracks immediately.
  • gain - Sets the output attenuation of the board.
  • v - Returns the number of currently active voices.
  • sd - When sent with no parameter, this returns the current longest µSD block read in microseconds since the WAV Trigger Pro was powered on, reset or the value was reset. If sent with a parameter of 0, this resets the value manually.
  • test - This command will stop the audio engine and start a block read timing test of the installed microSD card. The optional test count parameter can be used to specify the number of block read cycles in the test. If used with no parameter, the test will perform 100,000 block read cycles. It’s important to keep in mind that the test will only read blocks actually allocated to .wav files, so the more .wav files are on your card, the more of the card will be tested. While the test is running, a command of “r” can be used to see partial results, or “s” to stop the test prematurely. The audio engine will be restarted when the test finished or is stopped. For a detailed overview and discussion of the test performed here, refer to this article

Qwiic Assembly

The Qwiic WAV Trigger Pro can be controlled over a Qwiic (I2C) connection with a development board using the WAV Trigger Pro Qwiic Arduino Library. The Qwiic interface works with the WAV Trigger Pro running either MIDI Device (default) or MIDI Host firmware.

Qwiic Assembly

Using the WAV Trigger Pro over Qwiic is simple as it just requires a connection to a Qwiic-enabled development board using a Qwiic cable. If your preferred development board does not have a Qwiic connector, you can use this Qwiic breadboard adapter cable to connect to the I2C bus.

Photo of Qwiic assembly.

Trigger Input Assembly

Preparing Trigger Pins

The WAV Trigger Pro has eight trigger pins routed to 0.1"-spaced headers that can be used to trigger MIDI playback for the first eight MIDI notes defined by the Preset file. If you're using these pins we recommend soldering either wire to whatever input you decide to use (button, switch, etc.) or if you'd like a removeable connection you can solder headers to these pins and use jumper wires to connect to the trigger inputs.

Photo of soldered trigger pins.

Trigger Breadboard Assembly

For the purposes of this guide, we wired the first four trigger inputs to four push-buttons on a breadboard for a quick demo on using these inputs. Make sure to create a common ground by connecting a wire from one of the WAV Trigger Pro's ground pins to the ground rail on the breadboard and then wire each button to a trigger pin and the breadboard's ground rail like the photo below shows:

Photo of completed trigger assembly to four push-buttons.

MIDI Device Assembly

With the default firmware, the WAV Trigger Pro acts as a MIDI Device and can be controlled from a MIDI Host over USB. Simply plug the board into your keyboard or other MIDI controller and start playing. You can also use your computer with a Digital Audio Workstation (DAW) software like MIDI-OX to route incoming MIDI messages from your keyboard to the WAV Trigger Pro.

[Photo of WAV Trigger Pro plugged in over USB to MIDI Host.]

This video from robertsonics shows how to use the Qwiic WAV Triger Pro as a MIDI Device connected to a MIDI keyboard through a PC with his Keyboard Demo SD image:

MIDI Host Assembly

MIDI Host Firmware

Running the WAV Trigger Pro as a MIDI USB Host requires uploading the proper firmware. Before setting up the WAV Trigger Pro to act as a MIDI Host, refer to the Updating Firmware section for detailed instructions on uploading the MIDI Host firmware.

Hardware Adjustments

Now we need to adjust the HST/DEV solder jumpers to configure the board to act as a USB Host. Locate these jumpers on the underside of the board and sever the trace connecting the "Center" and "Right" pads and then carefully solder the "Center" and "Left" pads together. Next, close the VBUS jumper by soldering the two pads together. After adjusting these jumpers your board should look similar to the photo below:

Photo showing HST/DEV & VBUS jumpers altered for MIDI Host performance.

Next, prepare to connect the power supply for the MIDI assembly by either soldering wires directly to the 5V and GND pins or soldering headers to these pins for a removeable power connection. We opted for headers to make a temporary power connection shown in the photo below:

Photo showing male headers soldered to power PTHS.

Completed Assembly

Now that the WAV Trigger Pro is set up to act as a MIDI host, connect your MIDI device to the WAV Trigger Pro over USB-C. We used this USB MIDI Keyboard connected to the WAV Trigger Pro using a USB Type-C to USB Type-B cable. With that plugged in, connect the WAV Trigger Pro to a 5V power supply and it should end up looking something like this:

Photo of completed MIDI Host assembly with keyboard connected.

Drumpad Demo Video

The video below by robersonics gives a short rundown on using the Qwiic WAV Trigger Pro as a MIDI Host to a MIDI drumpad using his Percussion Demo SD image:

WAV Trigger Pro Qwiic Arduino Library

Library Installation

Attention

If this is your first time using Arduino, please read through our tutorial on installing the Arduino IDE. If you have not installed an Arduino library before, we recommend you check out our installation guide.

WAV Trigger Pro Qwiic Arduino Library

The WAV Trigger Pro Qwiic Arduino Library allows you to control the audio playback on the WAV Trigger Pro over a Qwiic connection to an Arduino development board. Users can download and install the library through the Arduino Library Manager by searching for "WAV Trigger Pro Qwiic" and selecting the latest version. If you prefer to manually install the library, download a ZIP of it by clicking the button below:

WAV Trigger Pro Qwiic Arduino Library (ZIP)

With the library installed, let's take a closer look at the examples included in it.

Examples

Required Audio Files

The examples included in the WAV Trigger Pro Qwiic library assume users have an SD card with the demo tracks loaded onto it. You can download a copy of the audio tracks from the link below:

WAV Trigger Pro Arduino Example Sounds

The Arduino examples do not require a preset, just the specific tracks included in the link above. Just download these tracks, unzip the files and load them onto your µSD card and you're ready to get started with the Aruino examples.

Code to Note

All four examples include similar setups to initialize the WAV Trigger Pro on the I2C bus, return the firmware version string and number of available audio tracks. All of these steps have a message printed out over serial so to view them open the Arduino serial monitor with the baud set to 9600 to see these messages. If any of these fail, the code will print out "WAV Trigger Pro response not available".

Example 1 - Loop Track

The first example demonstrates how to loop a single track (in this case, a 440Hz sine wave) continuously. Open the example by navigating in Arduino to "File > Examples > SparkFun WAV Trigger Pro Qwiic > Example_01_Loop_Track" or copy the code below into a blank sketch.

Example 1 - Loop Track
// ****************************************************************************
//       Sketch: WAV Trigger Pro Qwiic Library Example 1
//               Loop a track
// Date Created: 1/6/2025
//
//     Comments: This example starts a single track looping.
//
//     Requires: The WAV Trigger Pro Arduino example tracks should be
//               installed on the microSD card:
//
//        Tracks  1 - 8: Spoken numbers
//       Tracks 48 - 84: Piano notes
//            Track 100: Stereo A440 Sine Wave, 8 secs
//            Track 101: Mono 1K Sine Wave, 8 secs
//            Track 102: Stereo ambient music
//            Track 103: Stereo acoustic guitar
//            Track 104: Dialog 1
//            Track 105: Dialog 2
//     Tracks 200 - 208: EDM percussion
//
// ****************************************************************************

#include "WAVTriggerPro.h"

#define LED 13  // Our LED

#define HEARTBEAT_PERIOD_MS 2000
#define POLLING_PERIOD_MS 500

// ****************************************************************************
// Global variables

WAVTriggerPro wtp;  // Our WAV Trigger Pro object

unsigned long gMsTick;
unsigned long gLastFlashMs;
int gLedTimeout = 0;
int gNumTracks = 0;

// Allocate a buffer for the version string
char gVersion[VERSION_STRING_LEN + 2];

// ****************************************************************************
// setup
// ****************************************************************************
void setup() {

  // Initialize the LED pin
  pinMode(LED, OUTPUT);
  digitalWrite(LED, 0);

  Wire.begin();
  Serial.begin(9600);

  // Provide time for the WAV Trigger Pro to finish reset before trying to send
  //  any commands.
  delay(10);

  // WAV Trigger Pro initialization
  if (!wtp.begin()) {
    Serial.print("Could not start the WAV Trigger Pro\n");
  } else {
    Serial.print("\n*******************\n");
    Serial.print("Qwiic device found\n");
    Serial.print("Address: ");
    Serial.print(wtp.getAddress());
    Serial.print("\n");
  }

  // Issue a stop all tracks
  wtp.stopAll();
  delay(5);

  // Get the version string and number of available tracks
  if (wtp.getVersion(gVersion)) {
    Serial.print("Version: ");
    Serial.print(gVersion);
    Serial.print("\n");
    //delay(5);
    gNumTracks = wtp.getNumTracks();
    Serial.print("Number of tracks: ");
    Serial.print(gNumTracks);
    Serial.print("\n");
    //delay(5);
  } else
    Serial.print("WAV Trigger Pro response not available");

  gMsTick = millis();
  gLastFlashMs = gMsTick;

  // Start the A440 sine wave looping, -20dB, center, 1 second attack.
  wtp.trackPlayPoly(100, -20, BALANCE_MID, 1000, 0, LOOP_FLAG);

}

// ****************************************************************************
// loop
// ****************************************************************************
void loop() {

  // ================== MAIN LOOP TASK 1 ===================
  // Flash the hearbeat LED
  if ((gMsTick - gLastFlashMs) > HEARTBEAT_PERIOD_MS) {
    gLastFlashMs = gMsTick;
    gLedTimeout = 25;
    digitalWrite(LED, 1);
  }


  // ================== MAIN LOOP TASK 2 ===================
  // Keep gMsTick up to date
  if (millis() > gMsTick) {
    gMsTick = millis();
    if (gLedTimeout > 0) {
      if (--gLedTimeout == 0) {
        digitalWrite(LED, 0);
      }
    }
  }
}

The example initializes the WAV Trigger Pro over I2C along with the other checks outlined above and then plays the sine wave file on loop at -20dB in stereo (centered), with a 1 second attack using the command: wtp.trackPlayPoly(100, -20, BALANCE_MID, 1000, 0, LOOP_FLAG);

Example 2 - Play Tracks

The second example demonstrates how to loop through a sequence of tracks. It continuously plays the eight spoken number tracks in sequential order alternating output between the left and right audio channels.

Example 2 - Play Tracks
// ****************************************************************************
//       Sketch: WAV Trigger Pro Qwiic Library Example 2
//               Playing tracks
// Date Created: 1/3/2025
//
//     Comments: This example continuously plays the eight spoken number
//               tracks in order, to alternating left right output channels.
//
//     Requires: The WAV Trigger Pro Arduino example tracks should be
//               installed on the microSD card:
//
//        Tracks  1 - 8: Spoken numbers
//       Tracks 48 - 84: Piano notes
//            Track 100: Stereo A440 Sine Wave, 8 secs
//            Track 101: Mono 1K Sine Wave, 8 secs
//            Track 102: Stereo ambient music
//            Track 103: Stereo acoustic guitar
//            Track 104: Dialog 1
//            Track 105: Dialog 2
//     Tracks 200 - 208: EDM percussion
//
// ****************************************************************************

#include "WAVTriggerPro.h"

#define LED 13  // Our LED

#define HEARTBEAT_PERIOD_MS 2000
#define POLLING_PERIOD_MS 500

// ****************************************************************************
// Global variables

WAVTriggerPro wtp;  // Our WAV Trigger Pro object

unsigned long gMsTick;
unsigned long gLastFlashMs;
unsigned long gLastPollMs;
int gLedTimeout = 0;
int gNumTracks = 0;
int gNumActiveVoices = 0;
int gTrackNum;
int gBalance;

// Allocate a buffer for the version string
char gVersion[VERSION_STRING_LEN + 2];

// ****************************************************************************
// setup
// ****************************************************************************
void setup() {

  // Initialize the LED pin
  pinMode(LED, OUTPUT);
  digitalWrite(LED, 0);

  Wire.begin();
  Serial.begin(9600);

  // Provide time for the WAV Trigger Pro to finish reset before trying to send
  //  any commands.
  delay(10);

  // WAV Trigger Pro initialization
  if (!wtp.begin()) {
    Serial.print("Could not start the WAV Trigger Pro\n");
  } else {
    Serial.print("\n*******************\n");
    Serial.print("Qwiic device found\n");
    Serial.print("Address: ");
    Serial.print(wtp.getAddress());
    Serial.print("\n");
  }

  // Issue a stop all tracks
  wtp.stopAll();
  delay(5);

  // Get the version string and number of available tracks
  if (wtp.getVersion(gVersion)) {
    Serial.print("Version: ");
    Serial.print(gVersion);
    Serial.print("\n");
    //delay(5);
    gNumTracks = wtp.getNumTracks();
    Serial.print("Number of tracks: ");
    Serial.print(gNumTracks);
    Serial.print("\n");
    //delay(5);
  } else
    Serial.print("WAV Trigger Pro response not available");

  gMsTick = millis();
  gLastFlashMs = gMsTick;
  gLastPollMs = gMsTick;
  gTrackNum = 0;
  gBalance = 0;
}

// ****************************************************************************
// loop
// ****************************************************************************
void loop() {

  // ================== MAIN LOOP TASK 1 ===================
  // Play next track when the previous is finished
  if ((gMsTick - gLastPollMs) > POLLING_PERIOD_MS) {
    gLastPollMs = gMsTick;

    // Wait for no tracks playing
    gNumActiveVoices = wtp.getNumActiveVoices();
    if (gNumActiveVoices == 0) {
      if (++gTrackNum > 8)
        gTrackNum = 1;

      Serial.print("Play track: ");
      Serial.print(gTrackNum);
      Serial.print("\n");

      wtp.trackPlayPoly(gTrackNum, 0, gBalance, 0, 0, 0);

      // Next track should be to the opposite channel
      if (gBalance > 0)
        gBalance = 0;
      else
        gBalance = 127;
    }
  }

  // ================== MAIN LOOP TASK 2 ===================
  // Flash the hearbeat LED
  if ((gMsTick - gLastFlashMs) > HEARTBEAT_PERIOD_MS) {
    gLastFlashMs = gMsTick;
    gLedTimeout = 25;
    digitalWrite(LED, 1);
  }


  // ================== MAIN LOOP TASK 3 ===================
  // Keep gMsTick up to date
  if (millis() > gMsTick) {
    gMsTick = millis();
    if (gLedTimeout > 0) {
      if (--gLedTimeout == 0) {
        digitalWrite(LED, 0);
      }
    }
  }
}

Example 3 - Mix Tracks

The third example shows how to mix several tracks to play together. It starts the mix with an ambient music track, then plays a dialog track followed by a fade into a second music track.

Example 3 - Mix Tracks
// ****************************************************************************
//       Sketch: WAV Trigger Pro Qwiic Library Example 3
//               Mixing tracks
// Date Created: 1/3/2025
//
//     Comments: This example combines music and dialog tracks.
//
//     Requires: The WAV Trigger Pro Arduino example tracks should be
//               installed on the microSD card:
//
//        Tracks  1 - 8: Spoken numbers
//       Tracks 48 - 84: Piano notes
//            Track 100: Stereo A440 Sine Wave, 8 secs
//            Track 101: Mono 1K Sine Wave, 8 secs
//            Track 102: Stereo ambient music
//            Track 103: Stereo acoustic guitar
//            Track 104: Dialog 1
//            Track 105: Dialog 2
//     Tracks 200 - 208: EDM percussion
//
// ****************************************************************************

#include "WAVTriggerPro.h"

#define LED 13  // Our LED

#define HEARTBEAT_PERIOD_MS 2000
#define POLLING_PERIOD_MS 100

// ****************************************************************************
// Global variables

WAVTriggerPro wtp;  // Our WAV Trigger Pro object

unsigned long gMsTick;
unsigned long gLastFlashMs;
unsigned long gLastPollMs;
int gLedTimeout = 0;
int gNumTracks = 0;
int gNumActiveVoices = 0;
int gDelayCount = 0;
int gState = 0;

// Allocate a buffer for the version string
char gVersion[VERSION_STRING_LEN + 2];

// ****************************************************************************
// setup
// ****************************************************************************
void setup() {

  // Initialize the LED pin
  pinMode(LED, OUTPUT);
  digitalWrite(LED, 0);

  Wire.begin();
  Serial.begin(9600);

  // Provide time for the WAV Trigger Pro to finish reset before trying to send
  //  any commands.
  delay(10);

  // WAV Trigger Pro initialization
  if (!wtp.begin()) {
    Serial.print("Could not start the WAV Trigger Pro\n");
  } else {
    Serial.print("\n*******************\n");
    Serial.print("Qwiic device found\n");
    Serial.print("Address: ");
    Serial.print(wtp.getAddress());
    Serial.print("\n");
  }

  // Issue a stop all tracks
  wtp.stopAll();
  delay(5);

  // Get the version string and number of available tracks
  if (wtp.getVersion(gVersion)) {
    Serial.print("Version: ");
    Serial.print(gVersion);
    Serial.print("\n");
    //delay(5);
    gNumTracks = wtp.getNumTracks();
    Serial.print("Number of tracks: ");
    Serial.print(gNumTracks);
    Serial.print("\n");
    //delay(5);
  } else
    Serial.print("WAV Trigger Pro response not available");

  gMsTick = millis();
  gLastFlashMs = gMsTick;
  gLastPollMs = gMsTick;
  gDelayCount = 10;
  gState = 0;
}

// ****************************************************************************
// loop
// ****************************************************************************
void loop() {

  // ================== MAIN LOOP TASK 1 ===================
  // Proceed to the next state when the time comes
  if ((gMsTick - gLastPollMs) > POLLING_PERIOD_MS) {
    gLastPollMs = gMsTick;

    // Process according to state
    switch (gState) {

      // State 0: start the ambient music
      case 0:
        if (gDelayCount > 0)
          gDelayCount--;
        else {
          Serial.println("Starting music 1");
          wtp.trackPlayPoly(102, 0, BALANCE_MID, 0, 0, 0);
          gState++;
          gDelayCount = 60;  // Delay 6 seconds
        }
        break;

      // State 1: start dialog 2 track
      case 1:
        if (gDelayCount > 0)
          gDelayCount--;
        else {
          Serial.println("Starting dialog 1");
          wtp.trackPlayPoly(105, 0, BALANCE_MID, 0, 0, 0);
          gState++;
        }
        break;

      // State 2: wait for dialog track to finish
      case 2:
        if (wtp.trackGetStatus(105) == 0) {
          Serial.println("Cross-fading to music 2 ");
          wtp.trackPlayPoly(103, 0, BALANCE_MID, 4000, 0, 0);
          gState++;
          gDelayCount = 20;  // Delay 1 second
        }
        break;

      // State 3: crossfade to music 2
      case 3:
        if (gDelayCount > 0)
          gDelayCount--;
        else {
          wtp.trackStop(102, 4000);
          gState++;
          gDelayCount = 30;
        }
        break;

      // Do nothing
      default:
        break;
    }
  }

  // ================== MAIN LOOP TASK 2 ===================
  // Flash the hearbeat LED
  if ((gMsTick - gLastFlashMs) > HEARTBEAT_PERIOD_MS) {
    gLastFlashMs = gMsTick;
    gLedTimeout = 25;
    digitalWrite(LED, 1);
  }


  // ================== MAIN LOOP TASK 3 ===================
  // Keep gMsTick up to date
  if (millis() > gMsTick) {
    gMsTick = millis();
    if (gLedTimeout > 0) {
      if (--gLedTimeout == 0) {
        digitalWrite(LED, 0);
      }
    }
  }
}

Example 4 - MIDI

The fourth example demonstrates how to use MIDI commands to play tracks on the WAV Trigger Pro. The example cycles between playing a combination of tracks to create a piano chord, percussion tracks and a second piano chord.

Example 4 - MIDI
// ****************************************************************************
//       Sketch: WAV Trigger Pro Qwiic Library Example 3
//               Using MIDI
// Date Created: 1/3/2025
//
//     Comments: This example uses MIDI to play tracks.
//
//     Requires: The WAV Trigger Pro Arduino example tracks should be
//               installed on the microSD card:
//
//        Tracks  1 - 8: Spoken numbers
//       Tracks 48 - 84: Piano notes
//            Track 100: Stereo A440 Sine Wave, 8 secs
//            Track 101: Mono 1K Sine Wave, 8 secs
//            Track 102: Stereo ambient music
//            Track 103: Stereo acoustic guitar
//            Track 104: Dialog 1
//            Track 105: Dialog 2
//     Tracks 200 - 208: EDM percussion
//
// ****************************************************************************

#include "WAVTriggerPro.h"

#define LED 13  // Our LED

#define HEARTBEAT_PERIOD_MS 2000
#define POLLING_PERIOD_MS 100

#define TEMPO_PERIOD 10

#define MIDI_NOTE_ON 0x90
#define MIDI_NOTE_OFF 0x80

#define NOTE_01 50
#define NOTE_02 54
#define NOTE_03 57

#define NOTE_11 49
#define NOTE_12 52
#define NOTE_13 56

#define NOTE_21 115
#define NOTE_22 112


// ****************************************************************************
// Global variables

WAVTriggerPro wtp;  // Our WAV Trigger Pro object

unsigned long gMsTick;
unsigned long gLastFlashMs;
unsigned long gLastPollMs;
int gLedTimeout = 0;
int gNumTracks = 0;
int gNumActiveVoices = 0;
int gDelayCount = 0;
int gState = 0;

// Allocate a buffer for the version string
char gVersion[VERSION_STRING_LEN + 2];

// ****************************************************************************
// setup
// ****************************************************************************
void setup() {

  // Initialize the LED pin
  pinMode(LED, OUTPUT);
  digitalWrite(LED, 0);

  Wire.begin();
  Serial.begin(9600);

  // Provide time for the WAV Trigger Pro to finish reset before trying to send
  //  any commands.
  delay(10);

  // WAV Trigger Pro initialization
  if (!wtp.begin()) {
    Serial.print("Could not start the WAV Trigger Pro\n");
  } else {
    Serial.print("\n*******************\n");
    Serial.print("Qwiic device found\n");
    Serial.print("Address: ");
    Serial.print(wtp.getAddress());
    Serial.print("\n");
  }

  // Issue a stop all tracks
  wtp.stopAll();
  delay(5);

  // Get the version string and number of available tracks
  if (wtp.getVersion(gVersion)) {
    Serial.print("Version: ");
    Serial.print(gVersion);
    Serial.print("\n");
    //delay(5);
    gNumTracks = wtp.getNumTracks();
    Serial.print("Number of tracks: ");
    Serial.print(gNumTracks);
    Serial.print("\n");
    //delay(5);
  } else
    Serial.print("WAV Trigger Pro response not available");

  gMsTick = millis();
  gLastFlashMs = gMsTick;
  gLastPollMs = gMsTick;
  gDelayCount = 10;
  gState = 0;
}

// ****************************************************************************
// loop
// ****************************************************************************
void loop() {

  // ================== MAIN LOOP TASK 1 ===================
  // Proceed to the next state when the time comes
  if ((gMsTick - gLastPollMs) > POLLING_PERIOD_MS) {
    gLastPollMs = gMsTick;

    // Process according to state
    switch (gState) {

      // State 0: Play the first chord
      case 0:
        if (gDelayCount > 0)
          gDelayCount--;
        else {
          Serial.println("Playing chord 1");
          wtp.sendMidiMsg(MIDI_NOTE_OFF, NOTE_11, 0);
          wtp.sendMidiMsg(MIDI_NOTE_OFF, NOTE_12, 0);
          wtp.sendMidiMsg(MIDI_NOTE_OFF, NOTE_13, 0);
          wtp.sendMidiMsg(MIDI_NOTE_ON, NOTE_01, 100);
          delay(50);
          wtp.sendMidiMsg(MIDI_NOTE_ON, NOTE_02, 100);
          delay(50);
          wtp.sendMidiMsg(MIDI_NOTE_ON, NOTE_03, 100);
          gState++;
          gDelayCount = TEMPO_PERIOD;  // Delay 3
        }
        break;

      case 1:
        if (gDelayCount > 0)
          gDelayCount--;
        else {
          Serial.println("Playing perc 1");
          wtp.sendMidiMsg(MIDI_NOTE_OFF, NOTE_21, 0);
          wtp.sendMidiMsg(MIDI_NOTE_OFF, NOTE_22, 0);
          wtp.sendMidiMsg(MIDI_NOTE_ON, NOTE_21, 100);
          gState++;
          gDelayCount = TEMPO_PERIOD;  // Delay 3
        }
        break;

      // State 1: Play the second chord
      case 2:
        if (gDelayCount > 0)
          gDelayCount--;
        else {
          Serial.println("Playing chord 2");
          wtp.sendMidiMsg(MIDI_NOTE_OFF, NOTE_01, 0);
          wtp.sendMidiMsg(MIDI_NOTE_OFF, NOTE_02, 0);
          wtp.sendMidiMsg(MIDI_NOTE_OFF, NOTE_03, 0);
          wtp.sendMidiMsg(MIDI_NOTE_ON, NOTE_11, 85);
          wtp.sendMidiMsg(MIDI_NOTE_ON, NOTE_12, 85);
          wtp.sendMidiMsg(MIDI_NOTE_ON, NOTE_13, 85);
          gState++;
          gDelayCount = TEMPO_PERIOD;  // Delay
        }
        break;

      case 3:
        if (gDelayCount > 0)
          gDelayCount--;
        else {
          Serial.println("Playing perc 2");
          wtp.sendMidiMsg(MIDI_NOTE_ON, NOTE_22, 100);
          gState = 0;
          gDelayCount = TEMPO_PERIOD;  // Delay
        }
        break;

      // Do nothing
      default:
        break;
    }
  }

  // ================== MAIN LOOP TASK 2 ===================
  // Flash the hearbeat LED
  if ((gMsTick - gLastFlashMs) > HEARTBEAT_PERIOD_MS) {
    gLastFlashMs = gMsTick;
    gLedTimeout = 25;
    digitalWrite(LED, 1);
  }


  // ================== MAIN LOOP TASK 3 ===================
  // Keep gMsTick up to date
  if (millis() > gMsTick) {
    gMsTick = millis();
    if (gLedTimeout > 0) {
      if (--gLedTimeout == 0) {
        digitalWrite(LED, 0);
      }
    }
  }
}

The main loop plays these tracks by sending a MIDI message for the selected tracks using the sendMidiMsg function.

Resources

For more information about the Qwiic WAV Trigger Pro, refer to the following resources:

Troubleshooting

Status LED Information

The green STAT LED can provide some basic information on the current status of the Qwiic WAV Trigger Pro.

  • 3 Quick Blinks - No problems. Both the µSD card and WAV files were found
    • After the initial pattern, the STAT LED will flash quickly every couple seconds as a "Heartbeat"
    • Goes solid while audio is playing
  • 1 Long then 1 Short Blink (Repeating) - No µSD card found
  • 1 Long then 2 Short Blinks (Repeating) - File system error
  • 1 Long then 3 Short Blinks (Repeating) - No WAV Fils found on µSD card
  • 1 Long then 4 Short Blinks (Repeating) - Memory error

Running Temperature

The Qwiic WAV Trigger Pro does run a little warm though in our testing it did not provide any adverse effects and is within the operating temperature range of the STM32. If you plan to continuously power and use the board over a long period of time or have it in an enclosed space, you may want to attach a small heat sink to the STM32 IC.

Preset Demos

Robertsonics has created a couple of sample SD card images for Keyboard and Percussion USB MIDI demos. Each image includes sets of WAV and Preset files in a ZIP download. All you need to do is download the image, unzip it and load it onto an empty and formatted µSD card and plug the card into the WAV Trigger Pro.

Keyboard Demo

The Keyboard demo is intended for use with a MIDI keyboard and includes three sets of instrument sounds - piano, strings and organ - over the same 3-octave range. It also includes four presets that select one or more of the instruments to be available with different performance parameters. You can download the SD image and Preset sheet from the links below:

WAV Trigger Pro Keyboard Demo SD Image

WAV Trigger Pro Keyboard Demo Preset Sheet

Percussion Demo

The Percussion demo is intended for use with a velocity-sensitive pad MIDI controller to demonstrate things like velocity mapping and multiple actions per MIDI note. It includes a selection of effects, dialog and percussion. The preset file includes comments to help explain how the demo works. You can download the SD image and Preset sheet for the demo from the links below:

WAV Trigger Pro Percussion Demo SD Image

WAV Trigger Pro Percussion Demo Preset Sheet

General Troubleshooting

Info

Not working as expected and need help?

If you need technical assistance and more information on a product that is not working as you expected, we recommend heading on over to the SparkFun Technical Assistance page for some initial troubleshooting.

SparkFun Technical Assistance Page

If you can't find what you need there, you'll need a Forum Account to search product forums and post questions.