Back in the early days of the musical synthesizer, some designers who wished for polyphony in their instruments would simply build multiple tone-generators for as many notes as they wished to play. [Kevin] took that same approach with his Arduino orchestra, and set about having it play the closing number from Star Wars: A New Hope.
The build consists of twelve Arduino Nanos, each wired up to power, a speaker, and the same MIDI cable. The MIDI cable carries note data for each Arduino on a separate MIDI channel, allowing each to play its own role in the orchestra. [Kevin] then set about arranging the Star Wars music into a MIDI file suitable for the Arduinos, roughly setting six voices to high parts and six voices low. The Arduinos play the notes received using the simple tone() function. The result is a very chiptune rendition of the end of the fourth episode of the world’s most famous space opera.
It may not be neat, tidy, or efficient, but it certainly is fun. Twelve Arduinos bleeping away with their flashing LEDs and cute little speakers makes quite the conversation piece. It’s a similar approach to the Floppotron, which plays more notes by adding more floppy drives. We’ve also seen the same thing done with SEGA sound chips. Video after the break.
This is very nice, and pretty encouraging.
I’ve been trying to almost the same thing, except 4 Arduino nanos running Mozzie for PWM-based synthesis and then mixing their signals together for a single output. Biggest issue right now is that half my bootleg nanos don’t seem to be compatible with Mozzie for some reason.
I don’t know if I have the answer for you, but there are a number of other articles on my diyelectromusic blog that use Arduino Nano’s and Mozzi, so it might be worth a look?
I’ve not had any issues running it on any of them though, so I wonder what your issue is…
Kevin
Cool. Sometimes just the concept is nice to see and easier to understand when kept simple. Optimization isn’t always necessary.
It was a key goal to go back to the “roots” of my blog – the first post a year ago was just an Arduino, potentiometer and speaker, and I’ve tried to keep a range of “beginner” posts on there alongside everything else ever since.
Kevin
Sounds kind a like the original arcade game: https://www.youtube.com/watch?v=PzGWEYCRA0w
Yes, I must admit I thought the same thing when I first played it through the Arduinos! It conjured up visions of vector graphics and probably too much time spent sitting in those large surround cabinets.
“The force will be with you… Always…”
(I was also tempted to add R2-D2 at the appropriate point in the throne room sequence… I’d be very happy to go back and add it in if someone wants to buy me an Arp 2600…)
Kevin
Sounds very square-wavey = loads of odd harmonics. There was a really nice solution in the Epyx Handy (Atari Lynx), which was a 65C02. I don’t recall exactly how it was done, but something like several digital bits out being summed (or low-pass filtered) in analog and the outputs were weighted in amplitude with resistors? Anyway, interesting. Also Don Lancaster’s “magic sinewaves” are something like that. https://www.tinaja.com/magsn01.shtml http://www.enginuitysystems.com/files/msinexec%20%28Magic%20Sinewaves%29.pdf
It sounds very square-wavey as it is totally square-wavey :)
The Arudino tone() function is about the simplest method possible of getting some noise out of your microcontroller – it is just turning the IO pins on and off at audio frequencies. Nothing more, nothing less. In this case there isn’t even any removal of the DC bias of the signal before sending to the speaker.
There are a number of options for further filtering, and there are alternative means of sound generation in the first place e.g. direct digital synthesis either out to PWM, using a R2R ladder, or over one of the serial buses to an external DAC – all of which get covered at some point on my blog, but the point here was to return to the original, simplest method of audio, one year on, just for the fun of it.
Aside, “magic sinewaves” seem to suggest they are only useful up to 400Hz. That isn’t even a “concert A”, so I’d imagine that whilst they look like an interesting technique, they probably aren’t particularly suitable for audio.
Kevin
Knowing Don, he was testing on an Apple II.
Here is a place to start on how to eliminate odd harmonics in a pulse width generated tone. “Harmonic Elimination” is the method. A program to generate a list of pulses for each note in the scale would be perfect. http://web.eecs.utk.edu/~tolbert/publications/trans_pe_mar_2004_complete.pdf
Takes me back to my 8 bit (R2R -> LPF -> 741 op amp) centronix parallel printer port audio card solution for a 10MHz PC AT. Perhaps something similar could be used on each nano to allow polyphony.
There are a number of techniques that would allow polyphony. The most niche example I’ve managed so far was getting 12-note polyphony from a single Arduino, but it is hard to keep in tune :)
Three-note polyphony per Arduino is relatively straight forward as the ATmega328 has three timers you can use to output three tone()s. But you’d need three speakers per Arduino (or start mixing outputs). For some further thoughts, see this previous Hackaday post about another of my projects – https://hackaday.com/2021/02/19/12-note-polyphony-on-an-arduino-synth/
But the idea in this one was to go back to basics and see what could be done from that starting point :)
Kevin
Great DIY I guess you could accomplish the same with Robertsonics WAV trigger (https://robertsonics.com/)
If you’re happy to start using shields, then there are a number of very cheap VS1053 based shields out there that will decode MP3, WAV and MIDI files and do a lot more than output simple square wave tones like this.
The VS1053 also has a built in “real-time MIDI mode” you can enable which turns it into a full polyphonic General MIDI synth module which can be driven over the built-in UART or SPI. If you want to know more about that kind of thing, look under the “VS1053” tag on my blog.
Kevin