Arduino Forum

Forum 2005-2010 (read only) => General => News => Topic started by: bhagman on Nov 30, 2009, 07:05 am

Title: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Nov 30, 2009, 07:05 am
We're proud to announce our rMP3 Playback Module - An MP3 Shield.

(http://www.roguerobotics.com/wikidocs/_media/rmp3/rmp3_arduino-01-500px.jpg)

Rogue Robotics rMP3 Playback Module

Here are some specs:



MSRP: CAD$59.99 (~USD$60 - 11/01/25)
(headers are additional CAD$5.00, unsoldered)

Info available here:
http://www.roguerobotics.com/

Check our distributors (http://www.roguerobotics.com/distributors) for availability.

Libraries/Projects/Examples available at:
http://www.roguerobotics.com/wikidocs/code/

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Nov 30, 2009, 07:18 am
Here's an example.  Playing a song and reading lyrics from another file at the same time.

[media]http://www.youtube.com/watch?v=NY__jMV5GRE[/media]

Code and more here:

http://www.roguerobotics.com/wikidocs/code/rmp3lyrics

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Nov 30, 2009, 10:26 am
Apart from the most annoying song example (showed the lyrics example well though), that example is good. I like the quaility of this, that is why I am drawn to it.
Yes, I can have someone's vioce on a project with the wave shield but with this I can have their voice in 320kbs!

Are the lyrics done with reading a time on the song? That is rather cool!

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Nov 30, 2009, 06:58 pm
Heh... Daft Punk can have that sort of affect on some people.

The lyrics are read off of the SD card from a standard LRC file (which has times for each lyric).

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Nov 30, 2009, 06:59 pm
Oh yes, I obviously didn't read that bit very well

:D

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Nov 30, 2009, 07:03 pm
Oh, btw. Your link is broken on the rMP3 page:

Quote
Arduino? is a trademark of Arduino Team

should link to arduino.cc presumably rather than:
http://www.roguerobotics.com/store/arduino.cc

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Nov 30, 2009, 07:44 pm
ooops... thanks mowcius.  Fixed.  (I was wondering why there was a http:// lying on the floor next to my desk).

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Dec 18, 2009, 07:27 am
XMAS time...

This sketch randomly plays all the songs in a folder.  You can control the volume, play/pause/stop/next, and ff/rew using serial input (from the IDE).

Throw a bunch of your favorite holiday songs in a folder named "XMAS" on your SD card, stick it in the rMP3, and run the sketch.

I haven't got around to building a tree light sequencer to run at the same time as the songs are playing.  Maybe Grumpy_Mike will lend me his Tree-Sink (http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1260958809).  ;D

Happy Holidays everyone!

b


Code: [Select]
#include <RogueSD.h>
#include <RogueMP3.h>
#include <NewSoftSerial.h>

NewSoftSerial rmp3_serial(6, 7);

RogueMP3 rmp3(rmp3_serial);
RogueSD filecommands(rmp3_serial);

int numberOfSongs;
int lastSong;
char path[96];

const char *directory = "/XMAS";


void setup()
{
 Serial.begin(9600);

 Serial.println("Merry Xmas!");

 rmp3_serial.begin(9600);

 rmp3.sync();
 rmp3.stop();

 filecommands.sync();

 // mix up our random number generator
 randomSeed(analogRead(0));

 // get the number of songs available
 strcpy(path, directory);
 strcat(path, "/");
 strcat(path, "*.mp3");  // we have to do this because the IDE thinks that "/*" needs to be terminated everywhere

 numberOfSongs = filecommands.filecount(path);

 lastSong = -1;
}



void playNextSong()
{
 uint8_t i;
 char filename[80];
 char path[96];
 int nextSong = 0;

 if (numberOfSongs > 0)
 {
   // Select our next song randomly
   if (numberOfSongs > 2)
   {
     do
       nextSong = random(numberOfSongs);
     while (nextSong == lastSong);
   }
   else if (numberOfSongs == 2)
   {
     // we only have two songs
     if (lastSong == 0)
       nextSong = 1;
     else
       nextSong = 0;
   }

   // now, get our file name from file list

   filecommands.opendir(directory);

   for (i = 0; i <= nextSong; i++)
   {
     filecommands.readdir(filename, "*.mp3");
   }

   strcpy(path, directory);
   strcat(path, "/");
   strcat(path, filename);

   rmp3.playfile(path);

   Serial.print("Playing: ");
   Serial.println(path);

   lastSong = nextSong;
 }
 else
 {
   Serial.println("No files to play.");
 }
}


void loop()
{
 char c;
 uint8_t i;
 int16_t newtime;

 playbackinfo playinfo;

 char status = 'S';
 uint8_t playing = 1;
 uint8_t volume = 20;
 uint8_t boostOn = false;

 volume = rmp3.getvolume();  // this only gets the left volume
 
 playNextSong();

 while(1)
 {
   while(!Serial.available())
   {
     // we should do fancy stuff like flash lights on our Xmas tree here!
     // got lots of time!
     delay(200);

     status = rmp3.getplaybackstatus();
     playinfo = rmp3.getplaybackinfo();

     if (status == 'S' && playing)
       playNextSong();
   }
   
   // OOH!! got a character!
   c = Serial.read();

   switch(c)
   {
     case 'p':
       // pause
       if(status == 'D')
       {
         // fade in
         rmp3.playpause();
         rmp3.fade(volume, 400);
       }
       else if(status == 'P')
       {
         // fade out
         rmp3.fade(100, 400);
         rmp3.playpause();
       }
       else
       {
         // start playing
         playNextSong();
         playing = 1;
       }
       break;
     case 's':
       rmp3.stop();
       playing = 0;
       break;
     case 'n':
       playNextSong();
       playing = 1;
       break;

     case 'e':
       if(boostOn)
       {
         rmp3.setboost(0);
         boostOn = false;
       }
       else
       {
         rmp3.setboost(8, 6, 7, 3);
         boostOn = true;
       }
       break;
     
     case 'a':
       // jump back 5 seconds
       newtime = playinfo.position - 5;
       if (newtime < 0) newtime = 0;
       rmp3.jump(newtime);
       break;

     case 'd':
       // jump forward 5 seconds
       rmp3.jump(playinfo.position + 5);
       break;
       
     case 'k':
       if(volume < 254) volume++;
       if(status != 'D') rmp3.setvolume(volume);
       break;

     case 'i':
       if(volume > 0) volume--;
       if(status != 'D') rmp3.setvolume(volume);
       break;

   }
 }
}
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Dec 18, 2009, 08:06 pm
Quote
volume, play/pause/stop/next, and ff/rew using serial input (from the IDE)

Now it's getting interesting. (to be honest I probably should have read through the page in more detail)

This is definitely on my list and I may be able to get one soon if I get my other stuff free for sparkfun free day or I have to buy it...

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Lazarus404 on Apr 07, 2010, 10:01 pm
Hey Brett,

I'm currently trying to use the rMP3 shield with the DFRduino LCD Keypad shield (http://www.robotshop.com/dfrobot-lcd-keypad-shield-arduino.html). The problem is, while rMP3 uses digital pins 6, 7, 8, 11, 12 & 13, the LCD shield uses 5, 6, 7, 8 & 9. Therefore, I'd like to reroute pins 6, 7 & 8 to use pins 3, 4 & 10 by cutting the jumpers and wiring them up. So far, so good. The problem I have, though, is that I can't seem to work out how I'd let the C compiler know of the change. There aren't any obvious locations in the C file or associated header and I can't see any mention of this in the documentation. Could you please give me a clue as to how I would do this?

Thanks,
Lee
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Apr 07, 2010, 10:54 pm
Does it really use all those pins?

I have not really delved into how it does what it does but I presumed that it just could use those other pins.

Isn't the communication via serial? In which case it would require 2 pins?

Also another question, I know that the LED on board (activity LED) flashes when music is playing and seems to brighten at corresponding points in the music. Is there any easy way to get audio values sent to the arduino so a visualiser could be done from it?

A bit more documentation would also be very nice :p

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Lazarus404 on Apr 08, 2010, 03:14 pm
I think the documentation is actually pretty good. I wish there was a support forum, tho ;-)
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Apr 08, 2010, 07:42 pm
Lee - The rMP3 only uses 2 serial pins to communicate.  The SPI port is there as an optional way to control the rMP3, but the current version of firmware (100.01) hasn't got that implemented (expect it in the next version).

You figured out how to do the serial change though.  Just cut the jumper at pins 6 (rMP3 TX) and 7 (rMP3 RX), and reroute the pads to the new pins you want to use.  (make sure you connect wires to the pads FURTHEST of the two from the Arduino header).

The change in the code should be really simple.  Wherever you see:

Code: [Select]
NewSoftSerial rmp3_serial(6, 7);

change it to (in your case):

Code: [Select]
NewSoftSerial rmp3_serial(3, 4);

(I'm assuming that you changed pin 6 on the rMP3 to pin 3, and pin 7 to pin 4).

If that doesn't work, post your code and we can see what's going on.


mowcius - sounds like either you're listening to a VBR mp3 file (wide range one too!  32 kbps -> 320 kbps) and the music has really quiet and really loud spots, or your eyes are fooling you!  The data goes directly from the card to the decoder.   So, the only effect you'd see is if the MP3 frames had different bitrates.

RE: documentation, our wikidocs have always been public, unfortunately you had to register.  I've changed it now so that you don't have to register.  Just add any comments/questions you have on any page that has a discussion.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Lazarus404 on Apr 08, 2010, 07:47 pm
Thank you, Brett, that's awesome news. Having only two pins to worry about makes my life easier ;-)

Best,
Lee
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Apr 08, 2010, 08:45 pm
Quote
mowcius - sounds like either you're listening to a VBR mp3 file (wide range one too!  32 kbps -> 320 kbps) and the music has really quiet and really loud spots, or your eyes are fooling you!  The data goes directly from the card to the decoder.   So, the only effect you'd see is if the MP3 frames had different bitrates.

I was indeed! I hadn't noticed that it didn't change with non VBR files. It was only on the loud bits that I got brighter flashes...

Any chance you could do the Input/Output Interface page on the wiki? :)
The rest of the documentation does indeed look good, it has been a while since I have looked and I suppose I did not have a great look through.
I have just gone through and had a thorough read! Interesting stuff!

Now back to my previous question :)
Quote
Is there any easy way to get audio values sent to the arduino so a visualiser could be done from it?

It is not a problem if not, it would just be interesting to do it without all the extra circuitry it usually requires.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Lazarus404 on Apr 08, 2010, 08:53 pm
L and R provide accurate activity for that sort of thing ;-) Why not branch from there for both output and route to analog input in the Arduino? I don't know what the upper or lower values for those pads are (maybe in the docs?), but it's surely a valid option. Just make sure it doesn't exceed the pins impedance.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Apr 08, 2010, 09:03 pm
You mean speaker L & R?
That requires all the annoying circuitry in between to get that to work...
I suppose i am more asking about a frequency visualiser which is more complicated...

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Lazarus404 on Apr 08, 2010, 09:18 pm
Not necessarily. The analog input in the Arduino can take any value between 0v - 1v (I believe), so, as long as you limit the voltage (using the correct resistance), then you have a simple variable source right there. The biggest issue is making sure your querying of that source doesn't use the potential that would otherwise drive your speaker output (though you could increase that with an amp).
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Apr 08, 2010, 09:21 pm
Quote
0v - 1v (I believe)

You mean 0 - 5v (well it's more like 0 - 5.5 but that's pushing it a bit.)
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Lazarus404 on Apr 08, 2010, 10:17 pm
Yeah, 5v... That's what I meant ;-)  Well, you're okay, then, seeing as 5v is the maximum voltage anywhere past the regulator! Hook even one of those pads into the Arduino and use it as an input. Actually, you could also average the highs and lows so as to get better results, as those highs and lows will be quite similar in value.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Apr 09, 2010, 12:45 am
You have to be careful when using audio signals.  The output from the rMP3 on the L and R pins are actually AC signals (because of the filter capacitors on the outputs).  This means that the voltage with respect to ground on those pins can be negative, if you connect them to the analog inputs on the Arduino.  This can damage the ADC on the Atmel chip.

You could introduce a DC offset, but that will require extra components which I think mowcius is trying to avoid.  :)

I'd stay away from connecting the audio output to one of the analog inputs, unless you know what you're doing.

mowcius - your wish is my command.  Here is the updated documentation on the input interface:

http://www.roguerobotics.com/wikidocs/rmp3/documentation/input_interface

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Lazarus404 on Apr 09, 2010, 01:09 am
Hadn't thought about it being AC (which should be as obvious as the nose on my face), but it's nothing that a handful of diodes couldn't fix. In fact, one could always route the negative edge to a separate pin as a positive feed. :P
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Apr 09, 2010, 10:58 am
Quote
mowcius - your wish is my command.  Here is the updated documentation on the input interface:

http://www.roguerobotics.com/wikidocs/rmp3/documentation/input_interface

Oooh, I do feel powerful :p

I presume it is still on the list but what do all the other pads do? From the looks of it, some could be for an FTDI header?

Quote
You could introduce a DC offset, but that will require extra components which I think mowcius is trying to avoid.

Aye, I will look into it with as few components as I can get away with though :p

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Apr 09, 2010, 10:03 pm
All the connections are described in detail here:

http://www.roguerobotics.com/wikidocs/rmp3/documentation/connectors

It's got:

Arduino compatible shield connectors
FTDI/SFE-DEV-09115 cable connector
Digital trigger connector (trigger with digital inputs)
... among others

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Sannin on Apr 18, 2010, 11:09 pm
I was wondering if you guys plan on coming up with a cheaper version of your MP3 shield. Like Sparkfuns?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Lazarus404 on Apr 18, 2010, 11:29 pm
Sparkfun's MP3 breakout is far less functional. I really had to search high and low for a "high quality" and flexible MP3 board for my JukeBox project I'm building. There just aren't that many out there. It was pure luck that this one was already arduino compatible, because I was quite prepared to fashion one into an arduino ready product.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Sannin on Apr 18, 2010, 11:36 pm
Sometimes less is more. ;)

for example
http://www.micro4you.com/store/Arduino-MP3-Shield/prod_122.html

Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Apr 19, 2010, 08:46 pm
I never had a problem with that shield - until I tried to use it.  You pay less for more work (and more headaches, and more technical jargon, and so on).  If that turns your crank, go for it.  The adage always holds true: "You get what you pay for".

I'll put forward a challenge to you though.  If you can explain the differences between that board and the Rogue Robotics rMP3 shield, I'll send you a free rMP3 shield.  [Offer only valid for Sannin ;) ]

b

P.S. I'll steer clear of the fact that they also use Arduino in their product name when it clearly isn't endorsed by the Arduino Team.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: rockylou84 on Apr 30, 2010, 06:09 pm
It's awesome!!
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: miliatov on Apr 30, 2010, 09:06 pm
sorry if the question is silly...

I am building a small installation where PIR sensor will detect presence and start playback of two audio files simultaneously at two different locations.

If I stack two rMP3 players on top of one arduino board, will both of the players start playback simultaneously when 'play' command is sent through pin 6, or do I need to rewire pins on the second shields and have a second 'play' command sent through the rewired pin.

thanks,
M.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on May 01, 2010, 08:13 am
There's never a silly question.

Actually, that's a clever question.  If you have two rMP3's stacked, using the same serial pins, you could send commands to both of them simultaneously.  Works great (I even tested it out here).  Just don't expect to get any meaningful data back from the rMP3s - they will both be vying for control of the Arduino receive pin.


Here's the code I used:

Code: [Select]
#include <RogueMP3.h>
#include <NewSoftSerial.h>

NewSoftSerial rmp3_s(6, 7);

RogueMP3 rmp3(rmp3_s);

void setup()
{
 rmp3_s.begin(9600);
 
 rmp3.sync();
 rmp3.playfile("/ump3test.mp3");
}

void loop()
{
}



In theory, you could stack 10 rMP3's up on the Arduino, and send a single command to start them all at the same time.  Have the same named file on each card play a separate instrument track from a symphony, and they would all play together.  Of course, you'd need a 10 channel stereo mixer to mix all the outputs, but that's another story.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: DeadEye on May 03, 2010, 10:19 pm
Very nice. I like the ease of programming. But don't you think it's too pricy? I mean there's the Arduino MP3 Shield (http://www.micro4you.com/store/Arduino-MP3-Shield/prod_122.html).

