Let’s Talk Tsunami!


Tsunami is a new Robertsonics / SparkFun product, available now. Think WAV Trigger on steroids.

You can read the details on the new product page. I thought I’d use this post to discuss the design philosophy, how Tsunami differs from the WAV Trigger and what that means for you.

The WAV Trigger has been an ongoing exercise in optimization; trying to eke out the maximum performance in terms of number of voices without sacrificing quality and stability. I don’t ever want to hear a glitch, and nor should you!

While the WAV Trigger’s STM32F405 processor speed is certainly a factor, the limiting resource is actually the amount of on-board SRAM, used to buffer each wav file being played by a voice. The absolute maximum number of voices the WAV Trigger can support with 44.1kHz, 16-bit, stereo wav files is 14. Even then, I don’t have enough memory to support true seamless looping (which requires more buffering per voice.) With the latest WAV Trigger firmware release, I feel as though I’ve reached the performance limit for this platform.

Tsunami began when I read about the new Atmel S70 ARM Cortex-m7 processor and realized that it runs almost twice as fast and has twice the amount of on-board SRAM. If I was going to design yet another audio player, this seemed like a good place to start.

Another motivating factor for a new product was the fact that customers were writing to tell me that they really wanted more than a single stereo output. Indeed, some people were using multiple WAV Triggers not to get more voices, but to get more audio output channels. In addition, people are always asking about audio input, which the WAV Trigger doesn’t support since it only has a stereo DAC.

I started with the following goals based on customer feedback from the WAV Trigger:

  • More voices
  • Seamless looping
  • 8 line-level audio outputs (4 stereo)
  • 2 line-level audio inputs (1 stereo)
  • Reset button for changing microSD card without a power cycle
  • Ability to update the firmware directly from the SD card
  • Dedicated MIDI port so you can use MIDI without additional circuitry

I also thought long and hard about connectors. Everyone seems to want something different – 3.5mm, 1/4″, RCA, direct solder terminals… I ultimately decided to keep it simple and just provide dedicated 0.1″ header for everything. You can either wire directly to another unit or make your own connector/cable assembly. This also keeps both the size and cost down. Same with MIDI – No sense in burdening the board with a 5-pin DIN since not everyone will use MIDI. If you do, you can just cut the end off a MIDI cable, connect two wires to the header and you’re in business.

After selecting a multi-channel audio codec and designing a prototype board, I started porting the WAV Trigger code to get a feeling for the performance capabilities of the new processor.

Mono vs Stereo

Another consideration was that many customers have expressed a desire for support for mono wav files. Stereo is not necessary, or even desirable, for every application. And moving to a mono format increases the output routing flexibility, not to mention the fact that memory-wise I can support almost twice as many voices in mono as stereo. In considering this for the WAV Trigger, I came to the conclusion that supporting mono was too costly from a DSP standpoint. The WAV Trigger’s stereo DAC is actually better served by stereo data – it’s much more efficient because the wav files contain the same interleaved format that the DAC wants. Supporting mono playback in the WAV trigger would very likely have reduced the performance.

Tsunami’s TDM codec, however, wants the channels split to begin with, so the penalty for mono is nowhere as severe. Since Tsunami’s firmware can be updated easily from the SD card, without additional hardware, I decided to provide both mono and stereo firmware versions. (Supporting both at the same time is a bit more complicated, and I’ve provided a way to play stereo content in the mono version.) The stereo version is similar to the WAV Trigger, with 18 stereo voices to any of 4 stereo output pairs. The mono version provides a whopping 32 mono voices to any of 8 mono outputs. A new “Synced Pair” trigger function in the mono version plays 2 specified tracks out adjacent outputs for stereo content. (Yes, they are sample-synced.)


MIDI was an afterthought with the WAV Trigger. By that I mean that when I initially designed the WAV Trigger, I had no inkling that the performance would allow for real-time playability. It wasn’t until I got the latency down to around 8ms and the voice count up to 12 (now 14) that serious MIDI control seemed sensible. While it works great, I had to share the serial port and customers have to construct their own MIDI input circuit (to convert MIDI’s 20mA current loop to logic level serial.) This is a royal pain.

So Tsunami has a dedicated MIDI IN (and OUT, not implemented in firmware yet) with an integrated opto-isolator. It’s a separate UART from the serial control port so you can use both at the same time. The firmware now supports proper use of MIDI Channel, including Omni mode. Even more exciting is a new file-naming convention that lets MIDI users specify the output and looping on a per MIDI note basis. Yes, you can map each key to any of 8 mono (or 4 stereo) outputs.

