I have been using the MP3 Trigger as standalone-music player for some years now. With werry good results. For my next project I’ll like to use the #RAND function. But I can not making it work properly.
The setup I need is the following:
Task 1) (using TRIG1): One sound (track1) that play each time on trigger is activated. This work just fine.
Task 2)(Using TRIG10): A stack of sounds, excluding Track1, that will play randomly when another tigger is activated. This task is causing me trouble.
When activated it play one sound, then the next song when activated again. It will play through the stack of sounds on the SD-card, no randomization, and include track1 when it loops around. Even though I excluded sound 1 in the INIT-file.
Can someone help me figuring out what I’m doing wrong. Any help will be appreciated.
The sounds at named 001Name ; 012Name - 014Name.
And the INIT file is as follow:
#RAND 009
#TRIG 01, 0, 0
#TRIG 02, 0, 0
#TRIG 03, 0, 0
#TRIG 04, 0, 0
#TRIG 05, 0, 0
#TRIG 06, 0, 0
#TRIG 07, 0, 0
#TRIG 08, 0, 0
#TRIG 09, 0, 0
#TRIG 10, 2, 1
#TRIG 11, 0, 0
#TRIG 12, 0, 0
#TRIG 13, 0, 0
#TRIG 14, 0, 0
#TRIG 15, 0, 0
#TRIG 16, 0, 0
#TRIG 17, 6, 0
#TRIG 18, 7, 0
Thanks for posting TekNisbeth.
I’m not sure what causes this, but I was able to duplicate your results.
Give this a try:
- Backup all the MP3 files and your INI file on your SD card.
- Format the card
- Copy the files **[u]one by one[/u]**, by file name, back to the card. *(001track.mp3 first, 002 track.mp3 second and so on.)*
- Copy your INI file back to the card.
- Eject the card in your operating system, remove the card from your computer and put it back in the MP3 Trigger.
That seemed to get things working the way you'd expect for me. I'm not sure if the firmware is randomizing based on the filename of the tracks on the card or if it's possibly going by the order they appear in the filesystem on the SD card.
One thing to note, at least in Windows anyway: If you do a group copy of files, they won’t necessarily be copied in order by filename. That got me on another product where the order files appear in the file allocation table is what determines file order rather than filename. Robertsonics might have more info if he sees this post.
Also, if you ever need to upgrade or replace the MP3 Trigger, the WAV Trigger has a fantastic utility for doing this sort of thing and it’s super flexible on how each trigger works. I recommend having a look at that if you ever need a additional board.
The documentation for the MP3 Trigger states for the #RAND function:
The default behavior of the random trigger function is to play a random
track from all the MP3 files on the flash card. The #RAND function will
exclude the first N tracks (in the directory) from the random trigger
function. So if there are 18 MP3 files on the card and N=4, then the
first 4 MP3 files will be excluded from the random trigger function.
Therefore, if you want to exclude the first track, the init command should be:
#RAND 1
Now, as TS-Chris mentions, the MP3 Trigger unfortunately uses the order of the directory entry rather than the track name numbers to index tracks for the Random, Next, Previous functions. So to make sure that things are in the correct order, you should copy the tracks incrementally to a newly formatted microSD card. The WAV Trigger and Tsunami use the actual track numbers for everything and are much easier to work with in this regard.
Thanks for the quick replays.
I have been trying the solution you described, but with no luck.
I also tested out the other function, and there doesn’t seem to be much different between the Random and the Next function. The only different is that the Random-function will start from the file number defined by the #RAND command. But when the stack loop around, all track will be included.
I have tested with Firmware v2.54 and v2.53 with the same result.
And thanks for reminding me of the Wav Trigger. I wasn’t aware that it had a random-function. I actually have one card lying around, so I think I will test it out for this specific project.