Go Down

Topic: * MP3 Shield * - Rogue Robotics rMP3 (Read 48508 times) previous topic - next topic

Dustin C

very cool, i can't wait to get one.

jennyc

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

mowcius

#152
Jan 16, 2011, 10:33 pm Last Edit: Feb 09, 2011, 12:36 pm by mowcius Reason: 1
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

@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

jennyc

@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

mowcius

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

jennyc

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?

mowcius

#157
Jan 17, 2011, 09:04 pm Last Edit: Jan 17, 2011, 09:05 pm by mowcius Reason: 1
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

jennyc

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

mowcius

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.

jennyc

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?

@jennyc:  The problem is that you need to use a more recent version of NewSoftSerial.  There are two ways to get a newer version:

  • http://arduiniana.org/2011/01/newsoftserial-11-beta/ - latest beta version from Mikal's site
  • or from http://code.google.com/p/rogue-code/downloads/detail?name=NewSoftSerial10c-withMegaAndStream.zip - A modified 10c version I did a while ago.


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

mowcius

With 0022, serial base class is included as standard so you do not need the (stream) versions.

jennyc

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.

#164
Jan 19, 2011, 12:06 am Last Edit: Jan 19, 2011, 12:08 am by bhagman Reason: 1
@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

Go Up