This costs only 30 dollars, almost 50 dollars less than the rMP3....
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on May 04, 2010, 05:07 am
DeadEye - Same issue as Sannin (I guess he/she didn't want a free rMP3).

That board is just an MP3 decoder + SD card socket.  It doesn't do anything.  You still need a controller.

So, $30 for that board, plus $30 for an official Arduino, and you're at $60.  Then you will have to do the interface between the SD card and the MP3 decoder - tying up the Arduino which could be doing a lot of other things.

I'm definitely not putting down that product.  It's great if you want to learn how to use SD cards and the MP3 decoder.  Go nuts if that's what you want.

The rMP3 can run on it's own, or can be controlled by an Arduino (or another microcontroller) with very little interaction.

Bottom line:
You'll need more than just that $30 board to get MP3's playing.  And you may not have much space/time left on your Arduino for anything else.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: DeadEye on May 04, 2010, 08:14 pm
Oh, sorry didn't notice that. If that's the case then I'm definitely buying this one over the MP3 Shield. Seriously, though, I thought the MP3 Shield didn't need any other parts. If what you say is true then it seems the rMP3 is way better.

Thanks for the explanation.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: DeadEye on May 05, 2010, 06:40 pm
Can you tell me what are the differences between the uMP3 and rMP3?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on May 05, 2010, 07:47 pm
The uMP3 (http://www.roguerobotics.com/products/electronics/ump3) has been around since 2003 and is tried, tested and true.  It's original design was intended for OEM integration.  It uses the ATmega32 controller running at 7.3728 MHz.

The rMP3 (http://www.roguerobotics.com/products/electronics/rmp3) can also be used for OEM integration, but is also an Arduino compatible shield.  The controller (ATmega644P) is running at 2.5x the speed of the uMP3, enabling more processing in the same amount of time.  The larger flash size on the controller also provides more space for firmware improvements.

They both have the same base function set (playback controls, external triggering, config on card (COC), file access, etc).  You will see more improvements on the rMP3 versus the uMP3 because of the flash constraints.

You can use either with an Arduino (libraries (http://www.roguerobotics.com/wikidocs/code/libraries) work with both), but the rMP3 can piggy-back directly onto an Arduino:

(http://www.roguerobotics.com/wikidocs/_media/rmp3/rmp3_arduino-01-500px.jpg) (http://www.roguerobotics.com/wikidocs/rmp3/)
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Lazarus404 on May 05, 2010, 07:54 pm
Have you considered providing a simpler way to reroute the jumpers on the rMP3?  I had a tough time soldering new wires to the jumper pads with my 2.3 mill soldering iron, and would have loved to have simply been able to move a jumper sock, instead... This might not be the best solution, but there must be other methods for providing for this? :)
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on May 05, 2010, 08:42 pm
I had.  The problem becomes: how does one reroute signals?  Do I provide a couple of options?  There currently are no standards for what pins are used by what shields (considering the vast amount of shields around, it might be worth making a list of pins used by them all).

Another shield I had considered making was what I called a "SwitchBoard" (i.e. like the old style telephone switchboards).  You simply use wires to reroute signals (it's all flush or below the female headers).  But I figured that not many people would use it.

I chose to put down some pads.  Unfortunately, I used 0603 pads.  A bit small to work with.  Sorry about that!

The next hardware version will have something easier for rerouting the signals.

Out of curiosity, what pins did you reroute to and why?

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Lazarus404 on May 05, 2010, 08:47 pm
I rerouted to 3 and 4, simply because 5 and 6 are used by my LED Keypad shield, which I need for my Jukebox project. When I first looked at rerouting, I was hoping to use the little holes that lead to the pads, by threading a simple tinned wire through each. However, those holes are too small, too... It could have been a nice option, though.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on May 05, 2010, 09:27 pm
Geez.  I forgot you posted that earlier.

I was thinking of maybe just using some standard holes in place of the pads next time.

Have you got a blog/page for your jukebox? It would be great to see.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Lazarus404 on May 05, 2010, 09:38 pm
Not yet, my site is down, but I do plan on posting a start to finish mini site. I'll be sure to send you a link when it's up. Maybe you could use it as a case study?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on May 05, 2010, 10:45 pm
That would be great!  Thanks!  Let me know if you need any help with coding - I'd love to help.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on May 06, 2010, 09:15 pm
Quote
considering the vast amount of shields around, it might be worth making a list of pins used by them all

I agree with this but obviously not the easiest thing to do.

The idea thing would be an interactive list where you can add shields to see which pins are the same and which of the pins on those shields are re-routable (if any).

Anyone want to help take on this challenge?

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Lazarus404 on May 06, 2010, 09:19 pm
Er, no. :)
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on May 06, 2010, 09:20 pm
haha, thanks!  ;D
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on May 07, 2010, 07:02 am
Well, I started a playground page to start documenting the pins used:

http://www.arduino.cc/playground/Main/ShieldPinUsage

(see http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1273208396)

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on May 07, 2010, 09:35 am
Ok. Nice. I will see what I can help with later.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: marklar on Jul 12, 2010, 03:26 pm
I read all the replies to this post and the site details but am still not sure about 2 things.

I was reading a post about this being able to break out frequencies to over 20 bands, any details on that?

Can the rMP3 read music directly via an input jack or does this only work with mp3 files loaded on the SD Card?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jul 12, 2010, 03:50 pm
Quote

I was reading a post about this being able to break out frequencies to max 23 bands, any details on that?

It's still in beta. It can be done and brett will link you to the code if you want it. As far as I know, the beta is being released soon with more examples as to how to do this and other things.

Quote
Can the rMP3 read music directly via an input jack or does this only work with mp3 files loaded on the SD Card?

It doesn't have an input jack but as it plays its own music I'm not sure why you'd want to input music to it.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: marklar on Jul 12, 2010, 05:26 pm
Quote
... I'm not sure why you'd want to input music to it.


I want to make something anyone can come plug their own mp3 player (or any device or microphone) and have it split the bands to dance and/or show a simple EQ.  

The EQ chip from blip does 7 bands and that is good enough for most needs, but wanted to see if this device could provide more details.  It can, but not for my specific case of needing audio input.  I realize this product is not made for that purpose and it may pull those details from the mp3 file, so I can see how it would not fit my current need .. but wanted to ask to be sure.

Thanks for the details.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jul 12, 2010, 06:41 pm
Quote
I want to make something anyone can come plug their own mp3 player (or any device or microphone) and have it split the bands to dance and/or show a simple EQ.  

The EQ chip from blip does 7 bands and that is good enough for most needs, but wanted to see if this device could provide more details.  It can, but not for my specific case of needing audio input.  I realize this product is not made for that purpose and it may pull those details from the mp3 file, so I can see how it would not fit my current need .. but wanted to ask to be sure.

Thanks for the details.

No problem. It does not sound like it is suitable for your purpose.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jul 12, 2010, 09:08 pm
Yeah.  The spectrum analyzer on the rMP3 is in the digital domain only (it's done internally on the VLSI chip).

FYI: the beta will be posted tomorrow.  It includes the custom 1 to 23 band spectrum analyzer (with peak values), and mp3 track time retrieval.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jul 14, 2010, 05:54 am
New beta firmware with some fixes and new features can be found here:

http://code.google.com/p/rogue-code/downloads/detail?name=rMP3-100-02-b002.zip

You'll also need to download the latest RogueMP3/RogueSD libraries (http://code.google.com/p/rogue-code/wiki/Start) to get at the new features.

New features:


[media]http://www.youtube.com/watch?v=DH8HDMvpXpU[/media]

The LCD example is included in the latest RogueMP3 library.

More documentation forthcoming at our WikiDocs (http://www.roguerobotics.com/wikidocs/) - just yell at me if you need help with anything.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jul 14, 2010, 09:34 am
:D yippee

Now I just need to find some time to play with it.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: marklar on Jul 14, 2010, 02:26 pm
Nice stuff.  This is on my hot list for sure.  

Side note:  In the video - is that one of those off the shelf POV clocks (not sure the name) and you have modified it?  
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: 4050 on Jul 14, 2010, 02:37 pm
want to make something anyone can come plug their own mp3 player (or any device or microphone) and have it split the bands to dance and/or show a simple EQ.  

The EQ chip from blip does 7 bands and that is good enough for most needs, but wanted to see if this device could provide more details.  It can, but not for my specific case of needing audio input.  I realize this product is not made for that purpose and it may pull those details from the mp3 file, so I can see how it would not fit my current need .. but wanted to ask to be sure.

Thanks for the details.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jul 14, 2010, 03:19 pm
Quote
In the video - is that one of those off the shelf POV clocks (not sure the name) and you have modified it?

Having chatted to him, I can say that it is an off the shelf pendulum clock that has had the display hacked to run the clock and rMP3 visualisations.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jul 14, 2010, 07:46 pm
Yeah, I'm putting a page together with all the details about that clock and then I'll show it off.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: kreddy on Jul 15, 2010, 10:26 am
Hey,

I bought a couple of rmp3 modules recently. Is it possible to play multiple audio tracks at once using these shields? I would really like to do this.
thank you!

kedar
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jul 15, 2010, 10:40 am
Quote
I bought a couple of rmp3 modules recently. Is it possible to play multiple audio tracks at once using these shields? I would really like to do this.
thank you!

The shields can be stacked and more than one can be used on one arduino.

By cutting in between the pads (the ones before pins 6&7) you can then connect those lines to some other pins of your chosing. Then you can define a second instance of the rMP3 board and control both by sending serial commands to each on individually.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: laxman098 on Jul 19, 2010, 08:24 am
rMP3 Playback Module - An MP3 Shield.It nice MP3 playback
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: guitarist on Jul 25, 2010, 08:38 am
I know that this product doesn't quite fit with what I am wanting to do, but you guys seem to be quite knowledgeable with the field.

I am trying to design a sort of ethernet-based intercom-type setup, where there will be a pair of speakers & a mic in each room.  The mic would get converted into a digital signal and streamed to a central pc.  The PC in turn, would stream back audio to the device, which would convert it to analog audio to playback on the speakers.  I envision the arduino setup would be like a "dumb hub"--it receives input, and does the AD/DA conversion (and any codec work), and then it pipes it out the opposite end.

Does anyone have any ideas/suggestions on getting the necessary hardware to set this up?  I've searched around for hifi audio processing shields, and this one was the best one I could find.  Perhaps it can be modified to fit my purposes?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jul 25, 2010, 10:07 am
I suggest you post that question as its own thread. Most people will not now read this thread unless they have posted in it.
Does it need to be ethernet? Is it only for two rooms? A whole building?

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: guitarist on Jul 25, 2010, 02:22 pm
I've reposted here: http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1280060445/0

and yes, I'm looking at a whole building worth of rooms.  If it were only two rooms, I could just throw 2 sound cards in the computer and not have to worry about developing an expandable setup like this.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: novice on Aug 02, 2010, 01:42 pm
Hi bhagman,

what's the difference between this unit and your "µMP3 Playback Module"?.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Aug 02, 2010, 01:46 pm
Quote
Hi bhagman,

what's the difference between this unit and your "µMP3 Playback Module"?.

One's an arduino shield and one's not.  ;)
Title: NEW PRICE for the rMP3
Post by: bhagman on Aug 10, 2010, 10:59 pm
GOOD NEWS!

I managed to talk all involved to bring the price down on the rMP3!  CAD$59.99 (which is something like USD$58.00 as of 2010/08/10) will get you the rMP3 board without headers, CAD$64.99 gets it with the headers - you need to solder them on.

http://www.roguerobotics.com/products/electronics/rmp3


b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Aug 10, 2010, 11:09 pm
For us english folk, that's about £37/£40 (without/with headers)

Sounding good. I have a project in mind for another  :)

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: thimel on Aug 19, 2010, 06:34 am
I've just purchased the rMP3 shield and am having trouble getting it to work with my Arduino. A lot of things work, but not everything. I will give a detailed set of symptoms and hope someone can tell me what is wrong or suggest some way to diagnose the problem.

The example program RogueSD_uMMC works perfectly. (The only change I made to it was to tell it I was using serial pins 6 and 7 as I did not cut traces and put in jumpers yet.) It properly shows the files I have on the SD card.

The example program rMP3_Playback_Example partially works. The only change I made to it was to put in the actual name of my mp3 file. The serial monitor first shows a line with some garbage characters. (I don't know what causes them.) It then rapidly shows lines saying "Stopped vol:  20"). If I send a "k" this number increases. If I send an "i" it decreases. So far, so good. Now, the problem. If I hit "f" the activity light goes on for 7 seconds and the output on the serial monitor stops for that same 7 seconds. The mp3 file is 2 minutes long. I believe the activity light should go on for 2 minutes and the serial monitor should update with the position, sample rate etc. Also, the headphones I connect to the output connector produce no sound.

I've checked that if I purposely miss-spell the mp3 filename that when I type "f" nothing happens. This tells me that my file (when not miss_spelled) is being found. If I use a wav file instead of an mp3 file, then the pause is about the length of the mp3 file, put still no playback information or sound. I tried putting a few simple commands in the setup part of the sketch. I flash the arduino LED, tell a file to play and flash the led some more. From this, it is clear that rmp3.playfile(SONG) call is not returning until the song is totally "played." This is not right, but is consistent with what I saw earlier in the serial monitor.

I checked the firmware version number. It is 10001. From what I can tell on the roguerobotics wiki, the uMP3 has many firmware versions, but the rMP3 only has this one.

Any suggestions?

Thanks
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Aug 19, 2010, 11:57 am
The rMP3 has had a beta update but it should not affect that functionality.

If you want to try it:
http://www.roguerobotics.com/wikidocs/rmp3/beta/start

Brett will no doubt see this later but I will have a think about it.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: thimel on Aug 21, 2010, 04:19 am
I thought maybe the 5V from the USB might not have enough current to both drive the Arduino and the MP3 card, so I plugged a 9V supply into the Arduino. Miracle! Everything now works properly. To confirm the cause, I disconnected the 9V supply. It still works!

So, I don't know what was really wrong, but it is working now.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Aug 22, 2010, 01:23 pm
Quote
So, I don't know what was really wrong, but it is working now.

Yeah USB should have more than enough current for it. Glad it's working now though :D
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: odiliaboeso on Aug 25, 2010, 07:54 am
"This sketch randomly plays all the songs in a folder.  You can control the volume, play/pause/stop/next, and ff/rew using serial input (from the IDE)."

Wow, pretty interesting.  Can't wait to have one.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: CrossRoads on Aug 31, 2010, 11:58 pm
Will this fit on a Duemilanove Arduino? Or will that take a little fooling around with mechanical spacing & jumpers?

I'm really thinking this on one of the tiny arduinos with mini USB connector and battery would be cool.
Got more ideas for toys than I have time to implement!

I've long been thinking that MP3 player that could take music off any USB device was needed. I still use my Neuros Audio MP3 player daily, kinda clunky looking now but with 80GB harddrive it plays a loooong tie before anything repeats. Just sits on my desk at work & goes & goes, and every once in a while I bring it home, delete everything, and load it with fresh stuff.
When they first came out, I got a little mp3 player that took some kind of small memory card. Not much capacity, maybe total of 256+64MB of music? Really slow to load at USB1 speeds, barely held enough songs to cut the grass (ripped at 256K), when 20GB Neuros came we got 3 of them, then upgraded to 80GB with USB2 speed when those came out.

(Everybody oohs & aahs over the apple stuff - that's nice, but I don't have time to fool with video when I'm at work or driving, and having to pull out reading glasses to see the little screen just sucks!)

Thanks
Robert
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Sep 01, 2010, 10:53 pm
Quote
Will this fit on a Duemilanove Arduino?

Yes. That's what it's designed for  ;)

Quote
I'm really thinking this on one of the tiny arduinos with mini USB connector and battery would be cool.

Well if you don't solder the headers on, it only requires power and 2 serial pins so you can connect it to any arduino without it just being a shield.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: CrossRoads on Sep 02, 2010, 12:05 am
Thanks mowcius. That's what I figured.  I've had a Deumilanove for a 2-3 weeks or so,  and its my first Arduino since I first came across them at instructables.com,  so the shield items are all new to me. Been browsing the forums some everynight, browsing the different stores out there, just taking it all in.

Robert
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: DeFex on Sep 09, 2010, 09:45 pm
could this be made to (quickly) change the pitch and change position playing within an audio file? If so, I think it might make a cool sampler.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Sep 09, 2010, 10:59 pm
Quote
could this be made to (quickly) change the pitch and change position playing within an audio file?

Unfortunately not quick enough for that, I also do not think it can change pitch (although perhaps this can be changed in software)

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Sep 17, 2010, 08:20 am
Hmmm... interesting thought.

OK, first off - the rMP3 can change pitch - but it's not as fast as you'd need it.

You can also start playing at any position in a file, and you'd be best off finding the proper frame to begin, if you are getting into detail.  It's a bit complicated, but you can do it.

Now, here's an idea:  Kind of a make-shift sample playback ---

Input from a Midi keyboard through an Arduino and have an rMP3 as a shield.

Now, you'll have to do some work creating some MP3 files, but it will be worth it.  Create one file for each key - use the same sound, and change the pitch (using Audacity or such) according to the key.  Name each file the same as the key (e.g. 060.mp3 for C4, 061.mp3 for C#4, etc.), then it's as simple as:

Code: [Select]

int note;
char filename[20];

note = getMidiNote();

sprintf(filename, "/%03d.mp3", note);

rmp3.playfile(filename);

// repeat ad nausem


It would only be monophonic, but it would be quite usable.  I'd be curious to see how it would turn out.  Heck, I could write the code in about 10 minutes, just need someone who has a Midi keyboard hooked up to their Arduino - I don't have one handy.

You could also create banks of sounds - just put each set of files under different folders.  e.g. /piano/060.mp3, /piano/061.mp3, etc... And simply prepend the bank name (or number, e.g. /002/060.mp3).

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Sep 17, 2010, 08:31 am
Quote
just need someone who has a Midi keyboard hooked up to their Arduino - I don't have one handy.

Oh so that's something I should do with my keyboard...  :D

Quote
OK, first off - the rMP3 can change pitch - but it's not as fast as you'd need it.

Interesting...

Quote
You could also create banks of sounds - just put each set of files under different folders.  e.g. /piano/060.mp3, /piano/061.mp3, etc... And simply prepend the bank name (or number, e.g. /002/060.mp3).

Didn't you say it was faster if you used .wav files (or something like that)?

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Sep 17, 2010, 06:03 pm
Yes.  Mowcius is hereby mandated to pull out his midi keyboard and get it connected to his Arduino and rMP3 - ready to accept my wondrous code.

Let me know when you have it all hooked up. ;)


RE: WAV files - you will get marginally quicker starts from WAV files.  But the difference is pretty negligible.  The suggestion about using WAV files was for stringing sounds together (like speech) - since you need to keep the gaps as small as possible.  For a MIDI audio module, we won't need to worry about that.


Oh, and another note (pun kinda intended): We can make it have more note polyphony if we add more rMP3s!  2 rMP3s = 2 note polyphony!

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Sep 17, 2010, 06:20 pm
Quote
Yes.  Mowcius is hereby mandated to pull out his midi keyboard and get it connected to his Arduino and rMP3 - ready to accept my wondrous code.

Let me know when you have it all hooked up.

Mowcius discusses this on IRC with bhagman  ;)
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Vertigo on Sep 20, 2010, 05:48 pm
Hi,

I read on the rMP3 page that some changes must be done to the Serial core of arduino 0018 to use the RogueSD library.
Does this mean that these changes are necessary for any use of the rMP3 shield ?

I also read that arduino 0019 includes a "Stream base class". Does this mean that no changes to the core are necessary anymore ? Is the RogueSD lib directly compatible with 0019 ?

Thanks a lot,

Manu.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Sep 20, 2010, 09:26 pm
Quote
Does this mean that these changes are necessary for any use of the rMP3 shield ?

Yes

Quote
I also read that arduino 0019 includes a "Stream base class". Does this mean that no changes to the core are necessary anymore ? Is the RogueSD lib directly compatible with 0019 ?

I think 0019 code is being worked on. I use 0019 now but as things are different, things may not work like with 0018. I have only tried a few things with it on 0019.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: TheLaw on Sep 21, 2010, 12:54 am
Is there any sort of amp onboard? There are some very effective, simple amp circuits that can probably be integrated on board and that would make a totally awesome board in my opinion. But then it would probably need another power source or some sort of step up. 5V won't cut it usually.

Oh whatever. I'm just blabbering.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Sep 21, 2010, 11:48 am
Quote
Is there any sort of amp onboard?

Well I don't know quite what power the board is capable of giving out but I think it's stated in the documentation, what ohm speakers you can use. There is not an amp on board as such (well not like you are thinking of) but as you say, the power comsumption could jump through the roof!

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Vertigo on Sep 21, 2010, 02:50 pm
Thanks Mowcius.

I'm not quite keen on modifying inside the Arduino libs, I must say. :-?

If the 0019 fixes the base class issue, then the rMP3 lib should be updated to be fully compatible with 0019, is that right ? Maybe bhagman is working on that ?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Sep 21, 2010, 04:39 pm
Quote
If the 0019 fixes the base class issue, then the rMP3 lib should be updated to be fully compatible with 0019, is that right ? Maybe bhagman is working on that ?

As I understand it, he is working on this, yes.

It is not tricky to rename your old arduino files as backups and then paste in the new ones. Pretty much risk free. I have not had any issues whatsoever.

I would have thought that Brett would have visited this thread by now. If he's on the IRC later I will nudge him this way. (Maybe he's secretly watching  ;D)

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Sep 22, 2010, 04:38 am
Sorry.  I'm not as quick as Mowcius. :)

RE: Amp:
There is no amp on-board - you are correct - it draws too much power, and people have different preferences on what they want to do with the output.

We are putting together an amplifier add-on board.  I'm not exactly sure when it will be ready.


RE: 0019 compatibility:
Unfortunately, the 0019 release was ready to have the base class (Stream) in place, but because of the Ethernet class (they wanted it to inherit from the new base class), changes were made to the base class - backwards, I know, but it was done.

So I wrote the changes to the Ethernet Client class so that it would meet the requirements of the base class - So my fingers are crossed that the base class will be in 0020 - and hopefully soon.

To have out of the box Arduino IDE readiness, we have to wait until 0020.

In the meantime, you can either use 0018 with the pre-packaged core with the base class I created - http://code.google.com/p/rogue-code/downloads/list?q=arduino+core - or wait just a bit, and I will have a new package for 0019 - essentially the same thing.  

Details on how to do it are here:
http://www.roguerobotics.com/wikidocs/code/arduino_serial_base_class


b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Vertigo on Sep 22, 2010, 05:38 pm
Thank you Brett.

I'm a total newbie to acoustic electronics.  :-[
I see that the output impedance is 16 ohm. I want my small robot to speak as loud as normal human voice. What type of small speaker could i connect to the rMP3 output then ?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Sep 22, 2010, 05:53 pm
You can find some really good 16 Ohm speakers - which can belt out the sound.  But depending on how loud you want it, you may need to add an amplifier.  You may be able to find some small battery powered speakers, and hack that to your needs.

On bigger projects, I usually suggest buying a pair of powered PC speakers.  If you're going small, you'll need to find something more manageable.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: edytharceo on Sep 27, 2010, 02:58 am
This is will be definitely on my list and I may be able to get one soon, can't wait to have it.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: thimel on Sep 28, 2010, 05:47 am
Does anyone have a program to copy MP3 files from a computer to the SD card via the USB cable connected to the arduino? I know I can take out the SD card and put it in a card reader attached to the computer, but I'd prefer to use a copy program if one exists.

Thanks
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Sep 28, 2010, 09:45 am
Quote
Does anyone have a program to copy MP3 files from a computer to the SD card via the USB cable connected to the arduino? I know I can take out the SD card and put it in a card reader attached to the computer, but I'd prefer to use a copy program if one exists.

In the configuration of the system as it is, you cannot do this. The arduinoi is not really powerful enough as it is to perform this function anyway.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Atmoz on Oct 24, 2010, 10:47 am

Hello,

Please could someone tell me how fast this rMP3 player is?
If I trigger an input on the Arduino, what time does it take to play a sound for example "female_voice_Input_1_triggered.mp3" ?

Because normal MP3-players take some time to "start-up"...
What about this module?

Thanks for the help!!

With kind regards from the Netherlands,

Atmoz
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Oct 24, 2010, 05:36 pm
If everything is initialized (i.e. card inserted and powered up), the time to start playing a track is in the order of milliseconds.  (Factors: serial bit rate, file system, card make/model, etc.)

If it is the first time the card is being read (i.e. after a new card is inserted, or during power-up), the best way to minimize start-up delays is to use FAT32.

What are you looking to do with the rMP3? Maybe I can give you some ideas on how to achieve what you want.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Atmoz on Oct 25, 2010, 05:46 pm
Thank you for the quick answer!

That sounds very good. In the meantime I've ordered the module :)
I want to make a 'Speaking Home Automation System'

For example when I come home it says:

"Welcome Stephan"
"There are 3 new emails"
"The doorbell has ringed 2 times, do you want the pictures from the ringer(s) on the tv?" (With a Voice Recognition System I can answer YES of NO, and with a IP camera the images are stored in a database)

or something like:

"the oven is ready!"
"there is post in your postbox" (at the front door)
"the Jacuzzi reached a temperature of 35 degrees"

and when I leave my house:

"lights in bedroom 1 are still on"
"turn lights in bedroom 1 off?"
(I answer with YES or NO)

etc...  :D

A little work, but nice to have isn't it?

Thanks again!!

Atmoz
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Oct 25, 2010, 10:07 pm
Might take some time to record all of those phrases!

Sounds like a killer project though.

I was looking for the best online speech website a few months back for something similar but never got any further with actually doing it.

Rather not have my own voice speaking to me  ;)
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: CrossRoads on Oct 25, 2010, 10:20 pm
How about Mr Ts voice then:

"I pity the fool who left the lights on!"
or
"I pity the fool who didn't close the garage door!"

http://www.quotelucy.com/quotes/mr-t-quotes.html
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Oct 25, 2010, 10:55 pm
TTS (Text To Speech) Engines can be fun.


http://tts.imtranslator.net/D2Am

http://cepstral.com/demos/
"I pity the fool who left the lights on!"
(Select "Walter (US English)" -> Say It!)

Plenty more TTS engines out there:

http://www2.research.att.com/~ttsweb/tts/demo.php
http://www.ispeech.org/
http://www.ivona.com/
... I'm sure there are hundreds more...


Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Oct 25, 2010, 10:59 pm
Yeah I think I saw all them. Can't remember what I came up with as the best in the end but I don't think I could get quite what I was after...

I'll take another look and probably have to compromise  8-)

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: ransol on Nov 13, 2010, 11:01 pm
Anyone using this shield? I got a compile error about peek() and according to them, Arduino team added and removed the peek and was told to add "Arduino serial base class" but that would not let me upload to the board.  I get this error
avrdude: stk500_getsync(): not in sync: resp=0x00 avrdude: stk500_disable(): protocol error, expect=0x14, resp=0x51
Error persists even after removing the "serial base class"
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Nov 13, 2010, 11:36 pm
I am using this shield, had no issues.
It does require the serial base class but that is something that is very likely to be included as standard in the IDE soon.

The error you are getting is very common and unlikely to be related to the rMP3 shield - as is why it persists when not using the serial base class.

A quick search on the forum should tell you all about the error.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: ransol on Nov 14, 2010, 12:02 am
I have tested this on two of my computers.
Everything works fine and then it stops uploading as soon as you add the serial base class.  Removing is not helping.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Nov 14, 2010, 05:00 am
@ransol: Which Arduino board are you using?

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: ransol on Nov 14, 2010, 03:19 pm
Arduino Duemilanove (Windows XP and 7) Arduino-0021, 18
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Nov 15, 2010, 06:21 am
@ransol: I'm guessing that you downloaded the SerialBase version somehow, which should work with 0018 - but if you get 0021 installed, then get the "Arduino with Stream Core (http://code.google.com/p/rogue-code/downloads/list?can=2&q=arduinomods)", you'll be set.

When you have it all installed, select "(Stream) Arduino Duemilanove or Nano w/ ATmega328" from Tools->Board.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: petyrstretz on Nov 17, 2010, 05:38 pm
Are there enough pins left over to run a display, or maybe an RTC so this could be used as an alarm clock?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Nov 17, 2010, 06:22 pm
@petyrstretz: Our LEDHead (http://www.roguerobotics.com/products/electronics/ledhead) has an RTC on board.  I've built a clock/mp3 player using the LEDHead (http://www.roguerobotics.com/products/electronics/ledhead) and an rMP3 (http://www.roguerobotics.com/products/electronics/rmp3).

I have a video of the spectrum analyzer display - in there you can see the POV (Persistence Of Vision) clock I've been working on.

[media]http://www.youtube.com/watch?v=DH8HDMvpXpU&feature=player_embedded#![/media]

@ around 1:40, you can see that I display the current time position of the song.  Right now, as the clock sits on my desk, it's playing music, showing the spectrum analyzer and the current time:

(http://i51.tinypic.com/10di7hw.jpg)


b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Nov 17, 2010, 09:39 pm
Quote
Are there enough pins left over to run a display, or maybe an RTC so this could be used as an alarm clock?

It only uses two pins (serial) for main control so there are plenty of left over pins for anything you want to add.  :)
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: petyrstretz on Nov 17, 2010, 09:44 pm
I guess I know what the Christmas present to myself is gonna be this year. ;D  Thanks!
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: ransol on Nov 20, 2010, 08:02 pm
Thanks bhagman,
My fault, I was selecting the wrong board.

(I also discovered the Arduino preferences file in the process. Now, I can get my Arduino 21 to open when I double click pde files)  
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: y0shiy0shi on Nov 22, 2010, 04:09 am
bhagman and/or mowcius,

wondering if you can help me with some basic questions regarding the rMP3 unit before i purchase. I need to do two things using mp3 decoding with a new Arduino Uno processor:

1) From reading all the information on the website and on this forum, I know that there are digital triggers (on the arduino or rMP3 unit) to trigger tracks to play immediately. Can I trigger tracks to play at discrete positions immediately? Say, have a pushbutton tied to the arduino that when pressed, code sends a command to the rMP3 tell it to play track '/test.mp3' at 02:30:12.. or something like that.

2) I read in the beta documentation that there is now a new query command to have the rMP3 return the current running track position. I would like to have an LCD readout display this info, but do I really need to query the unit every second, or is there a mode I can set to have it send this info out to me. Also, more important than the LCD readout, I need to trigger digital outputs on the arduino at timed intervals. rather than track that time in my code (where it can get our of sync if something happens to the rMP3 playback), I would like to base this timing off of the actual data. Much like the daft punk lyrics demo I checked out, I simply need triggers based on track position. I don't understand exactly how the lyrics file works and how the triggers are being generated.

Any help is appreciated, I hope to order the shield tomorrow at some point. Thanks
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Nov 22, 2010, 04:50 am
@y0shiy0shi:

1) You could use the controller to trigger playback at specific positions in a track.  The controller would need to do something like this (pseudocode):

Code: [Select]
wait for trigger();
playfile(filename);
playpause();  // pause
jump(newtime);  // jump to new position (in seconds)
playpause();  // play


I can help you with specifics when you get down to it.

2) The lyrics example has the controller start a 1/100th second timer at the beginning of the song.  Then the controller can check that time for triggering other events.  Does that make sense?

e.g. (Pseudocode again)

Code: [Select]
playfile(filename);
starttimer();  // start 1/100th second timer (10s of milliseconds)
wait_until(timer == sometime);
do_something();
wait_until(timer == someothertime);
do_somethingelse();


Again, I can help you with detail on that.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: y0shiy0shi on Nov 22, 2010, 05:57 pm
In your code, the timing is based off of a code driven timer on the arduino triggered at the same time you triggered the start of playback on the rMP3. I sort of need a more secure way of generating the triggers, preferably realtime based on the actual MP3 players track progress. Because I want to deploy this in a live event, I only want the triggers to be actuated on the actual timecode of the song. If something happened to the rMP3 that affected the playback, I dont want the triggers to go off. i guess it wouldn't be so bad to poll with the new beta command every second to get the actual timestamp, it just seems like a lot of communication
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Nov 22, 2010, 06:34 pm
Quote
it just seems like a lot of communication

Well it would be less communication than the spectrum visualiser!

