Here is the simplest melody generator circuit you can make using an IC.The UM66 series are CMOS IC’s designed for using in calling bell, phone and toys. It has a built in ROM programmed for playing music. The device has very low power consumption.Thanks for the CMOS technology.The melody will be available at pin3 of UM66 and here it is amplified by using Q1 to drive the speaker.Resistor R1 limits the base current of Q1 within the safe values.Capacitor C1 is meant for noise suppression.