Timers don't work fine in bomebox

Hi Steve, I need your help..
My project works with variable to open and close midi ch that use the same controller; I used timer to have visual feedback: importing the proj in the bomebox I notice the timers doesn’t work fine, they are asynchronouses or don’t work toghether.
I think I read in the forum that it will be caused by the different speed of the processor (PC-Bomebox) and the timers are competing, is it correct?
Is there a metod to synchronize the timers when they are triggered in different moment?

Hi and welcome back to the forum!

Timers are independent and and if they are started asynchronously, they will run independently. You may be able to synchronize 2 timers with each other by using an iteration of one timer to start or re-start the other. If they have the same delay, they should maintain synchronization but if the have different delays, then they will each use their own duration so they will start off in sync but change thereafter.

The processing speed of a timer can be defined in milliseconds so if you are running a a faster of slower processor, the project will take that into consideration so they should run at the same speed regardless of the processor they are running on. Of course if you are overloading the processor with other processing, that could impact performance so if you have a lot of timers running, it might be possible to overload the processor (like any other application that may be running on the host processor.

Also, global variables are not atomic, so modifying it with multiple translators could create a race condition, so care must be taken. In general, it is best to have only one translator change the variable and other translators use it as read only.

Could you illustrate a simple example of what you are trying to do and perhaps I can come up with a recommendation?

Steve Caldwell
Bome Customer Care


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

Thanks Steve, you’re always precious, and very fast…I need to try and digest the informations
Thanks again :folded_hands:

1 Like

Hi Matteo, it would be interesting to see your project file that behaves differently on computer and on BomeBox. Thank you!

Hi Florian, Thank you for your interest..I think I’ve understood the problem; in the project the timers start when I active some presets, this presets call timers to give me visual feedback of the channel (1 note on and 1 note off). I’m trying to understand a mechanism to syncronize them.
I attach the project file…it’s not much elegant

Thank you again

OctaFormSh-4D.bmtp|attachment](upload://A8uNBiiJI5Wb9irD6vcmVfVUSiR.bmtp) (340.8 KB)

OctaFormSh-4D.bmtp (340.8 KB)

Hi,

So you have a total of 4 timers

  • 50 -
  • 50
  • 25 -
  • 25

So not much to keep in sync.
You start "50 - " and “50” with notes 74 or 75 and you start "25 - " and “25” with note 7

For the most part you are staring them with note messages but in one case you are starting them with pitch bend and a different delay so maybe the issue is translator 37.3 which could throw things out of sync.

Is it the “50” timer that is misbehaving?


Translators that start timers:


7.7 50 -
7.8 50
7.16 50 -
7.17 50
7.25 50 -
7.26 50
7.34 50 -
7.35 50
15.1 50 -
15.2 50
15.3 50 -
15.4 50
15.5 50 -
15.6 50
15.7 50 -
15.8 50
18.1 50 -
18.2 50
18.3 50 -
18.4 50
18.5 50 -
18.6 50
18.7 50 -
18.8 50
21.1 50 -
21.2 50
21.3 50 -
21.4 50
21.5 50 -
21.6 50
21.7 50 -
21.8 50
24.1 50 -
24.2 50
24.3 50 -
24.4 50
24.5 50 -
24.6 50
24.7 50 
24.8 50 -
31.0 50 -
31.1 50
31.2 50 -
31.3 50
31.4 50 -
31.5 50
31.6 50 -
31.7 50
37.4 50 
41.6 25 -
41.7 25
41.9 25
41.10 25 -

Timer Translators

4.64 Incoming: Note On on ch. 1 with note:7 (0x07) and velocity:127 (0x7F), on port PLATFORM
Outgoing: Periodic timer "25": 250 ms (initial delay: 0 ms)
4.65 Incoming: Note On on ch. 1 with note:7 (0x07) and velocity:127 (0x7F), on port PLATFORM
Outgoing: Periodic timer "25 -": 500 ms (initial delay: 0 ms)

10.36 Incoming: Note On on ch. 1 with note:74 (0x4A) and velocity:127 (0x7F), on port PLATFORM
Outgoing: Periodic timer "50": 500 ms (initial delay: 0 ms)
10.37 Incoming: Note On on ch. 1 with note:74 (0x4A) and velocity:127 (0x7F), on port PLATFORM
Outgoing: Periodic timer "50 -": 1000 ms (initial delay: 0 ms)

10.80 Incoming: Note On on ch. 1 with note:75 (0x4B) and velocity:127 (0x7F), on port PLATFORM
Outgoing: Periodic timer "50": 500 ms (initial delay: 0 ms)
10.81 Incoming: Note On on ch. 1 with note:75 (0x4B) and velocity:127 (0x7F), on port PLATFORM
Outgoing: Periodic timer "50 -": 1000 ms (initial delay: 0 ms)


37.3 Incoming: Pitch Bend on ch.'xa' with bend:8191 (0x1FFF), on port Roland
Outgoing: Periodic timer "50": 500 ms (initial delay: 500 ms)
37.5 Incoming: Pitch Bend on ch.'xa' with bend:-8192 (0xFFFFE000), on port Roland
Outgoing: Kill timer "50"

Steve Caldwell
Bome Customer Care


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

Hi Steve, Thanks for reply
In my proj I use Icon Platform to command the Roland sh4d and the Octatrack…I use timers (50 note on and 50- note off) as visual feedback , ..I’m not able to create a ‘blinking led’ mechanism using the same speed time.
in the project the issues occur when I activate multiple channels. Since I use global variables to active channels that active led and, when needed, 2 timers (50,50-); so when I add a channel the leds flash abnormaly, I 'm studing how to synchronize them, as you advised me.

Translator 37.3 is not active, the proj is a workinprogress and some translator are experiments, I know it’s confusional, sorry.

I don’t hink, it’s note on for flashing leds channels

Timers 25 aren’t important, I can delete them.

Hi, maybe if you can create a minimalist example, I can help more. I struggled with what you were doing. I didn’t see that you were using any global variables to change MIDI channels.

Steve Caldwell
Bome Customer Care


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

Hi,

Below I show 3 ways to implement a blinking timer. Enable only preset 1, 2 or 3 at any given time. You might want to change both the note number and MIDI CH for triggers and output.

Preset 1 handles timers the way you are doing it.
Preset 2 is much simpler and just uses one timer and toggles the value of ga to determine whether it is a note on or note off.
Preset 3 has the timer “Blink1” fire a one shot timer after 500 MS to turn the note off. I use perform in rules to handle the note off in translator 3.2 and perform in the outgoing action in translators 3.3. Perform takes 3 parameters to determine the MIDI channel, note number and velovity.

If had my choice, I would stick with the toggle method (preset 2) as it is the simplest although it does require use of a global variable.

Any of these method should work, however, the timing for the two timer method should be precise to keep them in sync. If you trigger either timer slightly out of sync, you may have trouble.

Blink-Timer-Examples.bmtp (4.3 KB)

Steve Caldwell
Bome Customer Care


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

Thank you Steve,
thanks to your blink timer I understood why the timers aren’t synchronized.
Your help is always precious :top_arrow:

1 Like