I have a Tsunami Super Wav Trigger and I want to control it via serial or I2C (Qwiic?). I looked through the serial commands and did not find what I was looking for, so before I look at the firmware and see if I can find a way to do it from scratch, I thought I would ask about it.
Is there a way to get reporting via serial on where playback is for a wav file? Like a progress response, returning where the position is at during the wave playback. This matters if I plan to trigger some layer wav playback at a specific position of another wav.
If it does not exist, I can work around it by trying to sync the timing between the MCU controller and the Tsunami. Maybe this is something I can do with MIDI.
Anyway, I thought I would ask. It’s an amazing device!! And I am having a lot of fun playing with it!
Thanks for your valuable time!
Sorry to dig up an old post, but I just wanted to put in a feature request for Jamie Robertson @robertsonics : It would be so powerful if the Tsunami (and/or the normal WAV Trigger) could be queried for elapsed time in each file currently playing, and to seek to arbitrary positions in those files. It opens the door to 2-way feedback with the real world. I’m particularly interested in using the varispeed playback to keep synchronicity between physical objects and sound (like syncing WAV playback to a film projector or other “imperfect” motion system). Any chance this could be on the horizon? Many thanks for the MP3/WAV triggers! (I use them often in a college context, where they have enabled non-expert art students to do amazing things with limited resources.)
A key thing to remember about Robertsonics WAV players is that they stream directly from FAT formatted microSD cards, using only the RAM available internal to the MCU, which isn’t very much. Achieving low latency (time from trigger or command to the onset of sound), assumes starting at the beginning of the file. Starting from, or seeking to, an arbitrary sample can’t be calculated - I’d have to “fast-forward” through the FAT table to find the correct sector, which takes time. That adds an unknown amount of latency, as well as consuming bandwidth necessary for managing other voices. It might be possible to pre-load a sound to a specific starting point, and then start it with a separate command, but probably only on the new WAV Trigger Pro due to some architecture improvements in that code. I’m not sure how one would handle the variable delay between loading/seeking and starting. Seeking while a file is playing is likely not ever going to happen.
Getting the play position is more do-able, with some caveats: The sample pointer would only be accurate to within the size of the audio buffer, which is 128 samples for the WAV Trigger and Tsunami, and 64 samples for the WAV Trigger Pro. It might be possible to be more accurate by polling the DMA controller for current position. But I’m always leery of providing these sorts of things because it invites constant polling on the serial port, which will consume bandwidth and ultimately lead to disruption of audio, i.e. clicks and pops.
Totally understandable. I appreciate the explanation. Track progress reporting is really my #1 request, since it would enable sync with external devices (by altering the WAV trigger sample rate).
I wonder if progress could be rolled into the existing reporting? Example: SET_REPORTING is currently boolean. Maybe it could be extended to accept “2” to enable elapsed time reporting at regular intervals? Then every n milliseconds (whenever is efficient based on the internal timers, or just 1000) a TRACK_REPORT_PROGRESS message is sent, much like how the TRACK_REPORT is sent during play/stop events.
It seems like that sort of predictable behavior would avoid the performance penalty of open-ended serial queries from the user, while still providing some useful feedback. It would open the door to lots of user interface options (along with my admittedly niche case of sync)!