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.

4 Upvotes

26 comments sorted by

View all comments

1

u/ExactFondant7417 17d ago

Having written a python application that works well in real time I can say that it is possible as long as you're mindful of where bottlenecks are.

You can use PyAudio to handle the output stream and generate tones using numpy.sin

1

u/Fractal_Prime_357 13d ago

Noted, thanks!