Go Down

Topic: Making two arduinos play different parts of a song in tandem? (Read 350 times) previous topic - next topic

FiveTomb

Hey guys, first post here. I have two arduino unos that I want to connect in order to play a song. One arduino plays the bass notes while the other plays the melody. Any ideas on how I would go about it?

Sorry if this is on the wrong board, haven't done too much digging.

Thanks!

vaj4088

You are on the right board, but this board works best if you properly post your code and ask for help in fixing it or improving it.

If you want code written for you, go to Gigs and Collaborations and bring your wallet.


jimLee

Make them do the -exact- same thing. Read some file of music (Your choice) and play the notes. Then, have one Arduino start, and when it does, have it toggle a wire to the other Arduino to tell it to start playing its file. (And that file has the "other" notes.)

Then when you want 3 Arduinos, just give the third its file of notes and hook it to the same "start" wire.

Then a 4th..

-jim lee
PNW Ardiuno & Maker club
1012 9Th Street, Anacortes, WA 98221 (Around the back of building)
Contact jimLee or Naneen for more info

FiveTomb


FiveTomb

Hey guys, I'm completely new to the Arduino platform and I have an issue. I need two UNOs to execute their commands at the exact same time. How would I go about about doing this?

Thanks for the help!

Groove

They'd have to be running off the same clock.
Per Arduino ad Astra

Paul_KD7HB

Hey guys, I'm completely new to the Arduino platform and I have an issue. I need two UNOs to execute their commands at the exact same time. How would I go about about doing this?

Thanks for the help!
Define "commands". Do you mean instruction or do you mean something telling the Arduinos to do something?

Paul

jurs

Hey guys, I'm completely new to the Arduino platform and I have an issue. I need two UNOs to execute their commands at the exact same time.
What is the technical meaning of "exact same time"?

Do you mean "same second? Or same millisecond? Or same microsecond?

And what is "their commands", in case you describe that term a bit more datailed?

FiveTomb

What is the technical meaning of "exact same time"?

Do you mean "same second? Or same millisecond? Or same microsecond?

And what is "their commands", in case you describe that term a bit more datailed?
The commands that I'm giving them is to play a melody. More specifically, the song of storms. I have one arduino playing the higher melody notes, and the other is playing the bass notes. Each is connected to a piezo speaker. I need them to start playing their parts at the exact same time. 

Groove

Can you perceive a 20 or 30 microsecond time difference?
Per Arduino ad Astra

FiveTomb

Can you perceive a 20 or 30 microsecond time difference?
Definitely what I was thinking of doing. But for some reason the professor wants us to use two arduinos and two separate speakers.

Paul_KD7HB

The commands that I'm giving them is to play a melody. More specifically, the song of storms. I have one arduino playing the higher melody notes, and the other is playing the bass notes. Each is connected to a piezo speaker. I need them to start playing their parts at the exact same time. 
Starting at the exact time might be arranged by making them wait for a signal from the same push button. DPST switch, or similar. The two will certainly not stay together for very long unless both boards use the same clock signals.

Can these Arduinos be placed right next to each other?

Paul

el_supremo

Don't send me technical questions via Private Message.

Grumpy_Mike

Quote
But for some reason the professor wants us to use two arduinos and two separate speakers.
Is this a professor of electronics or music?
He sounds like it is music and has no idea about electronics.

Robin2

If the two Arduinos are close together it should be possible to link two I/O pins so that one Arduino can send a "metronome" signal to the other (perhaps once per second) and the receiving Arduino can use that to correct any drift in the value of millis().

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Go Up