Here’s a fairly inexpensive ($30–$40) project that uses a microprocessor to generate a constant stream of random but pleasant-sounding music. A Microchip PIC16F685 generates 5 square waves that are amplified and combined to play on a small speaker. A lookup table in the software stores chord progressions common in Western music. As the music runs from chord to chord, 3 oscillators play the chord itself, 1 plays a tonic-dominant (1-5) bass pattern, and 1 plays random notes from the underlying scale as a melody. Potentiometers adjust how much of each component (chord, bass, and melody) is mixed into the final output. To keep the beat, the microcontroller also generates output for driving a servomotor to strike a drum or equivalent.