Forums > MaxMSP

Millisecond to BPM conversion

January 12, 2008 | 11:39 am

Hey everyone!
I’ve made a 16 step sequencer where the tempo is controlled in milliseconds.
I want to change this to BPM but I don’t know the equation to do so.
If anyone can help, please do!
thanks a lot,


January 12, 2008 | 12:00 pm

not sure if this is entirely accurate, but it works…

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 167 191 61 196617 BPM;
#P number 167 173 83 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 167 144 47 196617 * 1000.;
#P newex 167 119 37 196617 !/ 60.;
#P number 167 91 78 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 167 74 61 196617 milliseconds;
#P connect 3 0 4 0;
#P connect 2 0 3 0;
#P connect 1 0 2 0;
#P window clipboard copycount 6;

On 12/01/2008, Ross Malone wrote:
>
>
> Hey everyone!
> I’ve made a 16 step sequencer where the tempo is controlled in
> milliseconds.
> I want to change this to BPM but I don’t know the equation to do so.
> If anyone can help, please do!
> thanks a lot,
>


January 12, 2008 | 12:07 pm

Thanks!
Is this the calculation for an entire bar?
If so, If i multiply my millisecond metro by 16 and put it into the patch, it should work?
Thanks again


January 12, 2008 | 1:35 pm

It calculates the metro interval into single beats per minute. If your metro
is ticking every 500 milliseconds, then that is 120 beats per minute.
(though for some reason it rounds it down to 119, you might need to try
putting a float number box at the end of that, will probably give you 120)

On 12/01/2008, Ross Malone wrote:
>
>
> Thanks!
> Is this the calculation for an entire bar?
> If so, If i multiply my millisecond metro by 16 and put it into the patch,
> it should work?
> Thanks again
>


January 12, 2008 | 1:50 pm

!/ 60000.


January 12, 2008 | 3:04 pm

There are some rounding errors in your patch. Try this.

#P window setfont "Sans Serif" 9.;
#P window linecount 1;
#P comment 206 253 61 196617 BPM;
#P number 206 235 83 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 187 197 27 196617 + 0.5;
#P flonum 264 173 87 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 263 90 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 113 253 61 196617 BPM;
#P number 113 235 83 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 167 145 47 196617 * 1000.;
#P newex 167 119 37 196617 !/ 60.;
#P number 167 91 78 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P comment 167 74 61 196617 milliseconds;
#P connect 8 0 9 0;
#P connect 3 0 4 0;
#P connect 3 0 8 0;
#P connect 3 0 7 0;
#P connect 6 0 2 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P window clipboard copycount 11;

On 1/12/08 7:00 AM, "Joe Bicker" wrote:

> not sure if this is entirely accurate, but it works…
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P comment 167 191 61 196617 BPM;
> #P number 167 173 83 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 167 144 47 196617 * 1000.;
> #P newex 167 119 37 196617 !/ 60.;
> #P number 167 91 78 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P comment 167 74 61 196617 milliseconds;
> #P connect 3 0 4 0;
> #P connect 2 0 3 0;
> #P connect 1 0 2 0;
> #P window clipboard copycount 6;
>
>
> On 12/01/2008, Ross Malone
> > wrote:
>>
>> Hey everyone!
>> I’ve made a 16 step sequencer where the tempo is controlled in milliseconds.
>> I want to change this to BPM but I don’t know the equation to do so.
>> If anyone can help, please do!
>> thanks a lot,
>>
>
>

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


January 12, 2008 | 7:37 pm

Yeah, using a float number box seems to solve it. Strange that the two
number boxes receiving the same number display different integers.

On 12/01/2008, Gary Lee Nelson wrote:
>
> There are some rounding errors in your patch. Try this.
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P comment 206 253 61 196617 BPM;
> #P number 206 235 83 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 187 197 27 196617 + 0.5;
> #P flonum 264 173 87 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P flonum 263 90 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P comment 113 253 61 196617 BPM;
> #P number 113 235 83 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 167 145 47 196617 * 1000.;
> #P newex 167 119 37 196617 !/ 60.;
> #P number 167 91 78 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P comment 167 74 61 196617 milliseconds;
> #P connect 8 0 9 0;
> #P connect 3 0 4 0;
> #P connect 3 0 8 0;
> #P connect 3 0 7 0;
> #P connect 6 0 2 0;
> #P connect 1 0 2 0;
> #P connect 2 0 3 0;
> #P window clipboard copycount 11;
>
>
>
> On 1/12/08 7:00 AM, "Joe Bicker" wrote:
>
> not sure if this is entirely accurate, but it works…
>
> #P window setfont "Sans Serif" 9.;
> #P window linecount 1;
> #P comment 167 191 61 196617 BPM;
> #P number 167 173 83 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P newex 167 144 47 196617 * 1000.;
> #P newex 167 119 37 196617 !/ 60.;
> #P number 167 91 78 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
> #P comment 167 74 61 196617 milliseconds;
> #P connect 3 0 4 0;
> #P connect 2 0 3 0;
> #P connect 1 0 2 0;
> #P window clipboard copycount 6;
>
>
> On 12/01/2008, *Ross Malone*
> > wrote:
>
>
> Hey everyone!
> I’ve made a 16 step sequencer where the tempo is controlled in
> milliseconds.
> I want to change this to BPM but I don’t know the equation to do so.
> If anyone can help, please do!
> thanks a lot,
>
>
> ——————————
>
>
>
>
> Cheers
> Gary Lee Nelson
> Oberlin College
> http://www.timara.oberlin.edu/GaryLeeNelson
>
>
>