I would not have thought there would be any issue there.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Nov 22, 2010, 07:55 pm
@y0shiy0shi: The issue is that you can't get any more accurate information from the decoded mp3 data.  The decoder only provides 1 second semi-accurate information.

If you want to get hyper-accurate, then you could directly map file positions from the mp3 file, then query the mp3 file position as it plays (FC I 4 is the low-level command, use the RogueSD command: RogueSDCommandObject.getfileinfo(4) - the MP3 file plays from file handle 4).

It's a bit overkill, IMO, though.  If you have some sort of playback issue, there are probably bigger problems afoot.

Using a timer on the controller is considerably easier and more accurate than you think.

FYI: I've been running 2 of our MP3 units (1 uMP3 (http://www.roguerobotics.com/products/electronics/ump3) and 1 rMP3 (http://www.roguerobotics.com/products/electronics/rmp3)) non-stop for more than 6 months (the uMP3 (http://www.roguerobotics.com/products/electronics/ump3) unit has been running non-stop for over 1 year!) without hiccups.  The uMP3 (http://www.roguerobotics.com/products/electronics/ump3) unit displays data (i.e. constant status queries) on an LCD (it's played well over 130000 songs back to back).  The rMP3 (http://www.roguerobotics.com/products/electronics/rmp3) module is on the POV clock/player - and has been running for over 6 months non-stop (playing songs and displaying spectrum analyzer data).

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: y0shiy0shi on Nov 23, 2010, 06:34 am
Thx for all the fast replies. Just to keep you updated, i have already placed my order and will definitely let you guys know how it turns out. I will play around with the accuracy of keeping time on the arduino. Insure it will be fine. Actually, now that I'm thinking of it, how many digital output triggers are available once the rmp3 uses it's required digital pins? I might need some sort of expansion bus of digital I/o's. Does this exist? I have an UNO. Thanks again.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Nov 23, 2010, 07:51 am
Well the rMP3 itself has 8 digital trigger inputs for playing songs.

The shield only uses 2 digital pins (6 and 7) for serial communication s0 on the Uno you would have a minimum of 16 digital pins (analog 0-5 included) which could be used as input/output.

Obviously as you say, some kind of multiplexer/port expander etc could be used to gain additional inputs/outputs if required.

Something like the centipede shield/mux shield etc might be what you are after.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: LBArduino on Dec 13, 2010, 03:57 pm
Hi all,

I would like to use my rMP3 to read an MP3 stream from an internet radio.  The idea is that I will just have to power the arduino to listen to the radio instead of having to switch on my computer (lengthy + higher power consumption).

My problems are:
- can the rMP3 write on the SSD card while it is playing, and can it do that fast enough to use it as a buffer?
- How can I program a client for streaming? I can probably find some docs about MP3 streaming but that will probably take me ages to understand, so is there a code somewhere that I can re-use?

I am quite new to C++ so any help would be greatly appreciated!
For notice, I have an rMP3 shield, ethernet shield (w/o SSD card) and arduino duemilanove.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Dec 13, 2010, 04:18 pm
Hmm that is an interesting idea.

I'm afraid I have no idea on this one, we'll have to wait for rogueb to turn up.

The issue I think will be is that the data has to get from the internet, interpreted with the ethernet shield, through the arduino, into the rMP3, onto the SD card then back off the SD card to play it.
Not sure how much of that is possible/if there's some way to get round it and make it work.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: LBArduino on Dec 13, 2010, 07:04 pm
One more thing: I am using the ENC28J60 ethernet shield (v1.1), it uses a different library than the others.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Dec 13, 2010, 07:08 pm
Well, talking to rogueb, sounds like the board could probably do it but the arduino might still be the limiting factor, wouldn't be easy anyhow.
The issue is getting the data to the board from the internet.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: LBArduino on Dec 14, 2010, 09:56 am
Yes, I think so. I am not sure if the stream needs to be decompressed before being written into the buffer.
The idea I had initially was to use two or three buffers, to fill one in with the incoming data while the other is being played.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: novice on Dec 14, 2010, 10:15 am
LB01,
why would the rMP3 have to write to the SD card while playing?.
Is it for buffering?.

There is a similar project you could source some code from at http://www.circuitcellar.com/avr2004/HA3814.html

PS: you refer to an SSD card when it should be an SD card.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Dec 14, 2010, 11:21 am
Quote
There is a similar project you could source some code from at http://www.circuitcellar.com/avr2004/HA3814.html

Interesting. I do wonder how the mp3 chip is talking to the microcontroller there.
[edit]The schematics are linked from that page. External SRAM presumably for buffering (perhaps not though) so an rMP3 with some SRAM and an XPORT and a few code mods should do what you're after.[/edit]

The rMP3 has its own onboard ATmega644 so by itself it is probably capable of performing the functions you require but that would require re-programming the on-board chip and connecting eithernet shield directly to it.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: LBArduino on Dec 14, 2010, 05:47 pm
Thanks Mowcius, that looks like I want to do, but I cannot see an rMP3 module. It probably uses a custom-made script... Anyway, I'll contact the guy, see what he is willing to give.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: LBArduino on Dec 14, 2010, 07:34 pm
oops, I didn't see that all the code was available in the 'Entry' link...
Well, never mind, the author confirmed that the code is GPL v3 so I can have a look, even though it was using a totally different hardware.
Anyway, I'll see that for now.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: novice on Dec 15, 2010, 12:18 am
Well, "totally different hardware" in the sense that it is not an Arduino.

But, his design still uses an AVR microcontroller.  His code is more extensive than one would expect in an Arduino (where higher level libraries are provided).

It's an interesting project you've undertaken LB01.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Dec 15, 2010, 09:42 am
Quote
It's an interesting project you've undertaken LB01.

Well I suppose 'interesting' is one way to put it  ;)
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: LBArduino on Dec 15, 2010, 07:33 pm
"headache-prone" is another way to say it. :)

