Convert MIDI clock to a specific value

Hi. I would like to convert the incoming MIDI clock signal to a specific value which I would store as a global variable. After that, I will want to use that variable to adjust certain CC output values.

For example:
MIDI incoming clock is 120 bpm
I want to convert this to global value g8=60
MIDI clock 100 bpm would need to become g8=50 and so on.
After that I need to be able to output CC values as CC on ch 16 with value g8-40 (for example)

I’m a bit stuck. I can see the clock incoming (also found this thread Solved: Midi Clock to CC) but I’m lost at how to store this as a specific value.

Any help is truly appreciated!

Doesn’t Bome have some kind of Midi Translator that will do this? Apologies, I’m not in that computer at the moment but I think it does. I know my MidiHubs are able to translate/convert midi data in this way, even specifically cite the midi channel and midi cc and tell it it to convert it to a different midi channel/cc. Though I don’t know how to do that with BMT, I’m certain it is capable. Did you post this question on the forum? The developer is really good at responding.

Although the accuracy of clock in Bome MIDI Translator Pro will be only at the millisecond level (not 100% accurate) the following example should get you started.

What it dos is look at MIDI clock signals and counts how many milliseconds occurs between 24 ticks. 24 ticks in MIDI clock indicates 1 beat. To help smooth it, I average over 10 samples to create the calculated milliseconds. You could use this a a basis for calculating your BPM, however I stop short of doing that for you. You will need to use this figure to determine the value you want to use ultimately in your global variable.

The following variables are used
ga - Timer running flag
gb - milliseconds counter
gc - last count between milliseconds (Number of clock ticks within 1 millisecond)
ge - To use for determinine where to store last 10 values
g0-g9 = Shows last stored 10 values
h0 - average of last 10 values (for smoothing)

You can then use h0 to calculate where to store you desired global variable and the value you want to store there.

I stop short of calculating the BPM. Maybe I’ll come back to this later.

MIDI-BPM-Calculator-2023-04-10.bmtp (3.5 KB)

Steve Caldwell
Bome Customer Care

Also available for paid consulting services:

Hi Again,

This one might make more sense.

Here I set a 1 second timer and count clock counts.
I then multiply the clock count by 60 and then divide by 24 to get the BPM.
I store the BPM divided by 2 in g8.,

I have a controller that starts and stops MIDI clock

  • Note On note 48 starts the timer - Translator 0.2
  • Note On Note 49 stops the timer - Translator 0.3
  • Translator 0.4 enables and disables the clock source from sending clock
  • Translators 0.1 and 0.1 send Start and Stop signals to the DAW
  • Translator 1.0 is the 1 second Timer and calculates the rate
  • Translator 1.1 counts the incoming Clock Signals from the timing source
  • Note On Note 50 will send the CC # 60 on MIDI CH 16 to the DAW - Translator 1.2

You may need to create or modify the translators that start and stop the timing clock or set the source and destination locations.

Here is how I have my aliases set. My Application is Ableton Live

You can learn more about aliases from this tutorial.

MIDI-BPM-Calculator-2023-04-10b.bmtp (4.1 KB)

Steve Caldwell
Bome Customer Care

Also available for paid consulting services:

That is great! Thank you so much, just one more question: in the example, you used a controller to send start and stop messages to the DAW. How would I need to handle this if I want this setup to count the BPM clock continuously? So the DAW is running, and when I adjust the BPM during the making of a song, BMT automatically changes the stored value along with this?

Or is that just too complex ? needs too many resources to function well?
(btw: a millisecond calculated value would be perfect for my needs, don’t need 100% accurate BPM)

Appreciate your help!

Well in my case, I’m controlling and external clock so I had to tell it when to start and when to stop. I had to tell the DAW when it was starting and stopping so that it could also start and stop. If you want a continuous clock stream you could just leave it running and have the timer continuously run and then a MIDI thru route to your DAW to let the clock through. Note that this project is not actually generating clock, it is controlling an external clock source. If you want it to generate clock with Bome MIDI Translator Pro instead, that is a whole different question.

Maybe if you can explain on more detail what you are trying to do. Are you trying to generate MIDI clock with MT Pro? What is your destination device or DAW. Due to the msec accuracy, I wouldn’t actually recommend using MT Pro as a clock source.

Steve Caldwell
Bome Customer Care

Also available for paid consulting services:

The below is an example of a Bome MIDI Translator Pro MIDI Clock Generator. There are no-calculations on the rate but a CC will control the rate.
Steve Caldwell
Bome Customer Care

Also available for paid consulting services:

MIDI-Clock-Generator-2023-03-14.bmtp (2.0 KB)

Thanks for your suggestions. I’m not trying to generate clock. I have a music instrument plugin that has LFO’s which can not be synced to the DAW MIDI clock (it’s just not an available feature on this particular emulation). But you can adjust the speed using a CC which will change the rate (in ms I guess). So my goal with the topic question is to “grab” the DAW MIDI clock, assign a specific value to that and after that convert it into a CC value from 0-127 which I can send to get the speed “in the ballpark” of the BPM. Doesn’t have to be super accurate, but more to make it easier to get to a usable speed setting for the LFO.

The project file titled ‘MIDI-BPM-Cacluaator-2023-04-10b’ posted above should do what you want.

Steve Caldwell
Bome Customer Care

Also available for paid consulting services:

Ok thanks for the help, I’ll figure it out with the suggested file.
EDIT: it works!! thanks you very much!

If you look at the log window In MT Pro, it should tell you the estimated calculated BPM

Steve Caldwell
Bome Customer Care

Also available for paid consulting services: