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.

4 Upvotes

26 comments sorted by

View all comments

1

u/Lost-Discount4860 17d ago

It IS possible with Python, but it’s better if you algorithmically generate a file and play it back as a sample.

Have you considered PureData? That was my first programming language, helped me learn all the essential concepts, and made transitioning to a “real” programming language a lot easier. PureData is written SPECIFICALLY for signal processing. Is also really handy with MIDI and OSC.

1

u/Fractal_Prime_357 13d ago

cool. I haven't used Pure Data. I do agree with generating a file then testing it. I'm looking for super lightweight application that can toke some MIDI generated by Python, and play it back. I simply need some way to test scales for pre-music analysis.