OK, so I had a look at the code from the 2004 project. If I underestand correctly, the microcontroler redirects the data to the buffer and uses a 'streaming mode' from the MP3 decoder so that there is no need to manage the flux.
Taken that way, it may not be that difficult to realise. Do you know if the rMP3 has a streaming mode that can be used for the same purpose?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Dec 15, 2010, 09:30 pm
Quote
Do you know if the rMP3 has a streaming mode that can be used for the same purpose?

Heh, I think the chip might. No idea about how to do it on the rMP3 board.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Dec 16, 2010, 08:04 am
I've been toying around with a direct streaming mode for the rMP3.  The decoder can do it.

I just need some time to code it.  Unfortunately, I've been pretty busy with Wiring (http://wiring.org.co/) and new products lately and I won't get a chance until late January before I can even look at the rMP3 firmware for new updates.

The idea of buffering the data to a file is possible... in theory.  You couldn't have an endless stream, though - that will only work with the direct stream mode.

The ONLY way it would work is:

If at any point the decoder ran out of data, playback would stop.

I haven't tried it, but it should work.


b

--
Check out the Rogue LEDHead (http://www.roguerobotics.com/products/electronics/ledhead).

Wiring (http://wiring.org.co/) - Where it all began.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: LBArduino on Dec 16, 2010, 06:11 pm
Thanks for the ideas, bhagman!

Ok, no streaming at the moment so I have to do with buffering.

I see another possibility though: if i use three different files to buffer the data, it should be possible to play the stream:
1) fill in the 1st buffer, then the 2nd buffer with the stream
2) play the 1st buffer while filling the 3rd buffer
3) play the 2nd buffer while filling the 1st buffer
etc...

If the rMP3 can play two files consecutively without delay, we shouldn't hear the transitions between the buffers?

So far I have been able to copy a file from my computer to the SD card by serial port. I'll try to do it via the network now...
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Dec 16, 2010, 10:19 pm
Unfortunately, in the current firmware, there will be a small delay.  (10s of milliseconds, but it will be noticeable to the human ear).

You just gave me an idea that I'd like to try out as well.  It only took me a few minutes to make the change in the firmware.

The new firmware has a setting which when set will not reset the decoder.  This will remove the delay between files.

I just tested it, and it works great.  So your concept with 2 or three file buffers will work.  (Gory detail - you won't even have to break the file at MP3 frame boundaries)

I'll have to make some changes to the RogueMP3 library to utilize the Play Next command (PC N).  This will automatically play a file right after the current one finishes.

Download: rMP3-100-02-b003 firmware (http://code.google.com/p/rogue-code/downloads/detail?name=rMP3-100-02-b003.zip)

b
--
Rogue Robotics rMP3 Playback Module (http://www.roguerobotics.com/products/electronics/rmp3)

Wiring (http://wiring.org.co/) - Where it all began
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: LBArduino on Dec 17, 2010, 10:24 am
That is great! Thanks a lot bhagman!
So I need to upgrade the firmware before I do anything now. I will try something either tonight or tomorrow morning. Cross fingers! ;)
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: LBArduino on Dec 18, 2010, 01:20 pm
Ok, so here is a recap of what I've done this morning:
- upgraded firmware via arduino (btw, the java updater doens't find any COM port, I had to use the command line method)
- installed arduino 21, then installed the arduino stream pack (18/10/10), rogue MP3 pack (v3), rogue SD pack (v4), NewSoftSerial pack (18/10/10) and ethershield pack (v1.1)
- Tested the ethernet board: I needed to rename the files from 'etherShield' to EtherShield', but then I could access the web page from my house network :) *moment of happiness*
- Then I placed a file on the root folder of the rMP3 SD card with the characters 'D3' and carriage return to set the rMP3 module baudrate to 57600 bauds
- I uploaded a script and it works fine! :) (Well, I had to work a bit)
- Then I tried to upload a song from the serial port using the following script and it caused problem: the quality of the music is degraded during uploading (there are small pauses of ~100ms every 100ms) and the file is not copied correctly. The function below is called when the user send 'w' on the USB port:

void writeFile()
{
 int8_t filehandle;
 uint8_t v = 8;
 
 Serial.println("Enter the name of the file:");
 Serial.read(); // flush the data
 
 while(!Serial.available()) // wait for data to arrive
 {
   Serial.print(".");
   delay(500);
 }
 int length = 0;
 name[length] = Serial.read();
 while (1)
 {
   delay(10); // wait for the next character
   if (Serial.available())
   {
     length++;
     name[length] = Serial.read();
   }
   else
   {
     break;
   }
 }
 // at that point we have the name of the file to write, so we can open a file
 filehandle = filecommands.open(strcat("/", name),open_mode(OPEN_WRITE));  
 if (filehandle<1) // in case of an error during the opening
 {
   Serial.println("Error: cannot open the file.");
   return;
 }
 // next ask for the data to write in it
 Serial.println("Load the data:");
 while(!Serial.available()) // wait for data to arrive
 {
   delay(10);
 }
 Serial.println("");
 Serial.println("Loading...");
 int i = 0;
 while (1)
 {
   i++;
   if (Serial.available())
   {
     char buf = Serial.read();
     filecommands.write(filehandle,1,&buf);// write the buffer
     //Serial.print(buf);
     i = 0;
   }
   if (i>10000)
   {
     break; // ends on timeout (maybe 10000 is a bit large)
   }
 }
 // finally, close the file
 filecommands.close(filehandle);
 
 updateSongList();
 Serial.println("Done!");
}

It is probably not the best way to copy a file of th SD card. Is there any obvious mistake or suggestions?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: LBArduino on Dec 18, 2010, 08:28 pm
I have another problem now: the rMP3 won't synchronise. It stops when I use the sync method.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: LBArduino on Dec 22, 2010, 08:06 pm
Its getting somewhere:
I am using the ethershield library from nuelectronics, and I can now download data from a server. I have tried with google.com, and it (sort of) works :)
About the rmp3, I can sync again (it was a problem with the compiler) but the SD card has been damaged beyond repair the last time I tried to use the module. I am not sure if that is due to a bug in the new version of the firmware, if it comes from the sync problems or if the card is just dead from old age...
Anyway, I wont have time for it before a few days. Merry christmas to you all!
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Dec 22, 2010, 10:38 pm
Hey LB01,

Same with me... Holidays are here.  I'll help out more in the new year!

Enjoy, be safe, and happy holidays!

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Vertigo on Jan 03, 2011, 03:42 pm
Hi and happy 2011 to all ! :D

I just tested my newly arrived rMP3 on an Arduino Mega 2560 with the arduino 0022 IDE.
I rerouted the rMP3 #6 and #7 pins to the mega's #19 and #18 (serial1), as per http://www.roguerobotics.com/wikidocs/code/rmp3_on_an_arduino_mega
(in fact I rerouted from the pin pads in order to be able to stack shieds above the rMP3).

Then I installed the rMP3 library, and tested the example given in the above-linked page, and it worked immediately ! GREAT !!!  8-)

I'm surprised because I thought I would have to do the "Core-stream-baseclass thing" ( http://www.roguerobotics.com/wikidocs/code/arduino_serial_base_class ) to make it work, but it seems that on the Arduino Mega, it's unneeded. Am I right ? I have the feeling it is because with the Mega's Serial1, the Softwareserial lib is not used, whereas it was on smaller boards ?

Is it so simple ? should I still do the Stream Class update for any reason, e.g. more-advanced use of the rMP3 features in the future ?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jan 03, 2011, 06:48 pm
@Vertigo: I assume you're using Arduino IDE 0022?

If so, there is no need to do anything else.  Since 0022, the full Stream base class is now part of the core.

If you do use the rMP3 (http://www.roguerobotics.com/products/electronics/rmp3) on the Arduino Uno/Duemilanove, you'll likely need to use NewSoftSerial.  I've worked with Mikal (maintainer of NewSoftSerial) so that NewSoftSerial inherits from Stream (as well as support for the "mega" boards).  I'm not exactly sure when Mikal intends to release the new version of NewSoftSerial.  In the meantime, I have a version available here (http://code.google.com/p/rogue-code/downloads/list?can=2&q=arduinomods).

b

--

Check out our rKey Capacitive Touch Switch (http://www.roguerobotics.com/products/electronics/rkey)
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: nerotix on Jan 03, 2011, 08:53 pm
That is awesome! Thanks a lot for the knowledge mate!
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Vertigo on Jan 05, 2011, 11:14 am
Hi,

I'm happy to hear that since 0022, the rMP3 shield is fully compatible.

I've been playing with it a bit, plugged to 2 small 8ohm speakers in series (to match the 16 ohm output impedance, and my sound file is mono): the output sound is very low, especially for bass.
Before thinking about how to add an amplifier, I wanted to try the volume and boost settings of the rMP3.

from http://www.roguerobotics.com/wikidocs/code/library/arduino/roguemp3 :

Code: [Select]
setvolume(byte newvolume) - sets the volume (both left and right to same value).

setboost(...) - sets the audio boost enhancement.


hmm ... I managed to understand from different sources that setvolume(0) is max output, and that setboost works something as :

Code: [Select]
setboost(bass_amp [0 - 15], bass_freq [0 - 15], treble_amp [-8 - +7], treble_freq [0 - 15])

Is that right ? what bass/treble frequency range are covered by the [0 - 15] range ? how do the amp values work ?

In a more general perspective, I trust in rMP3 as a very useful and handy device (I bought 3 for my project), but now that it is fully compatible, is it not time for a synthesized documentation, in a single, linear document ? I know everybody's busy, but I have the feeling that at the present moment, important bits of info are spread over in the rogue wiki, which can be an obstacle for "base" users like me.
bhagman, if you agree to put together this "simple" user manual, I can offer some of my time if you feel the need for a french translation.  :)

What do you guys think ?

Vertigo.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jan 05, 2011, 11:33 am
Quote
I've been playing with it a bit, plugged to 2 small 8ohm speakers in series (to match the 16 ohm output impedance, and my sound file is mono): the output sound is very low, especially for bass.
Before thinking about how to add an amplifier, I wanted to try the volume and boost settings of the rMP3.

This depends completely on the speakers but an amplifier will generally be a good idea.

Quote
In a more general perspective, I trust in rMP3 as a very useful and handy device (I bought 3 for my project), but now that it is fully compatible, is it not time for a synthesized documentation, in a single, linear document ? I know everybody's busy, but I have the feeling that at the present moment, important bits of info are spread over in the rogue wiki, which can be an obstacle for "base" users like me.

I also agree but it would be a lot of work and I presume you are talking about an arduino rMP3 document (with the arduino libraries) rather than simply a document on the rMP3 module as a whole. I have been working off and on with bhagman to suggest ways to tidy up the website a bit, perhaps now I have also got to grips with it a bit more, I can help more with this and a document specifically for the rMP3 explaining the major features if not everything the module can do yet.

I'm impressed you have 3 of them, what's the project?  :)

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: Vertigo on Jan 05, 2011, 03:20 pm
Thanks Mowcius for your reply.

The project is simply a talking robot. I got 3 cards because we should use two robots in the future (+1 spare ::) ).

