Super Complicated Code (playing music and moving servos at the same time)

Hey all! I'm trying to make a present for a friend and it's not working out at all :( (due this tuesday).

So I ripped up a teddy bear, put some servos in it's arm, and a speaker in it's stomach. I'm trying to use my arduino uno to play tunes over the speaker while make it's arms wobble. My problem is that the song contains delays for getting the notes on beat, which means that I can't have other things going on at once. Is there anything else I can do? I'm stuck with just making it's arms move, then having the tunes play while the arms are still, then having them move again.

Now I did figure out a method to get the servos to move without using a delay function. That's at the very bottom void move(); I know it's probably about the worst way to make servos move slowly without delay but it works. I'm not worried about that. I'm just wondering how am I going to play music and have the servos move at the same time? Thanks!

Here's my code.

http://www.mediafire.com/view/d67t8w4t64www47/sketch_dec06a.ino

(for some reason when i copy the code into the forum it messes it up)

(for some reason when i copy the code into the forum it messes it up)

Did you try using the "code tags" to put the code in a code box?

Have you looked at the blink without delay and several things at once examples?

This is the link for the demo several things at a time

...R

Yes I've looked at blink without delay. I have no idea how to put that into a song.

Any other replies? None of the above is helpful. . .

Sluice: Yes I've looked at blink without delay. I have no idea how to put that into a song.

Any other replies? None of the above is helpful. . .

I don't know anything about songs (apart from listening to them) but I do know a little about BWoD.

You DON'T "put it into a song".

As far as the Arduino is concerned a song is a series of bytes of data that are moved from X to Y at regular intervals.

Use the BWoD technique to manage the intervals for sending the data and within those intervals the Arduino can update the required position for the servo.

There really isn't any other way to play the song and do another thing at the same time.

...R