Forums > MaxMSP

tempo to samples conversion?


mcQ
November 8, 2010 | 11:49 pm

I’m using Max as a host and REAPER as a slave right now, and I’m trying use a "position $1" message to set the start position in REAPER, but I dont know a proper tempo to samples conversion method.
As an example, if I have REAPER’s tempo set to 60, and I have a song thats 4 beats long and I want to set the song to start on beat 3, what conversion method would I use?

Thanks.


November 9, 2010 | 12:58 am

The duration of 1 beat is 60/BPM seconds.
The number of samples per second is defined by the sample rate SR.
So the number of samples per beat is (60/BPM)*SR.

Example: BPM=120, SR=44100.

(60/120)*44100 = 22050 samples per beat.


November 9, 2010 | 12:58 am

Look at the translate object


November 9, 2010 | 12:29 pm

Note however that translate doesn’t calculate the samples.
But you can translate beat to ms and then multiply with sample rate (in kHz).


November 9, 2010 | 4:22 pm

Yeah translate has samples as both input and output format options.

-A


November 9, 2010 | 7:40 pm

Oops, my bad! Thanks for clarifying.


November 9, 2010 | 7:42 pm

There’s a bug in it though. It only works at 44.1k SR in Max 5.x. The bug is one of those nasty "but we have to rewrite the whole way MSP works in order to fix it" type things. Hopefully it will get some love for the next major revision.

-A


Viewing 7 posts - 1 through 7 (of 7 total)