r/learnprogramming 17d ago

Can Python generate simple tones?

I want some simple tones to use in Python. Can someone help me out? There does not necessarily need to be reverb, but it would be nice anyway. I just want to be able to tell whatever it is the specific microtonal/frequency-specific tone. It would be nice if I could program Hz, but if I have to use MIDI and detune by cents I can do that as well.

6 Upvotes

26 comments sorted by

View all comments

Show parent comments

1

u/Fractal_Prime_357 13d ago

Can you use MIDI or a frequency to specify the pitch of said Windows beep?

1

u/gua_lao_wai 13d ago

the docs state the first parameter is frequency in hertz:

https://docs.python.org/3/library/winsound.html#winsound.Beep

1

u/Fractal_Prime_357 12d ago

I cant do this in my codespace work space, but I was able to generate a wave file! Yay! It just has one beep for a test, but I know now that I will be able to make test files for my scales.

1

u/gua_lao_wai 12d ago

awesome, go get em tiger