The MP3 Module Random Play

I’ve been pondering a project that would involve the yet to be released MP3 player.

My question: is there a way to have the player play a random track?

Or is there a way for the player, in conjunction with some other bits, to play a random track?

Hi Joey,

Great question! The mp3 module doesn’t have a random setting, but this is a great suggestion! I’ll let the team know this is something you’d like to see.

If you created the circuit power, button, pulse, mp3, speaker and set the pulse to trigger quickly with the mp3 player in ‘next’ mode, it would play a seemingly random track, but then after the track played you would have to hit the button again to play the next track.

Hi Allison,

Are you saying that with the pulse set to trigger quickly, it would rapidly choose a "next track’ while the button was pushed but not play it until I released the button thus appearing to be random?

Is that the theory?

That could possibly work.

Two questions.

Do you suppose there would be a way to use the arduino bit to solve this?

Can you give me a hint as to when you think the Mp3 bit might be released? :smile:

Thanks,
-joey

Hi Joey,

Thats the theory! Then, once the track is finished, you would push the button again to choose another track. As for programming the Arduino, this is possible, but would likely have the same results as the button solution. The only way to genuinely get a random track would be to reprogramming the microcontroller on the mp3 player module.

As for the release date - be on the lookout for it in 2014! :smile:

Hi Allison,

A couple more questions for you. I received the mp3 bit as part of the Smart House Kit today and have been experimenting. I tried the pulse bit idea and while this works (sort of) it actually plays the first moment of the each track as it cycles thru them which is a little disorienting at best. I also noticed that when the pulse bit is connected in series as you described, you can hear the “pulsing” even when a track is not being played. It’s like there is a little electrical noise getting thru somehow. Is that normal?

Anyway, I was thinking that I might be able to tweak my project by adding a second or so of silence at the beginning of each track. Maybe that will help. I’ll try it and see.

My second question is that you mentioned that reprogramming the microcontroller would be required to add a genuine random function. My question for you is, hypothetically, is the mp3 module upgradeable in any way? Meaning is a firmware update a technical possibility as it is in the cloud bit?

Just curious…

Thanks for your help…

-joey

Hello @joey

I was wondering if when using the pulse and mp3 which setting you have the MP3 player set to (once, loop, next or all)?

As far as your question about firmware I will bring it to the powers that be and see if I can’t get an answer for you.

Hi, @joey . I wanted to follow up on our discussion about this random feature you have in mind for your mp3 project.

  • You had talked about adding time to the beginning of each track.
  • You also thought about using the Arduino module to pulse through your numerous tracks a random number of times, and I suggested you look at @RichB’s project, “Dice”.
  • Also, here is the random function on the Arduino references page.
  • Finally, you mentioned that it would not feel random for the user, since they might hear pulses and will experience longer delays when the random number of pulses is long. I have an idea for this issue. If we think about your 50 tracks as an array, then we can pulse through it with the number 7 and still hit every track; the 7th play would be at track 49, the 14th at 48, 21st at 47, and so on. If your first track number was random, then only the first track could take over 7 pulses, but every other play would take only 7 pulses every time. That would give you a predictable amount of time to run your “entertainment” sequence to distract the user from the pulses.

I hope this helps, and I’ll talk to you soon!

-Jude

I’m wondering if you could use the sound trigger as an input for the arduino. When the sound drops then generate a random number and send that many pulses to the mp3Bit. Then once each song finishes it would trigger and cause a new song to be played.

Not sure how fast you could send those pulses and how the mp3Bit would react, maybe you can send them fast enough it doesn’t actually start playing each track…

This is pretty clever Jude and eloquent given the constrains of the mp3 bit. I wonder if I could get the pulse bit to consistently give me 7 pulses then I could apply your idea without using the arduino which I would prefer, because as you said, using the arduino feels a little like cheating…or over engineering anyway…

Thinking about this further however, it still presents the following problem. The first time I turn on the device, each time I press the button I would indeed hear a unique track from the list (every 7th track in your example) but once I turn off the device and turn it back on, I’m right back where I started from because the mp3 player won’t save the state once the power is recycled. So each time I turned the thing on, I would have the same sequence. Does that make sense?

If that is what you find in use with the mp3, then I understand what you mean. You could use the usb power and keep it on for a long time. If you have a double or, you could manually pulse a starting point.

hi @joey,

Check out my post on a serious issue with the mp3 player: This may affect what you are trying to accomplish in your project.

Thanks Rich. I’ll play with this and see if I can replicate it.

Hiya, @joey! Can you post your project to the project page? I know you’ve moved on to a different project that is now a work in progress, but the world needs to see and hear this one! :eyes: :ear:

Hey Jude ( that never gets old does it?),

I’m thinking I’ll post it on Monday the 6th as that is the anniversary of my Dad’s passing. Stay tuned…

<3 @joey My mom died 2/25/14. I did something special that day last month. :calendar: