I stumbled across the Python winsound module today. It is a standard library on Windows machines and it has a function for controlling the PC speaker. Harf.
Hear it play the music from Close Encounters of a Third Kind from a list of frequencies and durations:
import winsound
from winsound import *
music=((784,1),(880,1),(698,1),(349,1),(523,3))
for x in music:
Beep(x[0],550*x[1])
A list of frequencies and durations is a simple, computational form of musical notation.
Recent comments
11 weeks 3 days ago
1 year 23 weeks ago
1 year 23 weeks ago
1 year 23 weeks ago
1 year 23 weeks ago
1 year 23 weeks ago
1 year 23 weeks ago
1 year 23 weeks ago
1 year 23 weeks ago
1 year 24 weeks ago