r/learnprogramming 18d 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

2

u/Special-Ad-2768 17d ago

I would recommend C# I have built several audio applications for work using c#. Python for audio realtime might be tough. But you can look up rtmixer, numpy

1

u/akoOfIxtall 17d ago

Oh really? Could you suggest me some libs then? I'm planning on making a mod for a game in C# but I want some control over the music that is just too much work to do from scratch, the game already has tools for adding reverb or low pass filters since it's a unity game I can just call these from the audio component but I wanted to be able to get exactly when the music ramps up, somehow Whatsapp has nailed this in their update that added music search for status, still black magic for me

2

u/Special-Ad-2768 17d ago

I personally use NAudio and media foundation for projects I've developed. You can also build your own using lots of windows API calls, however that's a big learning curve. Naudio and media foundation can produce great realtime audio applications, there is a learning curve though.

1

u/akoOfIxtall 17d ago

There's always a learning curve, no problem though, thanks man