Jump to latest, useful version in this thread: viewtopic.php?f=193&t=61306#p370811
Original prototype below
------
When a green signal of 1 comes in from the bottom right, the song will be loaded from the combinators on the left and start playing! When the green signal goes to zero, the clock resets.
I'm not the best at this, so it is not super optimized. If anyone cares to improve it, please do so, and let me know so I can make mine better too!
The blueprint I've attached is what I've been using to play (an off-key) Twinkle Twinkle Little Star whenever a rocket is launched at my base.
You get one note per signal (with Fish and Green being reserved for Clock and Play respectively), so tunes can be quite long although you'll need multiple constant combinators on the left side for longer tunes.
I hope people with more musical talent will take advantage of this to write or translate better songs and post them.
With two or more copies of the system, more instruments and chords can be used as well.
blueprint string
Detailed explanation:Song Constants: High bits of the signal = timing. Low bits = pitch.
Clock adds Green and multiplies by Green, so 0=reset and 1=Play
The clock is bitshifted up to the same position as the timing bits to simplify the memory cell.
Memory cell forgets each note as the clock passes it, and on that last cycle before getting dropped, the note is passed on to the output.
Output block filters out the timing bits, leaving only the pitch bits, and combines them all down to Green signal.
Green signal then gets played on the speaker. [/spoiler]
See the latest here: