# Record preset Varibles

**URL:** <https://forum.bome.com/t/record-preset-varibles/1899>\
**Category:** Bome Products\
**Created:** [November 27, 2020, 2:53pm UTC](https://forum.bome.com/t/record-preset-varibles/1899 "2020-11-27T14:53:53Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![mfrisberg](https://forum.bome.com/letter_avatar_proxy/v4/letter/m/f19dbf/32.png) [@mfrisberg](https://forum.bome.com/u/mfrisberg)\
**Post date:** [November 27, 2020, 2:53pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/1 "2020-11-27T14:53:53Z")

</div>

Hi  
me gain back with even more questions  
if i want a varible to only be active in a preset  
so i can use it in multiple presets with out messing with eachoder  
they will never be active at the same time but will store values that are only used when in that preset  
exsample  
in preset A gd=123 encoder value  
switch to preset B gd=50  
when switching back A gd are again 123  
you guys get what im saying .  
becouse i got 8 layers or preset  
where each layer is the same 8 encoders  
and they are all pass thru and i want record the value for each for next time i come back to same pre set .

Ps Steve im geting to the point where my ocd are getting satisfid with the amount of functions from V,M,R are transfered over to the APC 40 mkII

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [November 27, 2020, 3:48pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/2 "2020-11-27T15:48:44Z")

</div>

Hi Mikael,

Bome MIDI Translator has just two types of variables:

**Global Variable** s - Are static and can be seen across all translators and presets  
**Local Variables** - Are dynamic and can only be seen within a given incoming event

At this time there is no concept of “ **Preset Variables** ”.

With that said, I anticipate what you want is to duplicate your translators in different presets to handle a different layer function without having to edit all of your rules with different variable names within each preset

The technique I use to do this is to save the “preset” variables to another global variable prior to changing presets, then save the global variables to the “preset” variables upon changing presets.

For example, you want “ga” as a preset variable.

**Prior to doing a preset change.**

- Copy ga to ha (the permanent global variable for preset 1)

- Change presets (to preset 2)

**Upon activation of the new preset (2) ,**

- copy ia (the permanent global variable for preset 2) to ga

Then you can continue to use ga in your rules as normal.

Since you also have MIDI helper, instead of using additional global variables, you could also save and restore global variables for each preset from different permanent storage files.

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![mfrisberg](https://forum.bome.com/letter_avatar_proxy/v4/letter/m/f19dbf/32.png) [@mfrisberg](https://forum.bome.com/u/mfrisberg)\
**Post date:** [November 27, 2020, 4:13pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/3 "2020-11-27T16:13:29Z")

</div>

But i would still need about 40 varibles to store each value

im going to run out soon😪

---

<div class="post-metadata">

**Author:** ![mfrisberg](https://forum.bome.com/letter_avatar_proxy/v4/letter/m/f19dbf/32.png) [@mfrisberg](https://forum.bome.com/u/mfrisberg)\
**Post date:** [November 27, 2020, 4:17pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/4 "2020-11-27T16:17:04Z")

</div>

the helper is going to come in to play soon after hand i learn

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [November 27, 2020, 4:20pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/5 "2020-11-27T16:20:10Z")

</div>

What type of data are you storing? If it is only 1 or 0 then it is only 1 bit of data and you can use a single global variable to store up to 32 bits of data. If it is a 7 bit value (like a MIDI CC) then you can store up to 4 values into a single global variable (4x7=28 with 4 bits to spare).

MT Pro has room for up to 360 32 bit global variables. Again if you need more, you can use MIDIHelper to save different global variable sets so you are only limited to the number of filenames you have to save them to but will only have access to 360 at a given time.

For instance for my 64 bit grid on my APC-MINI I only use 2 global variables to maintain their on/off state using bitmapping.

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![mfrisberg](https://forum.bome.com/letter_avatar_proxy/v4/letter/m/f19dbf/32.png) [@mfrisberg](https://forum.bome.com/u/mfrisberg)\
**Post date:** [November 27, 2020, 4:27pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/6 "2020-11-27T16:27:45Z")

</div>

the data im storing is the encoder position so between 0 to 127  
this is for the Sel function on Bus 0 to 8  
if i use the normal faders and they are set to what i have set on a nother channel and tuch them wile on this channel they jump to the physical position of the fader but recording the value on the encoder will let me be in the right position on that encoder on what ever channel im modifying hope that made sence

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [November 27, 2020, 4:44pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/7 "2020-11-27T16:44:28Z")

</div>

So bus 1-8 on Potato has 8 faders, 8 Reverb Returns and 8 delay returns so a total of 24, 7 bit values. You can store all of this in 7 global variables instead of each in their own global variables (which would use up 24).  
In this case I would actually probably use 8 variables and organize them something like.  
g1-g8  
where bits 0-6 would be the fader value - skip bit 7  
bits 8-14 would be the delay return - skip bit 15  
bits 16-22 would be the reverb return - skip bit 23  
and you could use bits 24-31 for future use/expansion:

For instance

- A bit for select
- Another bit for Mono
- Another bit for EQ
- Another bit for Mute
- 4 bits for the Mode select (which can have 12 values)

That way each global variable has bits designed for a given bus  
g1 bits - bus 1  
g2 bits - bus 2  
etc.

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![mfrisberg](https://forum.bome.com/letter_avatar_proxy/v4/letter/m/f19dbf/32.png) [@mfrisberg](https://forum.bome.com/u/mfrisberg)\
**Post date:** [November 27, 2020, 5:00pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/8 "2020-11-27T17:00:42Z")

</div>

I see what u are saying  
i need to learn bit mapping  
the use was more for the Sel button as it works as a Shift layer for the inputs to that specific out put  
so i can set Strip 0 to 7 for Bus 0  
so each bus have its specific input levels  
One question in what format must i type a cc to be stored in a global v  
lets say i want to store midi 9f 20 22

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [November 27, 2020, 5:21pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/9 "2020-11-27T17:21:39Z")

</div>

See the attached example.

I store CC0 in to the lowest 7 bits  
I store CC1 into bits 8-14 (skipping one bit)  
I store CC2 into bits 16–22 (skipping one bit)  
I store CC3 into bits 24-30

[Storing-4-7-bit-values-into-single-global-variable.bmtp](https://forum.bome.com/uploads/short-url/ljORzsKRcB6GwioHGofmtHdUbrL.bmtp) (2.3 KB)

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![Oliver.Rinn](https://forum.bome.com/letter_avatar_proxy/v4/letter/o/ee59a6/32.png) [@Oliver.Rinn](https://forum.bome.com/u/Oliver.Rinn)\
**Post date:** [November 30, 2023, 9:01am UTC](https://forum.bome.com/t/record-preset-varibles/1899/10 "2023-11-30T09:01:42Z")

</div>

That is really usefull. But how is it possible to convert the variable back to 4 midi output. It´s really hard to understand bitwise operation, but it is a great tool. Thank you

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [November 30, 2023, 4:08pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/11 "2023-11-30T16:08:24Z")

</div>

Hi @Oliver.Rinn ,

I know bit manipulation seems a bit daunting but once you get used to it, it is quite powerful. Note that as the time of this original post we had less global variables available. We had 360 available at the time, but in the current version (v1.9.1) it is now 710.

With that said, bit mapping is still quite useful in some cases as it can actually be more efficient.

Now to your questions. Say that you have the global variable ga set up to store 4 cc’s as I described earlier.

//Let’s extract the lower byte into the local variable oo  
oo=ga&0x7f

Now the next byte into the local variable pp  
pp=ga\>\>8  
pp=pp&0x7f

Now the next higher byte into the local variable qq  
qq=ga\>\>16  
qq=qq&0x7f

Finally the highest order byte into the local variable rr  
rr=ga\>\>24  
rr=rr&0x7f

The last construct is simply to ensure that that we never set bit 7 (the eighth bit) to a 1.

As a side note, if you use the following rules and save your project file, when you come back, it will change your rules to decimal so

oo=oo&0x7f

will show as

oo=oo&127

You can refer to [this post](https://forum.bome.com/t/bitwise-operations-and-reference/1862) with more detail on bitwise operations.

I’m also finding with the new ‘Perform’ feature of version 1.9.1, I often do not need as many global variables because we can pass parameters between translators with out needed to touch global variables.

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![chrisjdan](https://forum.bome.com/letter_avatar_proxy/v4/letter/c/97f17d/32.png) [@chrisjdan](https://forum.bome.com/u/chrisjdan)\
**Post date:** [December 12, 2023, 8:10am UTC](https://forum.bome.com/t/record-preset-varibles/1899/12 "2023-12-12T08:10:29Z")

</div>

Hi mfrisberg

I think this may help if I’m hearing you correctly. I just finished a project that controls a Neural DSP guitar plugin. I’m using a 4 button iRig Blueboard. I’ve got 4 banks of presets with 4 presets on each bank. Each preset has 100 parameters that can be controlled via midi. I’m only controlling 14 which is what you see on the front panel of the amp.

I can switch between all of the banks and presets at will. I have access to each front panel knob and can vary the value with 2 buttons - one for up and one for down. My main concern is to be able to keep the preset values intack for all 16 presets and offer full “take-over” mode on each parameter. For example the parameter of the current control is full on (127). When moving to the next control the value is low (5). The first touch of the low knob immediately slams the value from 5 to 127 which then has to be dialled back to its original value of 5. The second issue is to ensure the all 16 presets with 14 parameters each (228 total) retain their values as set by the user.

I just realized how old this post is so perhaps you’ve found the solution. I’ll include the following snippets and if you or anyone wants to pursue it further I’ll expand the information. Essentially each preset’s group of parameter values is just 2 translators.

The first translator you create global vars for the 14 parameters for each preset as a MTP rule

 ![Screenshot 2023-12-12 at 2.16.41 AM](https://forum.bome.com/uploads/default/original/2X/3/36be04a5a839b37c2b2a3ec8ea419f6588358602.png)

Followed by a translator that loads the above values for each parameter when entering the preset.

 ![Screenshot 2023-12-12 at 2.17.35 AM](https://forum.bome.com/uploads/default/original/2X/5/574973a1fa57515de8cccc731a7039eb7ea431b5.png)

I’ve included a link to an early demo which has been updated with access to a Neural guitar tuner as well a two button wah pedal feature. If you watch the video and only want to see the button control feature move to the 4:00 minute mark.

[https://storage.googleapis.com/verbaldia/TKver6\_00.mp4](https://storage.googleapis.com/verbaldia/TKver6_00.mp4)

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [December 12, 2023, 6:33pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/13 "2023-12-12T18:33:09Z")

</div>

Hi @chrisjdan

Thanks for posting! I’m reading through your description and am unclear if there is something you are still struggling with. Are you still getting jumps as you switch presets? Do you ever change the parameters using a mouse directly within the plugin? If you do, does the plugin send MIDI back to your project to update the global variable(s)?

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![chrisjdan](https://forum.bome.com/letter_avatar_proxy/v4/letter/c/97f17d/32.png) [@chrisjdan](https://forum.bome.com/u/chrisjdan)\
**Post date:** [December 12, 2023, 11:58pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/14 "2023-12-12T23:58:24Z")

</div>

Hi Steve,

Sorry if I misled you with my post. It’s been a while since I’ve been on the site and was looking at some of the other postings.

I noticed a posting by mfrisberg and it appeared he was having issues with keeping assigned preset variables intact when switching from one preset to another preset.

I was attempting to explain how I address the issue when needed. In my example I’ve got 16 different presets with 14 parameters assigned to each preset, 228 in total. However you must manually load those values as global variables into MTP for each of the 16 presets. Once done you’re off to the races.

To answer you question I’m very pleased with the functionality of the routine that allows me to accomplish my goal thanks to Bome MTP. The whole process runs without any problems at all and that’s why I was attempting to share it with other users.

The plug-in does not provide any midi data when changing values with a mouse. I rely solely on MTP to harvest that information. That’s not totally true as I do use Midi Monitor as well due to its real time display conversion of hex to midi and vice versa. I’ve watched some of your tutorials and your programming skills and knowledge are at a professional level compared to me and many of the uses I would think. You probably can convert hex to decimal like a second language without the need for additional tools…lol.

Harvesting the data from the plug-in using MTP is very simple. When done editing a bank of presets to my liking I simply dump the global variables, cut & paste into a spreadsheet, transpose them and cut and paste them back into the related translator fields in MTP.

The other benefit is that there is no “fader, encoder slamming” as I’m only using two encoders to modify 228 parameter values. Everything is smooth as poop through a goose.

The other reason I was on the site is I was looking to see if there was any way of writing changes made to the buffer preset variables back into the stored global variables in Rules. I found a conversation between you and ARC where you alluded to “custom code” as the answer.

I plan on uploading a newer video that highlights the ‘takeover’ mode, wah pedal and guitar tuner updates to the project.

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [December 13, 2023, 1:07am UTC](https://forum.bome.com/t/record-preset-varibles/1899/15 "2023-12-13T01:07:43Z")

</div>

Awesome. Thanks for the clarification! Just wanted to make sure if you had any questions, I could help further.

BTW I still use a hex/decimal calculator. No matter how hard I try, I haven’t been able to do much conversion in my head. There are a few areas I have it memorized though.

Thanks for the good words!

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![mfrisberg](https://forum.bome.com/letter_avatar_proxy/v4/letter/m/f19dbf/32.png) [@mfrisberg](https://forum.bome.com/u/mfrisberg)\
**Post date:** [December 13, 2023, 1:52pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/17 "2023-12-13T13:52:49Z")

</div>

Hi steve long time  
Hope all is fine  
I dont use the the persistent any more was having some issues with the timing and the issue was the timing varies depending on how busy the cpu is

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [December 13, 2023, 2:50pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/18 "2023-12-13T14:50:08Z")

</div>

Yes, I understand. The MIDI Helper process was just serially reading and writing the global variable files and CPU timing could be a factor. I’m not sure if the MH file you have used MT Pro timers or not to signal to MT Pro completion of setting and getting variables.

Steve

---

<div class="post-metadata">

**Author:** ![mfrisberg](https://forum.bome.com/letter_avatar_proxy/v4/letter/m/f19dbf/32.png) [@mfrisberg](https://forum.bome.com/u/mfrisberg)\
**Post date:** [December 13, 2023, 4:12pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/19 "2023-12-13T16:12:16Z")

</div>

The last MH you sent me had some timers  
And still i was gett inconsistencies  
But now vm is using midi call backs so if a position on a rotary changed on a noter page then when swithing back vm is pinging the note setting and i have it routed direct to the port for the leds  
I still use the MH but mostly as a master record for serten nobs that get reset when rebooting some software then i have it as a one click when i reboot obs it forgets where the faders where on the surface

---

<div class="post-metadata">

**Author:** ![SteveC](https://forum.bome.com/user_avatar/forum.bome.com/stevec/32/8250_2.png) [@SteveC](https://forum.bome.com/u/SteveC)\
**Post date:** [December 13, 2023, 4:30pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/20 "2023-12-13T16:30:56Z")

</div>

Yes, the latest VoiceMeeter enhancements are nice. I use them for my faders, however still use an API using AutoHotkey for everything else.  
But for my faders, since I don’t have motorized faders, I really don’t need feedback anyway.

My AutoHotKey program is based on [this API](https://github.com/topics/voicemeeter-api).

It is a bit of spaghetti code but it works for me. I use an APC MINI MK2 to control Voicemeeter Potato.

Steve Caldwell  
Bome Customer Care

* * *
_Also available for paid consulting services: bome@sniz.biz_

---

<div class="post-metadata">

**Author:** ![mfrisberg](https://forum.bome.com/letter_avatar_proxy/v4/letter/m/f19dbf/32.png) [@mfrisberg](https://forum.bome.com/u/mfrisberg)\
**Post date:** [December 13, 2023, 8:22pm UTC](https://forum.bome.com/t/record-preset-varibles/1899/21 "2023-12-13T20:22:00Z")

</div>

I have been thinking about building a vm strip as a test using a micro controller and alps motor faders  
And some alps rotary encoders in i saw some nice strip like oled displays that would work as vo meter  
.its just getting the time and energy to start ordering hardware
