WAV Trigger performance improvements and update

Just posted v1.28 of the WAV Trigger firmware that dramatically improves the quality of the built-in track fades, and MIDI attack and release volume fades. Previously, volume was adjusted on a per audio buffer basis, resulting in small steps in volume that produced slight, but sometimes noticeable, distortion during fades. The new version now adjusts volume on a per sample basis, producing much smoother dynamic volume adjustments.

I also nailed a couple of subtle issues with interrupt priorities that caused random audio glitches when maxing out 14 voices repeatedly, such as rapidly playing lots of MIDI notes/chords with long release times.

Finally, this new version implements the MIDI Sustain Pedal controller, to make the WAV Trigger even more of a musical instrument.

As I mentioned previously, I’m currently working on support for seamless looping, eventually to include adjustable loop length and starting positions. Loops take more memory than voices, so adding loops will reduce the number of traditional voices. The first implementation will likely be a separate firmware release that supports say 4 independent loops and 8 traditional voices. Exact allocation TBD.


  • reply Dan Lavin ,

    Thanks for the update. Can’t wait to try the new version!

    • reply marcelo ,

      GReat !

      • reply Funken ,

        hey it’s a great job again, i want to make a standalone synth in a sweet wood box with the wavetrigger, with midi keyboard (rock band keybord) just for playing note, changing banck and octave, but do you think i can add 3 knob potentiometer ( 1 / volume / 2 attack / 3 release ) directly on the board ?

        • reply jamie@robertsonics.com ,

          You can, but not directly – The WAV Trigger does not implement any analog inputs. To do this, you’d add an Arduino (such as a Teensy) and use the Arduino to interface to both MIDI and your potentiometers. The Arduino would be responsible for passing the incoming MIDI messages to the WAV Trigger as well as inserting the appropriate controller messages for the parameters you change in response to the potentiometers.

          • reply Funken ,

            ok i try that with a arduino nano, for my potentiometer 1 / MIDI Controller number 7 (Volume)
            2 / MIDI Controller number 73 (Attack) and 3 / MIDI Controller number 72 (Release), cant i add a sample rate and pitch live control ? What is the midi number for that ? and last questions can i have a toggle switch for velocity on / off, that would be great ! thank you again for the answers

            • reply jamie@robertsonics.com ,

              Sample rate (pitch) is controlled with MIDI Pitch Bend messages, not MIDI Controller messages. Review the MIDI spec. You can turn off velocity sensitivity using the init file, but not with a trigger. I’ll add that to the wish list.

              • Funken ,

                ok, thanks for the reply, and yes i see i can turn off velocity sensitivity using the init file, but if we can do this with a trigger that can be great !

                • Funken ,

                  • jamie@robertsonics.com ,

                    Version 1.28 has been torture tested for performance in this regard, so my first thought is that it’s possibly your microSD card. Please refer to this page and perhaps try a different card.

                  • reply Funken ,

                    oh yes ! good point, i change my microSD card and it’s perfect ! thanks again

              • reply babillya ,

                Controlling the board with MIDI, is it possible for the file to continuously loop until a noteOff? or is this what you are working towards? I see that you are working on loops, but wasn’t sure if that meant with or without MIDI as the method of control.
                Thank you! working great so far for my project

                • reply prinztronix ,

                  The WAV Trigger is perfect for my project, so I just bought two.
                  I want to built it in to an enclosure, and wonder if it is possible to attach a full size SD card breakout board to it? If that will work as well as the micro SD card socket on the board.

                  • reply jamie@robertsonics.com ,

                    It’s certainly possible, but I’d be concerned about the added length of the signals. The SDIO interface runs quite fast (25MHz) and you could run into problems if you extend the socket too far off the board. Could be worth a try, though.

                  • reply Rbob123 ,

                    +1 on looping! I have some vintage instrument samples I would like to play via MIDI, since the original instruments are old and unreliable. I would prefer to have dedicated hardware to do this, rather than having to use a laptop or other expensive unit to do this. The WAV Trigger is a perfect solution – inexpensive, small, simple to use! It would even be more perfect if it could do looping! I could extend the length of my samples – they are only about 2-3 seconds now – but being able to loop would be a better solution.

                    Thanks for the WAV Trigger!

                    • reply macePod ,


                      I’m working on an interactive instrument and miss some functionality in order to let it work well.
                      Is it possible to add these functions:

                      – wTrig.trackDuration(track) : returns track duration in ms
                      – wTrig.trackPlaying(track) : returns TRUE while track is playing
                      – wTrig.trackFile(track) : returns TRUE if the file is on the SD-CARD
                      – wTrig.setBank(bank) : sets a sound bank. A bank is like a folder. Default is 0. A convenient way to subdivide and access sounds
                      – wTrig.trackDirection(track, int); -1 for reverse, 0 for pause, +1 for forward. Could be used to set speed too.


                      • reply djsoulmachine ,

                        Hi! I plan to get a WAV trigger very soon!
                        How do I know which firmware version I’ll get?

                        Thanks a lot for this amazing work!

                        • reply djsoulmachine ,

                          Would it be possible in a near future to implement a “half speed playing” like the Mellotron does ? 😀


                          • reply Alvaro Henriques ,

                            Can I connect the TTL RS-232 port to a 5V PIC in/out port or do I need to use a 3.3V line adapter?
                            Thanks to your help.

                            • reply jamie@robertsonics.com ,

                              It’s not RS-232 signal levels, which would be plus/minus up to 15V. But the WAV Trigger inputs are 5V tolerant, so you can use a 5V signal for the serial TX.

                            • reply Fabio ,

                              Dear Jamie,
                              The WAV Trigger is simply amazing!
                              Thanks for doing all this incredible work.
                              Using your Arduino sketch, I managed to connect the board to a Bare Touch Board (this one is based on the Arduino Leonardo) and it works fine.
                              At present the Touch Board takes advantage of the WAV Trigger polyphony to play some .wavs whenever I touch any of the sensors on the TouchBoard. And that’s lots of fun.
                              For some future projects, I would like to play .wavs in a sequence. Each .wav would be hosted in the WAV Trigger’s SD card with the correct sequential naming 001…002…003… every time a sensor it’s touched, the next track is played (Every .wav will only be played once).
                              Is there a way I can put/play more than 2048 .wavs on the SD card?
                              Thanks in advance for your time
                              Kind regards

                              • reply alban guillemot ,

                                Hello Jamie,
                                Your wav trigger is very popular now in France and I have bought quite a few now for different various projects.
                                The last one is a DIY audio book. There are triggers hidden inside the pages.
                                Do you think there is a way to modify the actual default value for the ‘automatic’ little fade out heard when a files is stopped when another starts to play ? In another words, would it be possible to do ‘cross fading’ without using an extra arduino and the serial communication ? Which is the way I am doing it now. You can imagine that space and power supply is a big issue for this small embedded project. By the way, I am very impressed by the low comsumption of your module and its very good sound quality.
                                I thank you very much for your answer,
                                Best regards,
                                Alban G.

                                • reply jamie@robertsonics.com ,

                                  Thanks for the kind words.

                                  There’s already a MIDI Release parameter that extends the fade for MIDI Note-Offs. Would a similar single parameter be sufficient? In other words, it wouldn’t be a separate value for each trigger, but one parameter which would extend the release of all tracks when they were stopped by any trigger.

                                • reply Fabio ,

                                  Hi Jamie,
                                  I would like to use a Bluetooth speaker with the Wav Trigger and notice Sparkfun has the RN52 Bluetooth Hookup.
                                  Would you recommend it (or any other Bluetooth in particular?).
                                  Thanks in advance for your time and for answering.
                                  Best regards

                                  • reply jamie@robertsonics.com ,

                                    Sorry, I’m not familiar with this module and so have no idea. The WAV Trigger outputs line-level stereo audio, so whatever you use will have to convert analog audio to Bluetooth without needing to be controlled, unless you’re also planning to write code for an Arduino.

                                    • reply Fabio ,

                                      Thanks a lot! I’ll give it a try.

                                  • reply Sax ,

                                    Hi Jamie,
                                    First really thank you for your time and your creation.

                                    I’ve created a Piano with my master keyboard, but I’d like to make it more realistic. For example, I would like to add dumper sounds on release keys (note off) and when I press the sustain pedal. Also, I’d like to assign different sounds on different velocity levels for a best dynamic. It would be possible?

                                    I am all ears!

                                    • reply jamie@robertsonics.com ,

                                      I don’t see why not. I can’t help with individual projects, but basically you’ll need to use another micro, such as an Arduino, to interface with your piano. Your code will decide what to play and when, and use the WAV Trigger serial protocol to control the sounds. It supports up to 2048 tracks, which should be enough for several layers of your keys plus additional sounds.

                                      By the way, the latest version of WAV Trigger firmware supports MIDI sustain natively.

                                      • reply Sax ,

                                        Hello Jamie,
                                        Thank you for the answer, my Piano is almost ready!

                                        Just a question, because I use Serial Communication (57600) and not MIDI I lost the sustain functionality, so I had to ricreate his logic (correct?). Here’s the problem: I can’t stop more than one track at the same time with ‘wTrig.trackStop’ function, such as the ‘wTrig.trackPlayPoly’ that works perfectly with all ‘Note On’ events. In my case I need to stop only ‘Note Off’ events when the sustain is released. Probably because ‘wTrig.trackStop’ is not a polyphonic function? How can I solve this?

                                        Example (Note_ON / OFF are my variables from MIDI Note events):
                                        1) wTrig.trackPlayPoly(Note_ON); // This works
                                        2) if (SustainState == 0) { wTrig.trackStop(Note_OFF); } // Problem, it stops one note only

                                        Thank you again,

                                        • reply jamie@robertsonics.com ,

                                          You need to keep track of all the notes that are playing, and which have received a Note-Off, and stop them individually when sustain goes off.

                                          • Sax ,

                                            Hi Jamie, my project is finally closed. Probably I’ll publish a documentation about that. One last question: is there any way to increase polyphony? Maybe using two or more triggers?

                                            Thank you again for all the suggestions.

                                    • reply Dan ,

                                      Hi, the wav trigger is great! One question: perhaps I have misunderstood but for calculating track numbers for use with midi (v1.20), it seems track 329 for example will play for both channel 1, bank 1, note 101 and channel 1, bank 2, note 1. Track 330 will play for both channel 1, bank 1, note 102 and channel 1, bank 2, note 2. This results in maximum number of tracks per channel = 1628. Is this correct? Many thanks.

                                      • reply jamie@robertsonics.com ,

                                        That’s correct if you have an older version of the WAV Trigger firmware. Recent versions changed this to support the full 16 banks of 128 notes, allowing MIDI access to the full 2048 tracks. Please seen the “MIDI Implementation” section of the Online User Guide on this site, which explains the MIDI note to track mapping.

                                      • reply David ,

                                        Hi jamie
                                        I ave the wav trigger v11
                                        I ned thte the same triger boten do mor then one function,like play,and pause.
                                        can it be done with the file maker utility?

                                        • reply jamie@robertsonics.com ,

                                          No. I’m not even sure how that would work. If you have special control requirements, I always recommend using an Ardiuno to implement your own input logic, and the WAV Trigger Arduino library to control the WAV Trigger. That way, you can achieve whatever control logic you want.

                                        • reply ChoonJae ,

                                          Hi jamie !!
                                          the wav trigger is great! I have a question : MIDI Message CTRL 11 (Expression) is not work,
                                          I connect wavTrigger to Arduino with Serial Port, help me !!
                                          Have Nice Day !!

                                          • reply jamie@robertsonics.com ,

                                            Unless you set MIDI mode in the init file, the WAV Trigger won’t recognize MIDI commands. If you do set MIDI mode in the init file, then the baud rate is set to 31.25kbps. See the MIDI implementation in the Online User Guide for usable MIDI commands.

                                          • reply ChoonJae ,

                                            Hi jamie !
                                            Thanks for your response & advise, every MIDI message work very well except Ctrl11 message,
                                            only MIDI Message CTRL 11 not work !!!
                                            please ask for your help
                                            nice day !!

                                            • reply jamie@robertsonics.com ,

                                              The WAV Trigger doesn’t do anything with MIDI Controller 11. Use MIDI Controller 7 to control the overall output volume.

                                            • reply Bartosz ,

                                              Hi Jamie!
                                              I have 3 pieces of Wav Trigger. Its great work of You!
                                              I just build it cases like in Eurocase and can use all possibilities of it!
                                              MIDI 2048 sounds or using 5v sequencer to play some tracks with jack input.
                                              Its like a dream.
                                              But 2 things.
                                              1. I can not play in MIDI modus track 1 (if I push key to Track number 0000 there is track number 0001 so 0000 and 0001 sounds always the same. 1 track in chanel 2 – track number 128 there is no problem) ( firmware v1.28)
                                              2. there is a mistake in one of Your photo about MIDI connection module. red cabel should go in another place like Im showing with a pin in photo2 . link to photos http://www.suterena.com/wavtrigger.htm

                                              mg Bartosz

                                              • reply Nick ,

                                                Hi Jamie,
                                                I just received my Wav Trigger, and have been looking at latency – In my application I would ideally like to have a very consistent latency between trigger and playback of a single waveform. Looking at the Wav Trigger output on an oscilloscope, I see anywhere between 7-16 ms of latency between trigger and playback (I am using a Sandisk Ultra Plus 32GB microSD). Is there anything I can do to make this latency more consistent?

                                                The amount of latency is not a problem, just the variation – a 1-2 ms variation would be ideal.


                                                • reply Matti Niinimäki ,


                                                  I love the WAV Trigger. I’ve used it on several projects, but recently I’ve been running into issues with projects that are running for a long time. I was wondering if you could offer any ideas on how to maybe fix these issues.

                                                  I have a project built inside an old radio in a museum. The visitors can choose the channel of the radio. There is a WAV Trigger inside the radio that is playing 7 different audio files constantly on a loop. An Arduino sends commands to the WAV Trigger to turn up the volume of the channel that is currently active and keeps other channels muted. The reason why they are constantly playing is to simulate a real radio.

                                                  This works perfectly and I’m very happy with it, but after a few weeks of running the installation (about 9 hours everyday) some audio artifacts and glitching start to appear. Sometimes some of the files start glitching resulting in noisy playback or sometimes the WAV Trigger just freezes completely. The freezing results in situations where you can hear a very short segment of some audio file (under 100ms) being looped over an over.

                                                  The issue is remedied by swapping the microSD card with a new one and it will work fine for a week or two, but then the same issues appear. Also, once these issues appear, you can reboot the system and it will work for a couple of hours, but the glitching or freezing comes back after it has been running a little while.

                                                  I’ve tested all my SD cards using your testing firmware and I’m only using cards that show really good performance (around 150 us min latency, 1500 us max latency). I’ve tried three different WAV Triggers. I’ve tried firmwares 1.28 and 1.0. Nothing seems to work.

                                                  I just ordered some industrial grade SD cards to see if they work any better, but they haven’t arrived yet.

                                                  Is there anything you can think of that I could try? I have another similar installation that has been running without any issues for a year now. The main difference with that is that it is only playing 5 audio files simultaneously instead of 7.

                                                  • reply jamie@robertsonics.com ,

                                                    Sorry you are having issues. A couple of questions: Is it just one installation that’s exhibiting this symptom? Are you using the on-board mono amplifier or are you using the line-out with an external amp? What are you using for a power supply, and are you providing adequate cooling?

                                                    Also, when it “freezes”, what is the LED doing?

                                                    It does not sound like an SD card issue to me, but more like your WAV Trigger unit is failing over time, perhaps heat related.

                                                    • reply Matti Niinimäki ,

                                                      Amp: The built-in amplifier is disabled. I’m connecting the line-out to an Adafruit amplifier board https://www.adafruit.com/products/1752

                                                      Power: I’m using a 7.5V DC power supply. The power is split from the supply to the WAV trigger and the amp board. I’m using the 5V pin of the WAV trigger to power the Arduino Micro that is running the code (is that a bad idea?).

                                                      There is no additional cooling, but all the electronics are inside an old tube radio with tons of space and lots of holes for airflow. The amp and the WAV trigger are quite close to each other, but still far enough that I don’t think any heat from the amp would affect the WAV Trigger.

                                                      I haven’t been able to see the LED when it’s frozen. I’ll try to make it happen at my studio again.

                                                      I’ve used a similar setup in many other works and only once seen the similar behavior happen. It was after one player was physically pushded around by a visitor and some physical stress was applied to the sd card. In that one the sd card is accesible through a slot in the custom case I made, so once the case broke it would have twisted the card in the slot. This one was also fixed by changing the card and it ran without any problems for the rest of the exhibition (3-4 months).

                                                      I thought about the overheating too, since it needs to run for a little while before any problems appear. It is doing a lot since it’s playing 7 files constantly on a loop.

                                                      Just got the industrial grade sd cards, I’ll go try them out. If that does not work, I’ll try to add some heat sinks or other cooling.

                                                      • reply Matti Niinimäki ,

                                                        Now that I thought about it more, I’ll also do some tests if the microSD card itself heats up when running for a long time with multiple files playing. Maybe that could be the issue…

                                                        • reply jamie@robertsonics.com ,

                                                          You should certainly be careful when powering external equipment using the WAV Trigger’s 5V. The regulator can get plenty warm, and the internal current requirements go up when playing audio. Ada fruit sells tiny stick-on heat sinks that fit on top of the regulator and may help if that’s a problem.

                                                          Since you believe it’s related to the SD card, I’d be interested to know if the problem, once it occurs, follows the card. Once you’ve determined that a card is “bad”, is it still bad if you:

                                                          1) Put it in another WAV Trigger?
                                                          2) Reformat it?

                                                          Has a “bad” card ever become “good” again?

                                                          As I have written elsewhere, the WAV Trigger is a playback-only device and has no code that can write to the SD card. I have yet to ever see myself where the WAV Trigger has corrupted a card. Not saying it isn’t possible, just that I’ve never seen it, or seen proof of it.

                                                          The symptoms you describe sound more like the processor is getting off track, which it can do if there’s a power supply, heat or noise issue.

                                                    • reply Johan ,


                                                      The WAV Trigger is such a great device! I plan on using it for triggering backing tracks on stage using MIDI. However, I have a problem with playing long WAV files (between 3-11 minutes long): All WAV-files stop playing exactly at the same point – something like after 2 minutes and 30 seconds (it was a time since I tested it so I can’t remember the exact time). However, I think I have an old firmware (1.02 or something). Is this a bug that has been taken care of in later firmwares or is this still an issue?

                                                      I have also a feature request: Would it be possible to turn off the “OMNI” feature of the device? Now it listens to data on all MIDI channels, but since I have other MIDI equipment on the same cable I would like the WAV trigger only to listen to a selected MIDI channel.

                                                      Best regards,

                                                      • reply jamie@robertsonics.com ,

                                                        Please upgrade the latest firmware and then let me know if it still happens.

                                                        The WAV Trigger firmware maps the MIDI Channel to a unique set of tracks – i.e. each channel plays it’s own set of sounds. If you don’t supply the corresponding tracks for that channel, it doesn’t play anything. So I’m not sure what you mean by, “I would like the WAV Trigger only to listen to a selected MIDI Channel.” It kind of does this already.

                                                        • reply Johan ,

                                                          Thanks for your fast feedback! I will try to update the firmware.

                                                          What I mean is that if you have many devices (for instance synthesizers, effect processors etc.) sharing the same MIDI port (16 channels), you want each synth to correspond to ONLY one, selected channel. For instance, I could set my synthesizer to only respond to channel 1, my effect processor to respond to channel 2, and my WAV trigger to respond to channel 3. That way I could control each of them individually from the same port, using a MIDI thru box. Now the WAV trigger responds to all 16 channels, due to the non-standard way that the WAV trigger’s bank change works:

                                                          “You can change banks in any one of 3 ways:

                                                          -Change the MIDI Channel that your MIDI Controller is transmitting on. The MIDI Channel number (starting at 0) is added to the bank number.
                                                          -Install buttons on two of the WAV Trigger’s trigger inputs and use the MIDI BankUp and MIDI BankDn trigger functions.
                                                          -Send MIDI Program Change messages from your MIDI Controller.”

                                                          It would be nice if the WAV trigger could be set to only respond to a single, selected, MIDI channel, and that patches would be changed my the standardized MIDI program change and bank change messages. As it is now, I need to dedicate a single MIDI port only for the WAV trigger.

                                                          While the workaround you mentioned above works when only sending notes on the adjacent channels, I think it still reacts to MIDI commands (like program change, “all notes off” etc) on all channels, right? So sending for instance a program change on channel 2, meant for my effect box, would also change the program of the WAV trigger?

                                                          • reply Jamie ,

                                                            I’ve been busy on a new product development (coming soon) the last few months, I do have a list of enhancements to the WAV Trigger that I’ll get to soon. No promises, but I’ll review this then and see if there’s a way I can accommodate this one.

                                                            • reply Jamie ,

                                                              Please have a look at the most recent blog post. There’s something for you to try.

                                                        • reply Mitch ,

                                                          So I’m building these crazy prop user input device things for a VR/AR project and I’m synchronizing WAV data to a bunch of RGB LED’s. The docs mention that you don’t support additional payloads in the RIFF structure which I can deal with, but is there any chance / maybe already an undocumented method to get at the contents of the uSD via serial?

                                                          Great work on the board by the way! Cheers!

                                                          • reply Charles ,

                                                            Thank you for a great product! Is the firmware open source? I have not seen any links to it and would really enjoy exploring it if is available.

                                                            • reply Jamie ,

                                                              Thanks for the kind words. The WAV Trigger firmware is not open source, is copyrighted and is intended to run only on SparkFun hardware. The hardware is open source, the schematics are available, and you’re free to download an ARM IDE, such as the Keil MDK-ARM, and write your own code. You can even use the WAV Trigger firmware flashing utility to upload your own executable.

                                                              • reply Charles ,

                                                                Thanks for your reply! Unfortunately, coding my own firmware would be way above my current coding skill level!

                                                                I was hoping to connect multiple WAV Triggers (10+) and then, using the polyphonic capabilities, have each unit play up to the maximum 14 sounds simultaneously. Ordinarily, I would incorporate an Arduino, but this project needs the polyphonics.

                                                                Since accessing each of the WAV Triggers will also eventually be difficult, I was exploring ways of having all of the WAV Triggers read from a single SD card – which I thought might be possible if I modified each WAV trigger’s firmware in order to change the starting track from the default ‘001/0001’ to the next logical number in the sequence.

                                                            • reply Christian ,

                                                              Tsunami is exactly what i was trying to accomplish with the WAV Trigger, the only concern is 3.3v. I want to trigger with a tiptop audio circa rhythm which outputs trigger/gate at 5v/0v.
                                                              I’m looking forward for the Tsunami to be available.
                                                              Thank you very much for all your work.

                                                              • reply Jamie ,

                                                                The Atmel SAM S70 is an amazing and fast processor that enables Tsunami’s current (and future) features. Unfortunately, it’s a 3.3V device and its inputs are not 5V tolerant, unlike the WAV Trigger’s STM32F4 processor. Adding level shifting to the product would have further increased the size and price, so I decided to keep it simple.

                                                              • reply Christian ,

                                                                Size is not an issue, so level shifter will do. Can’t wait to get the Tsunami. Is there any possibility to get a notification once the Tsunami is available?

                                                                • reply Jamie ,

                                                                  Just started working on a big post about Tsunami here. I suggest that we start a discussion there and I’ll keep it updated with the production schedule estimates.

                                                                • reply Vincent ,

                                                                  I try to experiment the sustain pedal feature.
                                                                  When releasing a note, I expect longer sound with sustain ON compared to version with simple release. Problem is I cannot hear any change. Any idea?
                                                                  To implement, I use continuous controller (0xB0) register (0x40) value (127) from http://www.indiana.edu/%7Eemusic/cntrlnumb.html My code works to adjust Main Volume or Release Time.

                                                                  • reply Jamie ,

                                                                    The function of sustain is to delay the Note-off until sustain is removed. So with sustain ON, the sound should ignore a Note-Off and continue to play at the same volume until either the end of the file is reached, or sustain is released. Is this not happening?

                                                                    • reply Vincenet ,

                                                                      Finally no problem with the feature sustain ON. I was testing with a song too short and a release time too long to hear the note off when releasing. Thanks for your boards. Regards.

                                                                  Leave a comment