Momentary_toggle_preset_change

NANO_MOM_TOG.bmtp (10.3 KB)

IM USING A KORG NANO KONTROL2, AND I WANTED TO MAKE TRANSLATORS TO SWITCH FROM MOMENTARY TO TOGGLE VIA DOUBLE PRESS. ALSO IM USING THE TRACK BUTTONS TO SWITCH PRESETS. I GOT THAT PART TO WORK. MY GOAL IS TO CREATE THREE ADDITIONAL PRESETS TO ACCESS ALL 128 BUTTONS VIA PRESET CHANGE. MY PROBLEM IS THAT I DONT UNDERSTAND HOW TO KEEP ALL INCOMING CC’s THE SAME ON EACH PRESET AND HAVE THE OUTGOING CHANGE. IM USING 8 TRANSPORTS 8 SOLO 8 MUTE 8 REC TOTAL 32 BUTTONS FOR INCOMING x 4 PRESETS.
I.E. PRESET 1 ( 001- 032 ), PRESET 2 ( 033- 064 ), PRESET 3 ( 065- 096 ), PRESET 4 ( 097- 128 ).
SO THAT CC#1 CAN ALSO BE CC#33, CC#65, CC#97 DEPENDING ON THE PRESET SELECTED.
IS THAT POSSIBLE ??? THANKS

Hi, and welcome to the Bome Forum!

Since CC 120-127 are reserved for other uses according to the MIDI specifications, I recommend you use notes for buttons and CC’s for faders and knobs. Is this OK?

You mentioned 32 controls per preset, however there are 5x8 or 40 total controls
24 buttons, 8 faders and 8 knobs on each layer not counting the transport or other buttons on the left.

You could use 1 global variable (which is 32 bits) to handle the toggle state of the 24 buttons, however for the knobs since you are tracking 128 states each you would need at minimum 4 global variables which to map the knobs (although the implementation would be easier with 16 since that would not require bit mapping).

.

For toggle, you mention “double press”. Does this mean you want press once for on and once again for off or are you looking to use a double press gesture to change the button behavior from momentary to toggle? I’m unclear on this point.

There are examples with how bitmapping works however it is a bit involved, especially for a new user. You can search the forum if interested. If not I could put an example up for you to get started but I wanted to confirm the button behavior you wanted first.

Steve Caldwell
Bome Customer Care


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

Ok my momentary to toggle works like this when i press a button once timer starts if i press again before timer ends it stays on ( toggle on ) until i double press ( toggle off ) then it resets. If i press only once before the timer ends it resets ( momentary ). Each button has 3 translators that work already. Its a combo button of sorts both momentary and toggle.

Translator 1

Incoming B0 01 00
Rules ga=1
Outgoing once timer 333ms

Translator 2

Incoming B0 01 pp
Rules if ga==0 exit skip
gb=gb^127
ga=0
pp=0
Outgoing B0 01 gb ( change to B0 02 gb )

Translator 3

Incoming once timer 333ms
Rules pp=ga
ga=1
if pp==0 exit skip
Outgoing B0 01 pp ( change to B0 02 pp )

So when i change from one preset to another and deactivating all others

preset 1 outgoing would be B0 01 pp and
preset 2 outgoing would be B0 02 pp

Both using the same incoming B0 01 pp
If possible I would like to only use buttons only. I saw the gesture dispatcher file you posted and some others. 9 gestures for 1 button is sick… I really got lucky to make it this far… Thanks

Well the quickest way to set this up is go to you Preset CC_Buttons_09-16 and change the output.
For example 2.5 had output B0 01 gb and 2.6 has b0 01 pp.
Change the output to B0 09 gb and B0 09 pp

Do the same for the rest of the pairs.

Personally, I would set up a global variable for bank change and instead of hard coding CC number for everything us math to figure it out.

Say ga is your preset (virutual bank number 0-x) and gb is your incoming cc number

// offset
rr=ga*8
// CC number
tt=gb+rr
// since we are starting with 1
tt=tt+1

// tt is the outgoing cc number

As you switch presets you change ga and as you press notes you change gb

I would also use bitmapping to save on global variables. I can bitmap up to 32 buttons using a single global variable.

Say g0 is a bitmap and pp is your incoming CC of 0-31