3.3V Only!

I know, but unfortunately the Atmel SAM S70 is a 3.3V device without 5V tolerant inputs. This means that your first choice in mating it with another microcontroller should be a 3.3V Arduino. Tsunami, like the WAV Trigger, has a pin-compatible header for the FTDI-Basic USB-to-Serial adaptor, but make sure you’re using the 3.3V version! For you modular synth folks, you have to voltage-limit the gate signals anyway, so this shouldn’t be any more of a burden than for the WAV Trigger.

Please use this post to ask questions and provide comments, feedback… whatever.



Update: First panel off the press:



  • reply Christian ,

    This is just great. For my needs, there is nothing to be added. Fantastic, I’m so excited. Can’t wait to get one, put it to work and then expand

    • reply Christian ,

      I was wondering if the SD card slot could be adapted to be enclosure friendlier (thinking of SD card slot like the one they use on “Music Thing Modular- Radio Music”, can be seen on THONK dot co dot uk).
      I want to use Tsunami as a drum/percussion sample player/trigger. Is there a way to organise WAV files in sets or pages of certain numbers like a set of 8 samples (having 8 individual mono outputs), so you could select different sets? If yes, can you select individual WAV files from different sets/pages?
      As an example: the first file in a set/page would always be a kick drum, the second file always a snare drum an so on. If I have sets of 8, 9 would be a kick drum again, 10 a snare drum and so on. That would make it very easy to organise and access samples.
      I hope you don’t mind my brainstorm, I’m just trying clarify for myself how Tsunami will work for me.
      Thanks again

      • reply Jamie ,

        How are you planning to trigger the tracks? Trigger inputs, serial control or MIDI?

      • reply Christian ,

        I intend to get the Tiptop Audio Circadian Rhythm which has 8 trigger/gate outputs

        • reply Jamie ,

          Triggers normally control corresponding tracks 1 through 16. You can assign 2 triggers to be Trigger Bank Up/Down and use them to shift the tracks by 16. Incrementing the Trigger Bank once will map the triggers to tracks 17 through 32, twice to tracks 33 to 48, and so on.

          MIDI Notes are mapped to the corresponding tracks, e.g. MIDI Note 42 to track 42. A MIDI Bank number allows you to shift all the tracks by increments of 128, similar to Trigger Banks. You can control the MIDI Bank either with a Trigger input function or with a MIDI Program Change message.

        • reply Christian ,

          Sorry for incomplete answer, midi will control everything else

          • reply Diego ,

            Hello Jamie!, in fact I was one of those people that bought several wavtriggers for multiouts! I’ve been enjoying wav trigger so much, and now really excited for tsunami, so I’m buying one, I have a couple of questions though
            1. I want to power the tsunami via the 5v power output from an arduino uno, and plug a midi signal generated from the arduino into the dedicated midi inputs, as you said, the tsunami is 5v “intolerable”, but what about the midi and power inputs? could I do what I want, or I need to use a 3.3v arduino uno power output (I’m still new in the electronics field)
            2. Any insight of the price?

            • reply Jamie ,

              Tsunami can be powered by 5 – 15V, so powering from the 5V supply output of an Arduino should be fine as long as it can handle the current. Don’t have an official number for VIN current yet, but should be similar to the WAV Trigger.

              MIDI is a current loop, so if you are driving Tsunami’s MIDI IN from a MIDI OUT, there’s no voltage issue there.

              What you can’t do is apply more than 3.3V to any of the trigger inputs or the serial RX pin.

              Price is ultimately up to SparkFun and depends on their BOM cost. Likely will be in the $79 – $99 range, but don’t want to guess. I should know within a couple of days and will report back.

            • reply Diego ,

              Thanks Jamie for your kind and quick answer, I have a question and some feedback for tsumani
              My question is regarding the MIDI, as implementing a MIDI OUT from the arduino requires 3 leads (TX, GND and 5v) and the MIDI IN in has two inputs, that means that I’ll be connectin the TX and 5v pins of the arduino in the Tsunami, will the MIDI inputs on the tsunami have labels of which lead is which?

              also my feedback is, as Christian said, a more case friendly sd port, also as the tsunami has a MIDI OUT port, it would be great to put a .mid file for MIDI playability so we could use the tsunami as a sequencer for external synths or outboard gear with MIDI out

              Happy Holidays and greetings from Colombia

              • reply Jamie ,

                I’m not sure I understand your statement: “A MIDI OUT from the Arduino requires 3 leads…”

                MIDI is a 20mA current loop and the input is optically isolated. You only need 2 wires from the transmitter to produce the current, in this case TX and GND from the Arduino. From a standard MIDI Controller MIDI OUT, it’s pins 4 and 5 on the 5-pin DIN. I routinely cut the end of a MIDI cable, connect the wires from pins 4 and 5 to a 2-pin rectangular connector and plug it into the MID IN header on Tsunami.

                SD card access noted, although at this point the board design is finalized and you’re talking about a hardware redesign. I’ll keep it in mind, though.

                Regarding your suggestion for MIDI OUT, it’s a good one. What would the requirements be for synchronization between the MIDI sequence playback and any audio the Tsunami is playing?

              • reply Nic ,

                Hey Jamie, just have to say I’m super stoked about the Tsunami! I’ve used a couple WAV Triggers for MIDI-controlled samplers on pedal boards. Love it, and I’m very glad to see audio pin outs on the Tsunami, rather than only the headphone jack.

                Curious what your thoughts might be for this – normally I just use the MIDI channel indicator on my keyboard to tell me which bank I’m in on the WAV Trigger. But it would be cool to be able to have a couple of 7-segment LED displays to show which bank I’m currently in…would that require an external controller like Arduino or Highly Liquid’s MIDI CPU to trigger the bank up/down and to control the LED displays? Thanks!

                • reply Jamie ,

                  Sure. Keep in mind that Tsunami doesn’t map channel number to bank number (nor does the latest version of the WAV Trigger firmware.) I’ve gone to a more traditional MIDI implementation where you can assign Tsunami to either respond to a specific channel number or to all channels (Omni.) In either case, only the MIDI Bank allows you to remap your keys to higher track banks. You can change the bank either with a trigger function (increment or decrement bank) or using the MIDI Program Change message, in which case the program number sent in the message becomes the new bank number.

                  In order to display the bank, you need whatever is controlling it (either via MIDI or a trigger input) to keep track of it and display it.

                  I was doing something similar recently and ordered this for an easy to use numeric display:


                  • reply Nic ,

                    Gotcha – I haven’t updated to the latest firmware, but I will when I have some time to tweak around. Thanks much for the link to the display…I like the idea of triggering the bank changes with footswitches/external controller, and setting MIDI to Omni, rather than how I’ve been doing it.

                    BTW, I’m the random person who made that sample-naming cheatsheet Sparkfun put in their hookup guide…it’s laid out like a piano with corresponding sample names depending on the bank. Not sure if you saw it, just was a handy tool for me, so I figured I’d share it with them.

                    • reply Jamie ,

                      This sample naming sheet is awesome. Would you mind if I included it here on this site?

                      • Nic ,

                        Cool, feel free to share as you will!

                • reply Diego ,

                  Hello, I’m using this schematic for arduino MIDI OUT , https://www.arduino.cc/en/uploads/Tutorial/MIDI_schem.png , where it uses 3 leads

                  About playing .mid archives I suggest sync under 20 ms so we are under the haas effect numbers, but mind, that MIDI is a somewhat unstable in jitter terms, I highly suggest this reading http://expressiveness.org/2012/12/04/midi-jitter and this one https://www.ableton.com/en/manual/midi-fact-sheet/ , but I guess that with the cortex processor, the jitter will be more stable.
                  My idea is to be able to load a song in .mid format, so the tsunami will playback this song via MIDI OUT so I could plug it into a synthesizer and the tsunamiwill play the song (for example in a show that I need my synth playing the notes and I’ll be making adjustments on the filters, envelopes, lfo, etc) a 5 minute song with stable playback, would be awesome. if the midi playback and the tsunami playback sync is under 20 ms, i guess, it will sound in sync.

                  • reply Jamie ,

                    That Arduino MIDI OUT implementation should work fine without the GND connection. +5 and TX going low provides the MIDI IN current.

                    I’ll think about the MIDI sequencer.

                  • reply Christian ,

                    I was thinking about the same thing as Nic, how can you keep track of the bank numbers, but if that display is easy to implement then no more worries

                    • reply Christian ,

                      Nice to see them coming

                      • reply Christian ,

                        Whats the next big thing? To record audio straight into Tsunami? Would be killer

                        • reply Christian ,

                          Hello Jamie, how is Tsunami going? Any release dates? Cheers

                          • reply Dave ,

                            Hello Jamie,

                            I have an application that would involve WAVs that contain heavy DC offsets, with occasional DC-only signals. ls the Tsunami capable of producing such signals? My application consists of a source that produces 5 channels of variable DC voltages – three channels of vary between zero and five volts, and the other two need to swing above and below zero by five volts. I would add external op-amp circuitry to ensure that all signals would work within the limits of the Tsunami, of course. It would be vital that the 5 channels remain in sync when played back.

                            Would the inputs be able to pass DC signals, possibly having to jumper out any input capacitors? How would you see all 5 signals be recorded as generated by the source? My guess would be two channels at a time via ‘stereo inputs’ and use three recording takes, would that work? If so, how might the recorded WAVs be manipulated to ensure they would be in sync? The gaps of silence that will inevitably occur between the starting of the source signals and triggering ‘record’ would be rather difficult to keep consistent – would there be a way to edit them out to keep all WAVs lined up and in sync?

                            Your Tsunami is a versatile and very interesting device, it would be a great addition to a product I have in mind if it can be made to work the way I hope it can. Thanks for any guidance you could offer.

                            • reply Jamie ,

                              The Tsunami is an audio player, and therefore not currently expected to be able to reproduce DC signals. It uses an audio codec, although I don’t see anything in the data sheet that prevents it from outputting a DC offset. There are DC blocking caps in each of the output channels on the board. Furthermore, the output of the DAC is line-level, meaning that you likely won’t get anything beyond 3V peak-to-peak, implying a max DC voltage of around 1.5V.

                              Also, Tsunami’s stereo input does not currently provide for recording to SD media. I don’t anticipate this, as there’s no reasonable way to handle file naming/organization without a UI. I expect that audio is recorded, edited and copied to an SD card using a computer. Given the right audio interface, most PC audio apps are capable of recording 8 channels of audio in sync and saving them as individual mono wav files. As a playback device, Tsunami will start them and keep them in sample-sync.

                              Hope this helps.

                            • reply Bill ,

                              Hi Jamie,

                              I am looking to use the new Tsunami device with a medialon showmaster as my main controller. Do you know of a way to interface this with a show controller that only has 5v serial db9 connectors…. here is the show controller I would be using – https://www.medialon.com/showcontrol/showmaster-le/

                              Thanks for any info.

                              • reply Jamie ,

                                You just need to convert the RS-232 signal levels of the Medialon to 3.3V. You’ll probably need to make your own cable, with something like this on the DB9 end: https://www.sparkfun.com/products/449

                                If you google “RS232 to 3.3V ttl”, you’ll find many similar solutions.

                              • reply Christian ,

                                No problem about recording, was just a thought. Checking daily for release date 😜

                                • reply Jamie ,

                                  It’s been available at SparkFun for over a week now. Check the “Buy” link in the Tsunami menu on the left, or just search on Sparkfun.

                                • reply Christian ,

                                  Oh, dear. I thought there will be an announcement. Thanks Jamie

                                • reply Jonas ,

                                  Very cool project, nice work!!!
                                  I could use this for a commercial project. What are our license options for firmware if I implement this in my audio platform?

                                  • reply Jamie ,

                                    Please contact me directly at info (at) this domain.

                                  • reply Lars ,

                                    Hi Jamie, I’m looking for a way to use Tsunami as a polyphonic, velocity-based sample player. For example, I would like to play a piano sampled in 16 velocity layers (e.g. 128 * 16 samples) via MIDI. What I’d need is a built-in way to map a velocity range to a bank number in order to play the right sample/track. Could you please add such Midi config option? It could simply be a drop-down to select the amount of layers (i.e. velocity ranges) to be used, and then for each note triggered via MIDI, Tsunami could identify the correct track number to be played. Example: With a 4-layer sampled instrument, bank 1 would be mapped to velocity range 0-31, bank 2 = 32-63, bank 3 = 64-95, and bank 4 = 96-127. Therefore, a C-3 played with a velocity of 83 would play track number 316 (C3 of bank 3).

                                    • reply Jamie ,

                                      I’ve had a number of requests for this function, but this is the first one with an explanation of how to make it generic and easy to implement. Great idea.

                                      I assume that velocity should still scale the volume in a linear fashion? If so, then the lower number banks will always be played at a lower volume than the higher number banks. Is this the way it’s typically done?

                                    • reply Lars ,

                                      Yes, exactly. A linear scale would be sufficient. Musicians may prefer a slightly non-linear velocity curve, though, depending on the kind of instrument they are playing. Even though many Midi controllers already offer a way to adjust the velocity curve (either using presets or by adjusting a bezier curve), it would be great if you could provide a config option. Perhaps this page would be of use to you to see how it could be handled: http://stackoverflow.com/questions/41134365/formula-to-create-simple-midi-velocity-curves

                                      • reply Jamie ,

                                        Both the WAV Trigger and Tsunami are already responding to velocity by linearly scaling the target gain. I would, initially at least, leave this as is, and just divide the velocity into zones and map banks accordingly.

                                      • reply Gerhard ,

                                        Hi Jamie,
                                        Recently bought a Tsunami to replace other samplers I’ve found to limiting because of low number of physical outputs and low number of samples supported. It’s pretty rare to find a sampler with 8 outputs these days and Tsunami might fit the bill. I would like to see however support for multiple midi channels. Ideally, a map for a MIDI bank for each channel. this would make the Tsunami massively more versatile. One could for example implement 16 banks of 128 samples. Or a multitimbral orchestral instrument. I think you note above it was a conscious decision not to go this route but since it’s just a generalisation of the present implementation people would still be free to use a single channel only.

                                        • reply Jamie ,

                                          This is a great example of how hard it is to meet everyone’s needs. The WAV Trigger behaves as you describe, with the MIDI Channel acting as a bank number. I had a number of requests to change this for Tsunami so that it behaves more like a standard MIDI module, responding either to one MIDI channel (with Program Change to change banks) or to all (Omni).

                                          • reply Gerhard ,

                                            right … didn’t look too much into the wav trigger i have to admit. well perhaps it could be a third configuration parameter for the global MIDI Channel option? single channel, OMNI, or bank mapped?

                                        • reply Roman ,

                                          Hello, Jamie.
                                          I’m building the sound system for escape room (some kind of maze with the riddles, if you never heard about it).
                                          This system will provide the musical background for the game process, and in the same time it will be the communication system for the game operator to talk to the players inside of the room, so I have some microphone connected to the same output with the music output. For escape room with one theme we have for example 3 rooms, and for each room I need to play different music. Sometimes we have 9 different tracks in one building, and I need them playing simultaneously from the one sound system. Thats why the Tsunami is perfect for me!
                                          But when I make some test projects I got some static noises from my speaker with amplifier and the sound wasn’t clear…
                                          I talked to SparkFun support, but we couldn’t find some solution…
                                          So hope you can help me with it.
                                          Here is some scheme of how is my project looks like
                                          If you need some more information to understand situation, I’ll send you everything you need.
                                          Thanks for you attention.

                                          • reply Jamie ,

                                            Please try to isolate the problem. Does Tsunami work and sound properly by itself if you use a single amplifier or headphones? Go through the hook-up guide to make sure there’s nothing wrong with your unit, then determine at what point things stop working properly. Simply telling me that there’s static and that the sound isn’t clear after you run through all those audio stages doesn’t give me enough to go on.

                                            • reply Roman ,

                                              It works properly only if I connect it directly to the speaker with builtin amplifier or headphones. But if I put any amplifier in the same power circuit with Tsunami and start track playing, in this moment it starts to make noises. When the track is not started there is no noise.
                                              If I connect them to the different power modules but with the same Ground it reduce the noise, and now I found one solution how to reduce noise almost to zero, I did the video for the SparkFun tech. support, if you could look through it, maybe it will make something clear.
                                              Please don’t pay attention on the name in the start of the video, it was addressed to Chris from tech. support… :-)))

                                              • reply Jamie ,

                                                I think you may need to rethink your analog connection strategy. Someone with better knowledge of the external components writes:

                                                “Those little mono amp breakouts can be tricky. They’re a differential input, 250 kHz class-D power stage, and a bridged output, intended to be tied to both ends of a loudspeaker. From an SE input, the “-” input needs to be tied to ground. The “-” output mustn’t be grounded. From the video, it looks like you’re trying to use them for general-purpose voltage gain? Then following them with an amplified speaker? I’m not sure that’s going to work very well.

                                                It looks like you’re trying to combine signals from the mic and Tsunami at the output jack? Effectively the class-D output is driving the Tsunami output, and vice versa. The series RC’s on the Tsunami output are the only thing between them. I’d recommend using a couple 10K resistors as a passive summing network, at the least.”

                                          Leave a comment