# What is the frequency in the Metro function to BPM?

Hello,

I did some work with the oopsy and there were soem functions for calculating the BPM and ticks per BPM. I was wondering if there was a c/c++ equivalent that I could use.

Brett

Hi all,

I found the “Metro” function when looking at the Pod Sequencer. My only noob question here is: What is the “frequency” in? For example, if it were in hertz the 4.0f would be 240 BPM and the max of 13.0f would be crazy fast. Looking at the Metro function it does a x2 pi, making it look like 4.0f would be 120 BPM. Is this correct in my thinking here?

Thank you for the help,
Brett

As you may know, bpm is a way to measure clock speed. Clock is a requirement for any type of sequencing (mapping note events to the time)

Metro class is designed for such purpose. In a nutshell, metro is an oscillator with period of 2pi. Every 2pi metro will return a trigger. It’s up to you which frequency to use. Hz is defined as one cycle per second, so with 1Hz you’ll get 1 trigger per second, or 60bpm.

I am using metro class in my project for sequencer/track playback. But I use much higher resolution, to be able to capture resolutions such as 1/8, 1/16, 1/32 etc.

Hi @brbrr,

Yes, that make total sese. I figured out a couple of things as I was using it last night:

1. It seems as though Metro needs to run in the audio callback in some form. This makes sense so that it has consistent timing to work from. My initial use didn’t do that, so that caused mesome challenges early on regardless of the frequency I was passing in.

2. For my clarification: if I pass in 60, will I get 60 BPM, or is the frequency n HZ so I should pass in 1Hz to get 60 BPM or 60 or something else? This is what I was not so clear on when looking at the API. Any clarification here would be helpful.

Thank you for the help, it is much appreciated.

Brett

1. Yes you have to call `Process()` regularly, once per sample or once per block, depending on which rate you passed in `Init()`.

2. The frequency is in Hz, given that `Process()` is called at the aforementioned rate. `freq_hz = tempo_bpm / 60.f;`

Thank you, much appreciated!

Brett

For future reference, most (if not all) of the frequency parameters in DaisySP are in Hz.