Creating Subroutines or functions

Hello Everyone,

I try to write a setup for DaVinci Resolve, using an Arturia BeatStep controller. After digging in the dirt I found ways to control all available LEDs and buttons on this little thing (inkl. the function keys and LEDs). So it should be possible to guide the user/operator via illiminated Pads (red, blue and/or magenta) thru the controller pages. Esspecially for the continuos LED setup a centralized rule set might be helpfull.

So the question is, is it possible to generate a kind of, or something similar to “function” within BMTP so keep this logic at one place? The arguments for this routines could be deliverd by global variables …

Thanks for idears, hints, solutions and … whatever … :wink:
Stef

Hi,
There are no functions per se in Bome MIDI Translator Pro, however you might be able to emulate one.

  1. Set up your incoming values in global variables
  2. Call a timer
  3. Have the timer look at the incoming variables and deliver the results in a separate outgoing variable

You will probably need to set up a global variable for timer busy and timer done so that you don’t call a function timer while one is already in progress. Either that or have the function timer trigger another “function done” timer when completed to let your calling routine know it is OK to check the results.

I often use timers to iterate through a bitmap and update buttons with certain colors depending on the bit state and the desired on/off colors.

I’m not sure what inkl is.

Steve Caldwell
Bome Customer Care


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

Hi Steve,

thanks for your answer. I have to aplologize myself for writing denglisch (Deutsch(German)/English) … inkl. ist the short term for incl. … including. Using the control LEDs and keys ist not usual for the BeatStep, because they are not listet within the MIDI implementation and are only reachable via SysEx-Commands … anyway.

To solve my task I have the idea to send a MIDI-message (E.g. Note On VV PP) thru an virtual port and receive it from an other translator (maybe in an other preset). So VV and PP could be parameters for my “function”. Good idea … but it seems not to work. Why could I create a loopback for virtual ports?

Thanks for helping
Stef

Bome Virtual ports have to have one end as Bome MIDI Translator Pro and the other as anything but Bome MIDI Translator Pro. For what you are doing look into loopMIDI or loopBE instead of Bome MIDI Translator Virtual ports, but be careful of MIDI loops if you want to do this. In general it is better to communicate between translators using global variables.

Steve Caldwell
Bome Customer Care


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

Hi Steve,

could you please explain what I should have to do? Are loopMIDI and/or loopBE other software products, or settings within Bome MIDI Translator?

Thanks and best regards
Stef

@Steve: Ignore this post, because I discovered what loopMIDI an d loopBE are … :wink:

Hi Steve,

I have tested loopMIDI and it works as I need it. Thanks for this hint.

What do you thing about including a loopback feature in later MIDI Translator Versions? The benefit is that you (me/I) don’t have to use additional tools and this could be become a good way to realize something like a function call. Well, it might be a good idea too, to thing about how make this mechanismn safe to prevent creating infinit loops. What do you thing about an “MIDI Translator SysEx-Command” … this will usually not use in other devices … ?

Thanks for helping so fast
Stef

I’ve never needed other tools and Bome Midi translator can already handle System exclusive messages via raw midi. If you show me what you did, I can modify it without the use of an external tool

Hi Steve,

I think that my last post was a little bit confusing. My basic thought is, that Bome MIDI Translator will be enhanced to be able to loop MIDI-messages thru the e.g. virtual channels.

The part with the SysEx-commands was only an idea to make the usage of a loopback safer. But this was just an idea. So I will use the loopMIDI-Tool to do this but it would be more comtable if the BMTP would offer this feature out-of-the-box.

Yes I’m still struggling why this feature is needed. I can see the need perhaps for user function calls. Can you show an example of what you are doing?

There is another Bome Add-On in Bome Network however that allows for advanced Midi routing

Hi Steve,

my idea for using “functions” to configure the behaviour of all LEDs on one centralized point. For the 16 Pad-LEDs I will use an 32Bit Integer, where two bits are reserved per LED (00 = off, 1 = red, 2 = blue, 3 = magenta). With this it is easy to freeze the current LED-state just be copying the global variable. After that you can define a new LED-setup because e.g. a mode select key (pad) was pressed so the LED become an new meening. After leaving this mode you can restore the former state on an easy way.

So the “function” analyse each bit-tupple to set the state of each individual PAD. This meens that you have one preset with on tranlation (just some bit operations to mask the relevant bits and interprete the color information) for each LED … and … that’s it.

In my opinion this seams to be an elegant and efficient way.

Hmm so why not use the pad note or CC value to determine which two bits to manipulate? You press the pad up to 4 timers to get the color you want for that pad. You could do all of that in one translator based on the note value received, you don’t need to loop any MIDI back into MT Pro to do this. You would simply look at the incoming note value by pressing the button to determine how much to shift the global variable and which bits to adjust within the rules of that translator Would you need help with rules for this. Once you have all of the colors set the way you want, you could lock in the global variable by some other button or means.

Steve Caldwell
Bome Customer Care


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

Hi,
The following is a color chooser I’ve been able to use with my MIDI Fighter Twister.

Notes are 0-15

You can push each button (knob in this case) up to 4 times to choose between 4 different colors. Only the knob pushed and the values for that knob are affected.
The color choice are in the rules. Once you get the the colors you want simply copy the value of ga to retain that color pallet choice.

I use shift operators to manipulate which bits are changed and then put them back into the global bitmap variable ga. Only one translator handles the color settings for all 16.

color-chooser-2021-05-26.bmtp (1.6 KB)

Steve Caldwell
Bome Customer Care


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