TVarmy
TVarmy

Reputation: 75

What's a good way to examine audio with python and split it between high, mid and low pitches for visualizaton?

So, I'm planning on trying out making a light organ with an Arduino and Python, communicating over serial to control the brightness of several LEDs. The computer will use the microphone or a playing MP3 to generate the data.

I'm not so sure how to handle the audio processing. What's a good option for python that can take either a playing audio file or microphone data (I'd prefer the microphone), and then split it into different frequency ranges and write the intensity to variables? Do I need to worry about overtones if I use the microphone?

Upvotes: 5

Views: 2034

Answers (3)

bgporter
bgporter

Reputation: 36454

If you're not committed to using Python, you should also look at using PureData (PD) to handle the audio analysis. Interfacing PD to the Arduino is already a solved problem, and there are a lot of pre-existing components that make working with audio easy.

Upvotes: 1

Russell Borogove
Russell Borogove

Reputation: 19037

Portaudio has a Python interface that would let you read data off the microphone.

For the band splitting, you could use something like a band-pass filter feeding into an envelope follower -- one filter+follower for each frequency band of interest.

Upvotes: 0

patrickmdnet
patrickmdnet

Reputation: 3392

Try http://wiki.python.org/moin/Audio for links to various Python audio processing packages.

The audioop package has some basic waveform manipulation functions.

See also:

Upvotes: 0

Related Questions