Making music
Tnadz
Posts: 14
Hello all. I'm making a robot for my art class that will sit on the floor or some raised structure and monitor its surrounding to see if anyone is standing nearby (using Ultrasonic sensors). If no one is within a certain distance, let's say 5ft, it will play music, dance, and do a little light show using LEDs. The dancing will probably just be a sequence of spinning and a few forward and backwards commands. At certain intervals the bot will stop briefly and check to make sure no one is nearby with the music and light show still going. If someone is there it will stop cold until they leave, possibly while making some sort of small frightened animal noises.
To get a visual, I'm going to use a piece of plywood for the base with a large colander on top which will have LEDS, the Ultrasonic sensors and a hairy lattice on top. Basically a 1ft diameter hairy hemisphere.
Now, my main question is, how can I get it to play sound (ie possible code or pseudo code as well as the physical process)? I know that's a big question but here's what I got. My instructor suggested using a Radio Shack mini solid state sound memory good for 20secs of sound. I want to record an mp3 onto the relay to be activated by the stamp. Then the relay could send the signal to an amped speaker (like a computer desktop speaker). In case I can't get a hold of one of these relays, does anyone have any suggestions for making this process better? easier? cheaper even?
Aside from that I think I've got most of the work figured out but if anyone could offer other suggestions or ideas for me I will gladly take them.
Some other things that might be useful. I'm going to use a 12V 7HA SLA battery with two of these wheels http://www.solutions-cubed.com/solutions cubed/EZR2003.htm driven by two 35RPM motors (controlled by a motor controller) and casters to provide skid steering.
I only have about 4 weeks to see this project realized so I need to get work done as quick as possible. I thank you all for any and all help. PS - I'm a bit of a noob but I can pick up on things pretty fast.
EDIT: The DC motors come with the wheels which are 200RPM 12V motors that run on relatively low amps.
Post Edited (Tnadz) : 2/5/2007 11:22:34 PM GMT
To get a visual, I'm going to use a piece of plywood for the base with a large colander on top which will have LEDS, the Ultrasonic sensors and a hairy lattice on top. Basically a 1ft diameter hairy hemisphere.
Now, my main question is, how can I get it to play sound (ie possible code or pseudo code as well as the physical process)? I know that's a big question but here's what I got. My instructor suggested using a Radio Shack mini solid state sound memory good for 20secs of sound. I want to record an mp3 onto the relay to be activated by the stamp. Then the relay could send the signal to an amped speaker (like a computer desktop speaker). In case I can't get a hold of one of these relays, does anyone have any suggestions for making this process better? easier? cheaper even?
Aside from that I think I've got most of the work figured out but if anyone could offer other suggestions or ideas for me I will gladly take them.
Some other things that might be useful. I'm going to use a 12V 7HA SLA battery with two of these wheels http://www.solutions-cubed.com/solutions cubed/EZR2003.htm driven by two 35RPM motors (controlled by a motor controller) and casters to provide skid steering.
I only have about 4 weeks to see this project realized so I need to get work done as quick as possible. I thank you all for any and all help. PS - I'm a bit of a noob but I can pick up on things pretty fast.
EDIT: The DC motors come with the wheels which are 200RPM 12V motors that run on relatively low amps.
Post Edited (Tnadz) : 2/5/2007 11:22:34 PM GMT
Comments
- do you want to mathematially generate music from scores (and sound effects?) -- a la ringtone and cheap video games.
pros: cheeeeeeeap, clean, easy to integrate other programming (like LEDs) into each note as it is played
cons: tedious scoring and coding process, sounds like ringtones, mono
- do you want prerecorded mp3s or wav files?
pros: sounds nice, stereo
cons: much trickier to program and/or adds hardware costs (there are micro controlled mp3 players out there as well as cards that let you pre-record files for micro controlled playback -- also having a host PC program use it's own player/soundcard in response to serial commands from the Stamp could be an option)
- midi?
pros: sounds nice, stereo, cheap
cons: tricky programming
There is a circuit in the Stamp Manual under FREQOUT for hooking up a 40ohm speaker with just a few capacitors. This probably won't cover the volume needs for your exhibit, but it's a quick and cheap way to get some audio out and see how it sounds before worrying about amplification per se.
Then checkout "What's a Microcontroller" from Parallax which has a great discussion of generating musical scores and ringtones from a Stamp:
www.parallax.com/dl/docs/books/edu/Wamv2_2.pdf
Also this thread has a revision of the above music score engine that is a bit easier on the variable requirements:
http://forums.parallax.com/showthread.php?p=619826
This thread has two postings of Stamp code with pretty interesting "R2D2" type sound effects that are nice way to get started in perhaps constructing your own mathematical sound effects:
http://forums.parallax.com/showthread.php?p=582602
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Synching the lights with the sound won't be an issue right now because I just want them both to work, first separately, and then if I have time at the end, I can easily whip up code to make it look like the lights are going in time with the music. I know this is inefficent but I don't know if I can afford the time to mess around otherwise. Unless, of course, I find something real simple and affordable that will work.
I ideally would like to have the "player" separate from my computer, similar to the way you can download BSP files straight from the computer via USB or Serial to the stamp, and then have the stamp process the code separate from the computer. I don't know exactly how I'll do this because I don't really know what's out there and it's very difficult to get an idea of the range of options I have while just searching through various sites. Hopefully that helps
Above is a micro controlled mp3 player. You load mp3 files onto an SD data card, then put the card into the device. A Stamp can playback files when you want, control volume, etc.
Also, some former Parallax employees offer an audio module that plays back 8 pre-recorded sounds under micro control: www.efx-tek.com/topics/ap-8.html
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
$99 is a bit much but having a card reader alone on your Stamp is pretty cool. The cheapest route, btw, would be to write an applet for a host PC (laptop?) and have the Stamp send commands to the applet via SEROUT and the RS-232 port, but that requires a knowledge of PC programming and techniques.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
Certainly not as impressive as the playback module but it gets the job done in a much more affordable fashion.
However, I'm probably going to go with the module instead. Seeya $100.
Post Edited (Tnadz) : 2/6/2007 7:08:32 PM GMT
Sounds like a computer sound though.
http://www.soundgin.com
I ordered one of these after reading the review in servo magazine. Its pretty sweet. Check out the sounds it can make here.
Harkens back to the 80's and the sid player songs that were making the rounds on BBS systems.. hmm maybe showing my age a bit here..
Vern
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