// to set a bit
rr=1<<pp
g0=g0|rr

// to clear a bit
rr=1<<pp
// 2s complement (reverse all bits)
rr=rr^-1
g0=g0^rr

// to toggle a bit

rr=1<<pp
g0=g0^rr

You can then determine the state of a bit with

// Shift it into position
rr=g0>>pp
// only look at 1 bit
rr=rr&1
// rr will be 1 or 0 depending on the state of the bit

Additional Note: If you send me your nanoKontrol preset, maybe I can test my fix. Right now I’d have to reprogram it.

Steve Caldwell
Bome Customer Care


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

I tried what you said by swapping the outputs

B0 01 gb >>> B0 09 gb
B0 01 pp >>> B0 09 pp

It did work, but for some reason the double press B0 01 pp still activates and does not go off.
I tried adding another B0 01 00, and it did go off, but it was delayed and changed the state of the toggle that was on. I saved my nano settings as a pdf to upload take the .pdf off and you should be able to open the file.

THANKS AGAIN

NANO_MOM_TOG_02.bmtp (10.3 KB)
KORG_EDITOR_SETTINGS.nktrl2_data.pdf (403 Bytes)

Hi,

I think there are some fundamental flaws in the way you handle gestures and also it is probably best not to have any default MIDI thru routes. It is probably best to use just 1 timer for all gestures rather than different timers for each button.

If you want to continue with your method, I guess that is OK but I’m not going to try to debug it further.

I put this example together.
In this example I define the incoming cc number as the button for gesture

g0=cc # for button 0
g1= cc# for button 1
g2= cc# for button 2

Right now I only have buttons defined in my example, but am only using g1. If you are going to use more than 10 buttons g0-g9, then I suggest you use global variables starting with something else that is not used

The rules in all of the gesture manager translators use these variables to determine which button you pressed and whether it is a CC or note.

I manage layers by the global variables gh and gi which are the preset number 0-4 and the offset of 2. I leave presets 0 and 1 always on. I added a preset “Preset Manager” to manage which of the other presets are enabled. Only one at a time

Look at the “Set Globals” in the “Init” preset where I document all global variables.

In this example I’m only working with CC1 input and in each preset set the outgoing offset up by 8 so
Gesture manager 1 outgoing for button 1 is 1, for Gesture Manager 2 it is 9 for Gesture Manager 3 it is 17 and Gesture manager 4 it is 25. I did not program any LED button feedback but you could add translators for that if you would like.

I bitmap the state of the bits in each preset with global variables h0=h3 for toggle. (Double Press)

I disabled all unused gestures in all presets but you can enable them and do anything you would like as output actions.

This whole structure may seem overly complicated but if you have a lot of stuff to program, once the template is set up correctly it can scale quite nicely. I suggest you study it carefully until you understand what is going on.

Right now I hardcoded the offset in each preset output CC but you might want to use math in the rules to set the offsets based on the preset number to define your button outputs instead.

Again I only set up CC 1 for all layers because you might have other ideas and global variables that you want to use for each incoming button.

The way to work it is set up all global variables the way you want. Then update the translators in 1 preset the way you want them as a template and then duplicate presets and make tweaks as necessary to each preset for changes in values and/or global variables used etc.

gesture-manager-example-2021-06-30.bmtp (41.0 KB)

Steve Caldwell
Bome Customer Care


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

Here is a simplified gesture manager that may be easier to understand for a beginner.

  • I use gc, hc and ic for button 1 for the respective gesture layer 1,2, and 3
  • I use ga as a timer busy
  • I use gb for the press, release count
    2= press and release
    4= double press
  • I use gd for the preset number starting with 0
  • I use ge for the preset offset for selecting preset by number
  • I also use gd in formulas to determine the note number based on the preset
  • I use gf as the max preset starting with 0 so 2 = e presets
  • I added a preset for preset managment and Init for setting global variables

All global variable and their use are documented in the “Init” preset in translator “Initialize Global Variables”.

Again, my focus is updating the Application and not the LED indicators of the nanoKontrol2

Here are how my aliases are set up.

image

Simplified Gestture.bmtp (4.9 KB)

Steve Caldwell
Bome Customer Care


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