January 12, 2008 | 9:29 pm

Adding .5 rounds the result

expr $f1/60000.+.5

Does it all in one object.

If you are applying the bpm to tempo, I suggest keeping the fractional part.

On 1/12/08 2:37 PM, "Joe Bicker" wrote:

> Yeah, using a float number box seems to solve it. Strange that the two number
> boxes receiving the same number display different integers.
>
> On 12/01/2008, Gary Lee Nelson wrote:
>> There are some rounding errors in your patch. Try this.
>>
>> #P window setfont "Sans Serif" 9.;
>> #P window linecount 1;
>> #P comment 206 253 61 196617 BPM;
>> #P number 206 235 83 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
>> #P newex 187 197 27 196617 + 0.5;
>> #P flonum 264 173 87 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
>> #P flonum 263 90 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
>> #P comment 113 253 61 196617 BPM;
>> #P number 113 235 83 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
>> #P newex 167 145 47 196617 * 1000.;
>> #P newex 167 119 37 196617 !/ 60.;
>> #P number 167 91 78 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
>> #P comment 167 74 61 196617 milliseconds;
>> #P connect 8 0 9 0;
>> #P connect 3 0 4 0;
>> #P connect 3 0 8 0;
>> #P connect 3 0 7 0;
>> #P connect 6 0 2 0;
>> #P connect 1 0 2 0;
>> #P connect 2 0 3 0;
>> #P window clipboard copycount 11;
>>
>>
>>
>> On 1/12/08 7:00 AM, "Joe Bicker" wrote:
>>
>>> not sure if this is entirely accurate, but it works…
>>>
>>> #P window setfont "Sans Serif" 9.;
>>> #P window linecount 1;
>>> #P comment 167 191 61 196617 BPM;
>>> #P number 167 173 83 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
>>> #P newex 167 144 47 196617 * 1000.;
>>> #P newex 167 119 37 196617 !/ 60.;
>>> #P number 167 91 78 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
>>> #P comment 167 74 61 196617 milliseconds;
>>> #P connect 3 0 4 0;
>>> #P connect 2 0 3 0;
>>> #P connect 1 0 2 0;
>>> #P window clipboard copycount 6;
>>>
>>>
>>> On 12/01/2008, Ross Malone
>>> > wrote:
>>>>
>>>> Hey everyone!
>>>> I’ve made a 16 step sequencer where the tempo is controlled in
>>>> milliseconds.
>>>> I want to change this to BPM but I don’t know the equation to do so.
>>>> If anyone can help, please do!
>>>> thanks a lot,
>>>>
>>>
>>>
>>
>>
>>
>> Cheers
>> Gary Lee Nelson
>> Oberlin College
>> http://www.timara.oberlin.edu/GaryLeeNelson
>> < http://www.timara.oberlin.edu/GaryLeeNelson>
>>
>>
>
>
>

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


January 13, 2008 | 8:44 pm

Hi maxers !

I prefer the following patch and keeping integers !

and it’s reversible !

max v2;
#N vpatcher 100 100 700 500;
#P window setfont "Sans Serif" 9.;
#P number 226 86 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window linecount 1;
#P comment 309 237 114 196617 BPM or ms interval;
#P number 206 235 83 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 167 162 41 196617 + 0.5;
#P newex 167 127 55 196617 !/ 60000.;
#P comment 315 90 109 196617 ms interval or BPM;
#P connect 5 0 1 0;
#P connect 1 0 2 0;
#P connect 2 0 3 0;
#P pop;
> Adding .5 rounds the result
>
> expr $f1/60000.+.5
>
> Does it all in one object.
>
> If you are applying the bpm to tempo, I suggest keeping the
> fractional part.
>
>


January 13, 2008 | 9:14 pm

In general,

BPM = 30000/BEAT_IN_MILLISCONDS

or maybe 60000 depending on what you count as a beat

So in Max

expr (30000/$i1)


January 13, 2008 | 9:28 pm

or !/ 60000.

On Jan 13, 2008, at 4:14 PM, Andrew Robertson wrote:

>
>
> In general,
>
> BPM = 30000/BEAT_IN_MILLISCONDS
>
> or maybe 60000 depending on what you count as a beat
>
>
> So in Max
>
> expr (30000/$i1)
>
>
>
>


January 14, 2008 | 12:31 am

Again, integer calculations can sometimes lead to gross errors in timing.

For example, with integer calculations, a 10 minute piece would be shorter
with a time interval of 333 ms compared to 334. That is a 1 ms error on
each of 1800 beats making an error of 1.8 seconds. And neither 333 or 334
accurately represents a precise tempo of 180 bpm.

Beats per minute is calculated with reference to intervals of 1000ms that
would result in 60 bpm

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson

On 1/13/08 4:14 PM, "Andrew Robertson" wrote:

>
>
> In general,
>
> BPM = 30000/BEAT_IN_MILLISCONDS
>
> or maybe 60000 depending on what you count as a beat
>
>
> So in Max
>
> expr (30000/$i1)
>
>
>


January 14, 2008 | 11:50 pm

there is a tempo object.


January 15, 2008 | 2:30 am

And pulse. Pulsemetro and my new favorite el.samm

On 1/14/08 6:50 PM, "James" wrote:

>
> there is a tempo object.

Cheers
Gary Lee Nelson
Oberlin College
http://www.timara.oberlin.edu/GaryLeeNelson


January 15, 2008 | 4:22 pm

http://www.maxobjects.com/?v=objects&id_objet=1550

this is the BPM2ms object by Karlheinz Essl, it comes in a set of objects that I’ve found VERY useful and have come to rely upon.


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