views:

58

answers:

2

Hi, i'am looking for a way to attune a song to the heart rate of someone. I have a song in mp3 or wav format and i want to accelerate the speed of it while playing it. Or playing it in loop and between each loop accelerate it or slow it. Ideally it will be in python. Do you know a way to do that ?

Regards and thanks.

Bussiere

+1  A: 

There are a few different pieces here, each of which needs to be solved. None of them are trivial and require a decent amount of signal processing knowledge, so you'll probably want to look for libraries to handle that part of the heavy lifting.

  1. Cardiac beat detection. This is outside my area of knowledge, but let's assume that you can access this somehow.

  2. Music beat detection There are several libraries available for this, both commercial and open source. You may want to look at http://aubio.org/ -- it already has python bindings available.

  3. Tempo Change -- Once you know the target BPM and the current BPM, you need another library that can be used to change the tempo of your audio track to match (without changing the pitch). A few to look at are Rubber Band and SoundTouch

Googling will find other libraries for these manipulations (and other pieces that you'll need, something like PyMedia to open and playback the sounds, etc.)

bgporter
+1  A: 

Hi --maybe one piece of software that can allow you to control the tempo of some ongoing audio using another input is "Puredata" --

It is a very complete, although complicated, node based software aimed to deal with various multimidia transformations from visual node connections - but it can also be programed through a Python API

http://crca.ucsd.edu/~msp/Pd_documentation/index.htm

Python bindings:

http://mccormick.cx/projects/PyPd/

jsbueno