How to Play Random Tracks on MP3 Trigger Board

Greetings,

I’m using the MP3 trigger board ( MP3 Trigger Hookup Guide V24 - SparkFun Learn ). I haven’t found any documentation on using the Random trigger function (02), as referenced in the Hookup Guide.

I want the board to play a random track when trigger 01 is activated. All files are named with the convention specified in the documentation (001.*mp3, etc.). Currently, when trigger 01 is activated the board will play 001*.mp3, but triggering again will play the same song, not a random song.

I have trigger 18 jumped to ground and set as a STOP trigger in the INI file.

My INI file:

#TRIG 01,2,0

#TRIG 18,5,0

Any useful advice is appreciated.

There’s been a similar case a few years back

Try this:

  1. Back up everything from the microSD card if needed

  2. Format the card as FAT32

  3. Copy the MP3 files back individually, in numerical order:

    001 something.mp3
    002 something.mp3
    003 something.mp3
    004 something.mp3
    
  4. Copy MP3TRIGR.INI onto the card afterward

  5. Eject the card, put back into MP3 Trigger

  6. Test Trigger 01 several times. I would also temporarily remove Trigger 18 from the equation and test with just:

#TRIG 01,2,0

Once random selection works, add

#TRIG 18,5,0

back in :slight_smile:

Side note: #RAND isn’t required. #TRIG 01,2,0 already makes Trigger 01 the random trigger. #RAND N is an additional option that excludes the first N tracks in the directory from the random selection.

So, for example:

#RAND 1
#TRIG 01,2,0

would exclude the first file in the directory from the random pool. You don’t want that if 001 should be eligible :wink:

There’s also more info in the guide

I really appreciate your thorough reply. I certainly took the time to read the entire guide, everything on the Robertsonics site and all the forum posts I could find. I didn’t find the information I needed anywhere.

I solved this problem yesterday. I got an email from Robertsonics that reiterated the newer firmware version available. I made the bad assumption that because I bought a board recently I would get the latest firmware. That apparently wasn’t the case. I have included my log below, but basically I was able to accomplish Trigger 1 plays a random track every time it is triggered and stops at the end of the track. The track can be interrupted by triggering again. The track does not loop if Trigger 1 remains HIGH/active.

INI file:

#TRIG 01, 2, 0

All files are named according to the protocol, 001.mp3, 002.mp3, etc.

As you said, the #RAND wasn’t necessary. The STOP command on pin 18 also wasn’t necessary. I just have a switch wired to pin 1 and ground.

The latest firmware can be found at the bottom of the Robertsonics website:

https://www.robertsonics.com/downloads/

Log:

***First attempt:

#RAND
#TRIG 01, 2, 0
#TRIG 18, 5, 0

Tracks named with 001, 002, etc.
Formatted card, added songs one at a time, in order, ini first
–Some files were WAVs; trigger not activating (no LED indicator when activated); no sound output

***Second attempt:

#RAND

Tracks named with 001, 002, etc.
Formatted card, added songs one at a time, in order, ini first
–Trigger 01 works; plays track named 001 every time; no random; audio stops after 001 is played

***Third attempt:

#TRIG 01, 2, 0

Tracks named with 001, 002, etc.
Modified ini while on the card; left files on card (no format)
–Trigger 01 works; playes track 001 every time; no random; audio stops after 001 is played; no loop, even if trigger is constant on

***Fourth attempt:

Downloaded and updated firmware on board.
Repeated first attempt exactly with new firmware
–Trigger 01 works; plays track 001 every time; no random; no restart lockout - track restarts every time trigger is activated; audio stops after 001 is played

***Fifth attempt:
Repeated second attempt with new firmware
–Exact same as fourth attempt

***Sixth attempt:
Repeated third attempt exactly with new firmware

#TRIG 01, 2, 0
All tracks named with 001*.mp3, etc.

--Works! Trigger 01 plays a random track every time it is activated; audio stops when track is complete, even if trigger is active; no restart lockout; interruption of track plays next random track (sometimes repeats same “random” track order if trigger is activated too soon - less than 1 second)

The next item I have to solve is this:

I have a touchtone phone. I pick up the handset and a track starts playing. While the track is still playing, I want the buttons to play touchtones without the track stopping.

I’m thinking I’ll need a different solution for this. I didn’t read anything in the documentation about simultaneous triggering like this.

Do you think it’s possible with the MP3 trigger? If not, do you think I should go with a dedicated touchtone generator chip or is there something like the WAV trigger that would work?

Robertsonics knows all the tricks! Glad to hear that part is working

To play two or more sounds simultaneously you’re after a polyphonic device (3 are in stock), 14 for the WAV Trigger, 24 for the WAV Trigger Pro, 31 for the instrument shield