Python, Signal Processing, Music, Editors Pick, Hands On Tutorials.
and make a sound wave. The code here is quite similar, just expanded to 88 keys instead of a single octave: The function above returns a dictionary that maps a note name to corresponding frequency in hertz. Now we want to make a wave of middle C: Here duration is in number of seconds, sample rate