You got my idea exactly : rMP3 deserves a simple manual, tutorial or web page for arduino users, explaining "only" essential points such as
- what the board is for and can do (file formats, etc ...)
- input : what arduino pins are used and how to reroute pins if needed
- output : what speakers can be used (still working on this obviously)
- content of the rmp3 lib, and how basic functions work ...

Not saying the rMP3 is poorly documented at all, but the waveshield pages for example are more friendly, at least to my level of knowledge http://www.ladyada.net/make/waveshield/index.html

If I go back to the speaker issue, Mowcius, I'm using two 50mm 0.5W 8ohm speakers in series. As I wrote above the sound is pretty low, lower than a normally speaking person (that's a standard ;) ). Here's what I checked and tested :
- rMP3 : set volume to 0 (max)
- rMP3 : boost bass
- file : normalized to 100% (I tested other music mp3s, too)
- speakers : connect only 1 speaker, hence 8 ohm instead of 16. I was affraid to burn the card. Did not burn, but the sound was not louder.

Am I missing something ? what do you mean by "This depends completely on the speakers" ?

I measured the rmp3 output on my scope, it ranges between +/- 0.8V, is it supposed to be so ?


Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jan 05, 2011, 04:35 pm
Quote
Am I missing something ? what do you mean by "This depends completely on the speakers" ?

What housing are the speakers in? Try taking a speaker out of it's speaker housing and see how much quieter it sounds.

Like anything, you can get good and bad speakers, better ones will be louder for the same impedance.

I will try to do some work on a simple guide to the rMP3 for arduino - if I can understand it - most other people should be able.  ;)

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jan 05, 2011, 08:32 pm
Hey Vertigo,

I totally agree with you about having a tutorial or such for Arduino/Wiring etc.

I'd be willing to work out something for anyone who wants to build up a tutorial/howto on our wiki.  And I'll definitely take you up on your offer to translate to French.  Just email me and we can get things worked out.

RE: speakers - the audio output on the rMP3 (i.e. from the VS1011) can only drive a 16 Ohm impedance load minimum.

Impedance is only half of the equation though.  All speakers have two ratings: Impedance and Watts.  To effectively use your speakers to produce the sound level for which they have been designed, you need to drive it with enough current to move their coils.

For example, an 8 Ohm speaker rated at 25 Watts will require 14 Volts (RMS - Root Mean Square - roughly means average) to produce maximum output swing on the speaker coil.

