Using Raspberry Pi's PWM output to generate tones and melodies