• ### BPM object or something like it?

I'm new to PD so please excuse me if I've just overlooked something.

I'm working on a rather complex patch where I have a need to keep track on Bars, Beats, Quantize and 1/16, 1/32, 1/64, 1/128 and if possible triplets as well.
I've been working on a solution all day, and have come as close as I can working in miliseconds because thats how the "metro"-object is working. And then it hits me, this would be much easier if there were a way to keep the timing in PD in normal musical terms instead: Bars, Beats, Quantize, 1/16, 1/32, 1/64, 1/128 and triplets. my problem is that there is no direct translation of these "terms" from miliseconds, which makes the timing sluggish.

Is there an object or an easy solution that I've overlooked or am forced to work in miliseconds?

Any help would be appreciated!
Cheers!
Thomas

• Posts 7 | Views 9885
• What I've done when trying to write my own drummachine :

• accept bpm input (e.g. a number box) and convert that
bpm value to the corresponding ms value to trigger a metro
• to work with divisions of the base bpm i just divide or
multiply the base ms value with the correct factor

In the meantime i have about 8 different patches i use regularly. Most
of them however, excepta few, have their timing in ms, since that seems
just more natural in pd (all time related objects deal with ms). Therefore
i created a "masterclock" patch where i can tap tempo and convert between
ms <-> bpm. Those values can be sent to all other patches.

One more thing, when starting with pd i also found the millisecond thing very
bizare. In the meantime, i've started to think myself more in milliseconds than in bpm .

I hope this helps (a little)...

Domien

|] [] |.| ][|-| -- http://soundcloud.com/domxh

• I have a similar story. I put together a prototype based around [metro] that outputs basically musical timecode as bars, beats, sub-beats, and ticks. You specify the tempo in BPM and it does the rest. The important formula is:

beat period in ms = 60,000 / BPM

(there are 60,000 ms in 1 min, and period = 1 / frequency)

It's pretty rough at the moment but usable (changing the number of ticks per sub-beat on the fly isn't as smooth as I'd like). It seemed like a good first step in trying to build a sequencer. Let me see if I can attach it...

Feel free to use and adapt as you wish. It's a good idea to use a number with many divisors (e.g. 6, 12, 24) for ticks/sub-beat, so you can get duplets, triplets, quadruplets, etc.

## Hope this helps!

screwtop

http://www.pdpatchrepo.info/hurleur/cmetronome.pd

• ...and here's a simple patch to show how to use it [attached].

http://www.pdpatchrepo.info/hurleur/metronome-test.pd

• there is an external called [pulse] ,probably a part of the cyclone library, that acts as a metro taking in beats and bars and stuff. it would probably do what you want,

i've never used it though. and you could definately emulate everything it does using normal pd objects.

i still use bpms though. the simple bpm -> ms translation is [expr 60000 / \$f1]

I've been working under the impression that only integers were handled by the "Metro"-Object, but the patches posted gives me the impression that this might not be the case.

I guess I could have made my original question a bit less complex: Does the "Metro"-object only accept Integers? or does decimal numbers like say 66.6667 work as well or is the input truncated?

Cheers!
Thomas

• Ok, I did a few tests in PD and it looks like the metro-object accepts not only integers but also decimal numbers, so I guess all my problem is non-excistent.

Thanks for your fast replies to my initial post, it lead me to the solution!

Cheers!
Thomas

Posts 7 | Views 9885
Internal error.

Oops! Looks like something went wrong!