The VS1011 can only provide 2 Vpp (2 volts peak to peak maximum, and typically 1.6 Vpp - which is what you've measured).  It is designed to drive headphones or a line-input, and hence it will not be able to effectively drive the two larger 8 Ohm speakers in series.


We are designing a small amplifier board that one can use with the rMP3/uMP3 to drive small speaker loads. Follow us on Twitter (http://twitter.com/rogue_robotics) and we will announce when it's ready.

In the meantime, you can use a cheap set of pc speakers - they are usually amplified and cost very little.

b

--
Wiring - Open Source Electronics Prototyping Platform (http://wiring.org.co/)
rKey Capacitive Touch Switch (http://www.roguerobotics.com/products/electronics/rkey)
rEDI Education Board (http://www.roguerobotics.com/products/electronics/redi)
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 13, 2011, 12:32 am
Hey,

I have recently got my rmp3, and was wondering how do I get the mp3 songs that are playing on the rmp3, to act as an input to an Arduino module?

I would like to have the songs playing and controlled from my rmp3, and then analysed for frequency on my arduino module to activate different output pins for different frequency pitches?

Thanks

Jenny
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jan 13, 2011, 09:44 am
There is the Visualiser example code featured on the Rogue Robotics website:
http://www.roguerobotics.com/wikidocs/projects/rmp3/spectrum_analyzer_demonstration

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: ItsMeDusty on Jan 13, 2011, 09:30 pm
very cool, i can't wait to get one.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 16, 2011, 10:12 pm
Hey,

Thanks for the reply. From that it seems that I have to use an arduino board. I thought this may be the case.
Will I be able to use any arduino module, and seeing the output bitrates for the music from the rmp3, will I have to use mp3's encoded at a low bitrate so the music can be analysed over the serial port?

Hopefully I can go and start soldering my rmp3 to the nano board, and get my project up and running.

Thanks
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jan 16, 2011, 10:33 pm
Quote
Thanks for the reply. From that it seems that I have to use an arduino board. I thought this may be the case.

You do not have to as all of the rMP3 functions are controlled via serial commands (these can be sent from anything).
The visualiser example however has been coded as an arduino library so it would be easiest to use an arduino.
Quote
Will I be able to use any arduino module

Yes.

Quote
will I have to use mp3's encoded at a low bitrate so the music can be analysed over the serial port?

No, the visualiser example uses the VLSI's in built function to analyse the frequency bands of the audio. The mp3 can be in any bitrate (up to 320kbps)

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jan 16, 2011, 10:36 pm
@jennyc:  You can use any bitrate mp3 (up to and including 320 kbps).  Each time you want a sample of the frequencies, you use the getspectrumanalyzer() method.  You can call this at any time during playback.  So, you can do it as often or as little as you want.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 16, 2011, 11:32 pm
@mowcius Thanks, I already have some code that uses an arduino to analyse an mp3, over usb, when it is all run from an arduino sketch on my laptop. I was going to use the rmp3 to listen to the music on the go, and though I will need to use an arduino module to send the commands over serial then.

The communication between the two should be ok then?

I was going to use the FrequencyEnergy library that comes with the arduino programme, export it to my nano, and where the output display is changing the size of the words, just set the output to set my arduino to set an output to HIGH, to activate a motor.

This should be ok to do, with having the arduino to control the playing of the music on the rmp3, and analysing the mp3 off the sdcard at the same time?

@bhagman As said above, I was going to use the FrequencyEnergy library example that is in the arduino programme. Would using the getspectrumanalyser() method be more useful for my project? Or would doing what I described above be a better method of achieving this?

Thank you very much for your help
Jenny
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jan 17, 2011, 09:44 am
Quote
Would using the getspectrumanalyser() method be more useful for my project?

Yes - this is specific to the rMP3 and takes values directly from the audio (with the VLSI chip).
It will return values to you for the frequencies you have specified and then with a trigger value, if the value (volume on that frequency) goes above the trigger value then it will cause something to happen (light up an LED for example).

Quote
I was going to use the FrequencyEnergy library that comes with the arduino programme

I have not seen this library for arduino - do you mean the one that comes with Processing?
This is completely different and cannot simply be exported for use with arduino.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 17, 2011, 08:10 pm
I think I am starting to see more how this is going to work now.

On the arduino module, I set it to "tell" the rmp3 to getspectrumanalyser(), which will then return a frequency value to my arduino module, and if it is above a certain frequency will trigger and output to a motor.

Can this be used to trigger an action for groups of different ranges of frequencies, a low frequencies group, medium and high? Rather than just if the frequency goes above a set value?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jan 17, 2011, 09:04 pm
Quote
On the arduino module, I set it to "tell" the rmp3 to getspectrumanalyser(), which will then return a frequency value to my arduino module, and if it is above a certain frequency will trigger and output to a motor.

Yes - that's the general idea but it does not return a frequency - it returns a value for the different frequencies you have specified. You can specify up to 23 different frequencies and retreive the values of them

Quote
Can this be used to trigger an action for groups of different ranges of frequencies, a low frequencies group, medium and high? Rather than just if the frequency goes above a set value?

Not quite sure what you mean. Perhaps my comment above addresses this.
You can do whatever you like with the values - You could choose just to analyse low frequencies, high frequencies etc if you wanted.

Mowcius
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 17, 2011, 10:28 pm
Have just been playing with it a bit, and have got a better grasp of how these things talk to eachother. Will go away and read about the getspectrumanalyser() and see where to go from there.

What I was meaning is that if it is a low frequency, the rmp3 will return a value to the arduino that will activate one output, and if it is a mid range frequency, the rmp3 will return another value to the arduino to trigger a different output.

With the aim of having a different output for a different frequency range.

Thanks
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jan 17, 2011, 10:34 pm
Ahh well if you specify a range of low med and high frequencies you can then monitor the values returned and do something if they go over a threshold.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 17, 2011, 11:53 pm
Just been trying to get it even playing an mp3, and it never compiles. Just gets the same error every time.
Code: [Select]
In file included from sketch_jan17a.cpp:1:
C:\Users\Jennifer\Desktop\arduino-0022\libraries\NewSoftSerial/NewSoftSerial.h:32:24: error: SerialBase.h: No such file or directory
In file included from sketch_jan17a.cpp:1:
C:\Users\Jennifer\Desktop\arduino-0022\libraries\NewSoftSerial/NewSoftSerial.h:45: error: expected class-name before '{' token
sketch_jan17a:4: error: no matching function for call to 'RogueMP3::RogueMP3(NewSoftSerial&)'
C:\Users\Jennifer\Desktop\arduino-0022\libraries\RogueMP3/RogueMP3.h:110: note: candidates are: RogueMP3::RogueMP3(Stream&)
C:\Users\Jennifer\Desktop\arduino-0022\libraries\RogueMP3/RogueMP3.h:103: note:                 RogueMP3::RogueMP3(const RogueMP3&)


And I have no idea why it is not working. I have downloaded, and installed the serials library change, and selected the [stream] uno module.

Any ideas what the issue might be?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jan 18, 2011, 04:18 am
@jennyc:  The problem is that you need to use a more recent version of NewSoftSerial.  There are two ways to get a newer version:



Try one of those, and see how it goes.

(it looks like you were using the "SerialBase" version of NewSoftSerial - I know it's confusing - It'll be straightened out soon enough).

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: mowcius on Jan 18, 2011, 09:46 am
With 0022, serial base class is included as standard so you do not need the (stream) versions.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 18, 2011, 11:20 pm
I think I was using the NewSoftSerial library. I downloaded it, and pasted it into the /library/ folder at my arduino location. Is that all I had to do?

I have also since tried it without the stream versions, and still the same error.

I have been told that I may have to check the instantiation? I'm not sure what this is, as I only saw it online in relation to the ump3 device.

When attaching my uno to the rmp3, am I correct in just lining up all the pins and attaching? The activity light flashes for a brief moment on the rmp3, then just goes off, and Windows makes the "hardware plugged in" sound, then the removed sound, while the uno is just loop playing the blink programme that I loaded onto it.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jan 19, 2011, 12:06 am
@jennyc:  Make sure you delete any other versions of NewSoftSerial from your /libraries/ folder (I assume that is what you meant - if not, you need to use that folder instead).  Then use this version of NewSoftSerial:

http://code.google.com/p/rogue-code/downloads/detail?name=NewSoftSerial10c-withMegaAndStream.zip


The start-up sounds right.  Activity LED should flash briefly, then turn off.  Just make sure that the controller board (Uno) is not connected to the computer when you attach the rMP3.  After attaching, plug the rig into your computer.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 19, 2011, 12:09 am
Hooray,

I finally have got it compiled using version 11 of the new software serial. I exported it to my arduino, but cant hear anything. Not sure why, I have the name of the song correct, and its location on the SD card. I think It may be a connection issue between the uno board and the rmp3
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jan 19, 2011, 12:12 am
heh... I just posted some info above.  Glad you got it working!

Can you post the code you're using, or is it one of the examples?

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 19, 2011, 12:22 am
I am just using this:
Code: [Select]
#include <SoftwareSerial.h>

#include <RogueMP3.h>

SoftwareSerial rmp3_serial(6, 7);
RogueMP3 rmp3(rmp3_serial);

void setup()
{
 Serial.begin(9600);
 rmp3_serial.begin(9600);

 rmp3.sync();

 rmp3.playfile("/gold.mp3");
}

void loop()
{
}


Which seems to be on the rmp3 now, just nothing coming out of the headphones. I still have it plugged into my laptop for power just now.

The serial leds on the uno don't seem to be flashing either. I assume that with that code, the mp3 should just play on loop?

I have the mp3 called gold.mp3 on the root and in a subfoler called /mp3/gold.mp3 on the card. I renamed the file to gold.mp3, so i guess it is called gold.mp3.mp3, and tried it without the extra extension, and still no joy?
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jan 19, 2011, 12:36 am
Try this code, and start the Serial Monitor after you upload:

Code: [Select]
#include <SoftwareSerial.h>

#include <RogueMP3.h>

SoftwareSerial rmp3_serial(6, 7);
RogueMP3 rmp3(rmp3_serial);

void setup()
{
 Serial.begin(9600);
 rmp3_serial.begin(9600);

 Serial.println("Starting rMP3");

 rmp3.sync();

 Serial.println("rMP3 Ready");

 rmp3.playfile("/gold.mp3");

 Serial.println("File playing");
}

void loop()
{
}



Let me know what you see in the Serial Monitor.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 19, 2011, 12:45 am
It just hangs at starting mp3. I am correct in having all the pins from the uno jumped to the rmp3? Doing this wont interfere with the two boards talking?

Thank you
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jan 19, 2011, 01:51 am
Does your rMP3 setup look like this:

(http://farm6.static.flickr.com/5247/5368720616_cafb6f0841.jpg) (http://www.flickr.com/photos/roguerobotics/5368720616/)

or do you have an rMP3 without pins?

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 19, 2011, 02:11 am
Very similar. I couldn't get mine with the pins, so I have used my own. But I think I have got the same set up with them
(http://img233.imageshack.us/img233/5701/rmp3.jpg) (http://img233.imageshack.us/i/rmp3.jpg/)

With the usb from the uno going to my laptop.
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jan 19, 2011, 03:14 am
Try this sketch, and tell me what you see in the Serial Monitor:

Code: [Select]
// Autobaud detect for rMP3/uMP3/uMMC
// Copyright 2011 Brett Hagman
// Rogue Robotics
// http://www.roguerobotics.com/

#include <SoftwareSerial.h>

SoftwareSerial rmp3_serial(6, 7);


int16_t read_timeout(uint32_t timeout)
{
 uint32_t start = millis();

 while ((millis() - start) < timeout)
 {
   if (rmp3_serial.available())
     return (uint8_t) rmp3_serial.read();
 }

 return -1;
}


boolean testbps(uint32_t bps)
{
 rmp3_serial.begin(bps);
 rmp3_serial.write(0x1b);  // send ESC
 if (read_timeout(100) == '>')
   return true;
 else
   return false;
}


void setup(void)
{
 uint32_t bps[] = { 2400, 4800, 9600, 19200, 38400, 57600, 115200 };
 uint8_t i;

 Serial.begin(9600);

 Serial.println("Started");

 for (i = 0; i < sizeof(bps)/sizeof(uint32_t); i++)
 {
   Serial.print("Trying: ");
   Serial.print(bps[i], DEC);
   if (testbps(bps[i]))
   {
     Serial.println(" YES!");
     break;
   }
   else
   {
     Serial.println(" No");
   }
 }

 // now set new bps
 
 // rmp3_serial.print("ST D 4\r");
}

void loop(void)
{
}


b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 19, 2011, 03:20 am
Returns "no" for all of them 2400-115200
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jan 19, 2011, 03:30 am
Double check pins 6 and 7 at the rMP3 - make sure they are soldered well.  Resolder them, if need be, and try again.

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 19, 2011, 03:37 am
Is it just those to pins that need to be soldered down? Or am I ok to have all of them soldered to the same pin on the uno board?

I don't have access to my soldering iron at the moment, will be back with it tomorrow. I will double check 6&7 ?and the rest? of the pins, and will let you know how it works from there.

Thank you for your help

Jenny
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jan 19, 2011, 03:42 am
No problem!

Yeah, just need to make sure 5V, Ground (GND), and pins 6 and 7 are well soldered.  Those are the only pins that are used.  If you have the pins soldered, it's just as good - just more work. :)

b
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 19, 2011, 03:53 pm
Turns out that was the problem.

Its working now. =D Thank you very much.

Away off to read about using the getspectrumanalyser() to get the rmp3 giving the arduino a value, so that an output can be created depending on the value. That sound about right?

Thanks again
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: jennyc on Jan 21, 2011, 03:44 pm
Hi

edit::

Sorry, I have just looked back and seen that I pasted the wrong code, I just pasted yours, oops.

I was using your code as a base for mine.

I think I have got to a point where it should be analysing the code, but I am not sure as to what each part of your original code actually does. I have tried to edit it with the code to play from the folder /mp3/ and the audio is not playing, but have had a version where it did only play my song gold.mp3.

From what I can tell from your code, mine should now be analysing for 3 different bands, and sending it back to the arduino. My problem is now, I am not sure how to change this from the lcd output, to just have a different arduino output turned "on" when each frequency returned.
Code: [Select]
#include <SoftwareSerial.h>
#include <RogueMP3.h>
#include <RogueSD.h>

SoftwareSerial rmp3_s(6, 7);

RogueMP3 rmp3(rmp3_s);
RogueSD filecommands(rmp3_s);

uint16_t bandfreqs[] = {  120,  2000,  20000 };

uint16_t numfiles = 0;

#define MP3PATH "/mp3/"
// you need to put the two double quotes ("") in the middle below,
// because the Arduino IDE looks for unclosed comments.
#define MP3FILTER "/mp3/""*.mp3"


void doFREQSpec(void)
{
 // prepare for up to 3 bands
 uint8_t v[3];

 rmp3.getspectrumanalyzer(v);

}

void setup(void)
{
 Serial.begin(9600);
 Serial.println("Started");
 Serial.println("Starting sync");
 rmp3.sync();
 filecommands.sync();
 Serial.println("Done sync");
 
}


void playTrack(void)
{
 char mp3path[128];

// ...

 rmp3.playfile(mp3path);

 rmp3.setspectrumanalyzer(bandfreqs, 10);

 Serial.println("Playing");
}

void loop(void)
{
 
}


Currently my code is stuck on the syncing. I will keep trying to get this working with the folder, but as a failsafe, I have it working with a single track.

Is there a specific part of the documentation that I can read, or a direction you can point me in on how to translate this back to an arduino output?

Thanks

Jenny
Title: Re: * MP3 Shield * - Rogue Robotics rMP3
Post by: bhagman on Jan 22, 2011, 04:01 am
@jennyc:  Here is an example I wrote.  In my case, I am using a LEDHead (http://www.roguerobotics.com/products/electronics/ledhead) with LEDs to display output.

Code: [Select]
#include <RogueMP3.h>
#include <NewSoftSerial.h>

NewSoftSerial rmp3_s(6, 7);

RogueMP3 rmp3(rmp3_s);

#define numberOfBands 3
uint16_t bandfreqs[] = { 120, 2000, 20000 };
//uint8_t outputPin[] = { 2, 3, 4 };
uint8_t outputPin[] = { 29, 30, 31 };

#define THRESHOLD 12

#define songname "/001.mp3"


void checkFrequencies(void)
{
 // prepare for up to 23 bands
 uint8_t v[23];

 rmp3.getspectrumanalyzer(v);

 for (uint8_t i=0; i<numberOfBands; i++)
 {
   if (v[i] > THRESHOLD)
     digitalWrite(outputPin[i], HIGH);
   else
     digitalWrite(outputPin[i], LOW);
 }
}


void setup(void)
{
 Serial.begin(9600);
 Serial.println("Started");

 rmp3_s.begin(9600);

 for (uint8_t i = 0; i < numberOfBands; i++)
   pinMode(outputPin[i], OUTPUT);

 Serial.println("Starting sync");
 rmp3.sync();
 Serial.println("Done sync");
}


void playTrack(void)
{
 Serial.println("Playing Track");

 rmp3.playfile(songname);

 rmp3.setspectrumanalyzer(bandfreqs, numberOfBands);
}

int8_t isPlaying(void)
{
 return (rmp3.getplaybackstatus() == 'P' ? 1 : 0);
}


void loop(void)
{
 if (!isPlaying())
   playTrack();

 checkFrequencies();
}


You'll definitely have to have different thresholds for each band, since they will have different responses.

b