[PD] table with times?

Lorenzo Sutton lorenzofsutton at gmail.com
Wed Sep 19 09:36:40 CEST 2012


On 19/09/12 01:43, ronni montoya wrote:
> Hi, how can i convert bpm events into time values?  i need to fill a
> table with time values from a specific bpm
>
> any idea how to achieve this?

BPM is beats per minute, so for example:

60 bpm means 60 beats in 1 minute, 1 beat per second

120 bpm is 120 beats in a minute, 2 per second, or better one every 0.5 
seconds

Generalising:

seconds = 60 / bpm

Or also (probably more useful in Pd related stuff)

milliseconds = 60000 / bpm

Lorenzo.
PS: see attached patch for a simple implementation I've often used ;)

>
>
>
> cheers
>
>
> R.
>
> _______________________________________________
> Pd-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
>

-------------- next part --------------
#N canvas 299 194 305 204 10;
#X obj 24 20 inlet bpm;
#X obj 24 81 t b f;
#X obj 24 138 /;
#X obj 24 169 outlet milliseconds;
#X obj 24 110 60000;
#X obj 24 50 f \$1;
#X connect 0 0 5 0;
#X connect 1 0 4 0;
#X connect 1 1 2 1;
#X connect 2 0 3 0;
#X connect 4 0 2 0;
#X connect 5 0 1 0;
-------------- next part --------------
#N canvas 4 67 402 256 10;
#X text -57 11 bpmtoms: Convert BPM (beats per minute) to milliseconds
;
#X text -42 199 Lorenzo Sutton 2010;
#X text -59 214 lorenzofsutton at gmail.com;
#X text 63 78 argument sets initial BMP;
#N canvas 435 67 452 379 metronome 0;
#X floatatom 158 89 5 0 0 0 - - -;
#X floatatom 158 35 5 0 0 0 - - -;
#X obj 136 321 *~;
#X obj 107 5 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1
;
#X obj 137 349 dac~;
#X obj 158 62 bpmtoms 120;
#X obj 107 116 metro 500;
#X text 123 3 On/off;
#X text 196 35 BPM;
#X text 195 90 milliseconds;
#X obj 107 141 t b b b;
#X msg 294 210 0;
#X msg 256 210 0.5;
#X obj 292 172 del 8;
#X obj 256 240 lop~ 10;
#X obj 45 285 osc~ 880;
#X obj 45 180 f;
#X obj 77 180 + 1;
#X obj 45 204 mod 4;
#X obj 45 229 sel 0;
#X msg 45 257 880;
#X msg 75 257 440;
#X floatatom -18 188 5 0 0 0 - - -;
#X text -22 168 accent;
#X text 170 349 remember to turn DSP on...;
#X connect 0 0 6 1;
#X connect 1 0 5 0;
#X connect 2 0 4 0;
#X connect 2 0 4 1;
#X connect 3 0 6 0;
#X connect 5 0 0 0;
#X connect 6 0 10 0;
#X connect 10 0 12 0;
#X connect 10 1 13 0;
#X connect 10 2 16 0;
#X connect 11 0 14 0;
#X connect 12 0 14 0;
#X connect 13 0 11 0;
#X connect 14 0 2 1;
#X connect 15 0 2 0;
#X connect 16 0 17 0;
#X connect 16 0 18 0;
#X connect 17 0 16 1;
#X connect 18 0 19 0;
#X connect 19 0 20 0;
#X connect 19 1 21 0;
#X connect 20 0 15 0;
#X connect 21 0 15 0;
#X connect 22 0 18 1;
#X restore -19 140 pd metronome example;
#X floatatom -18 55 5 0 0 0 - - -;
#X obj 28 55 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X floatatom -18 104 5 0 0 0 - - -;
#X obj -18 79 bpmtoms 100;
#X text 109 134 <- click to see a simple;
#X text 131 147 metronome example;
#X connect 5 0 8 0;
#X connect 6 0 8 0;
#X connect 8 0 7 0;


More information about the Pd-list mailing list