Measure time between events

I would like to measure time between two events - specifically between a CC value 127 and CC value 0 coming out of a pedal on step down and step up.

I would like to take that time variable and use it determine the program change increment / decrement I use in another translator.

I.e. if the measured time is less than 500 ms, then increase / decrease by 1. If 500-1500 jump by 10. If 1500-3000, jump by 32. If over 3000, jump to 64.

How can I measure the time between events and store it as variable?

Hi,

Please find the attached.

First of all I set up my aliases as follows:

You will want to set that to your pedal and your desired output application or device.

You can learn more about aliases from this tutorial.

Translators 1.0 and 1.2 start a 1ms timer (1.4) each from different pedals when pushed down.
Transators 1.1 and 1.3 will measure the time and then stop the timer

The rules of translators 1.1 an 1.3 will measure the time between events and depending of the value send the desired increment (1.1) or decrement (1.3). We also make sure that we never go above 127 (1.1.) and less than 0 (1.3)

Each has a rule to set the current PC (global variable gb). The timer uses the global variable ga for the timer count.

The Perform rules in translators 1.1 and 1.3 call translator 1.5 to set the desired Program Change value.

As mentioned earlier the global variables “ga” and “gb” are used in this project to store the timer count an PC value respectively.

You may need to change the input trigger of translators 1.0-1.3 base on the MIDI message your pedals send. I’m using note on and note off instead of CCs.

Here are the rules of translator 1.1

pp=ga
if pp<500 then qq=1
if pp>=500 then qq=10
if pp>=1500 then qq=32
if pp>=3000 then qq=64
Log "Log Count = %pp% increase by %qq%"
gb=gb+qq
if gb>127 then gb=127
Perform "Program Change", gb
ga=0

and 1.3

pp=ga
if pp<500 then qq=1
if pp>=500 then qq=10
if pp>=1500 then qq=32
if pp>=3000 then qq=64
Log "Log Count = %pp% decrease by %qq%"
gb=gb-qq
if gb<0 then gb=0
Perform "Program Change", gb
ga=0

And here is the project file.

Measure-Between-Events-to-PC-Inc-Dec.bmtp (3.1 KB)

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz

Big thanks!
I’m getting errors though, same as Using Presonus Faderport Classic to control Cubase Quick Controls

I have Pro version 1.9, will try to update.

EDIT: Yes, the update fixed it :slight_smile: Nice changelog considering it’s 0.0.1 change :slight_smile:

IN 1.5 Incoming Action corrupt or not supported: Prfm
TRANSLATOR 1.3 corrupt options: 0000000App=gaif(pp<500)qq=1if(pp>=500)qq=10if(pp>=1500)qq=32if(pp>=3000)qq=64label0027__log>Log Count = %pp% decrease by %qq%gb=gb-qqif(gb<0)gb=0prfm>0014"Program Change", gbga=0
RULE 1.3:9 corrupt rule
TRANSLATOR 1.1 corrupt options: 0000000App=gaif(pp<500)qq=1if(pp>=500)qq=10if(pp>=1500)qq=32if(pp>=3000)qq=64label0027__log>Log Count = %pp% increase by %qq%gb=gb+qqif(gb>127)gb=127prfm>0014"Program Change", gbga=0
RULE 1.1:9 corrupt rule
OUT 0.2 Outgoing Action corrupt or not supported: VrSt
IN 0.2 Incoming Action corrupt or not supported: Prfm
OUT 0.1 Outgoing Action corrupt or not supported: Prfm
OUT 0.0 Outgoing Action corrupt or not supported: Prfm

1 Like

You need version 1.9.1 for ‘Perform’ to work. You can download it from your Bome account at no additional cost.

Steve Caldwell
Bome Customer Care


Also available for paid consulting services: bome@sniz.biz