Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
Want to improve this question?
Update the question so it focuses on one problem only by
editing this post
.
Closed
4 years ago
.
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
–
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.
Cardiac beat detection
. This is outside my area of knowledge, but let's assume that you can access this somehow.
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.
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.)
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/