Multiple button reset depending on button status

hi guys
thank you for all your help and time on my other posts
now i got it up and running so i can switch preset and it remembers led value and 1 p 2p and reset on 3
on all 5 buttons in the group even got it to reset the other buttons to 0 when one goes in to mode 2
but i want it to
if button 1 is in 1 then then i press button 3 to mode 1 then button 1 goes to 0
but if button 1 is in mode 2 and button 2 is in mode 1
and i press button 4 it only resets button 2
and goes in mode 1
then if i press again button 4 and it goes in mode 2 then it resets button 1 to mode 0
hope u guys understand what i meen its clear in my head might not translate to text so well

best regards Mikey

Hi,
So you have 5 buttons with 3 states right?
When you press one button, you want all other buttons to go to state 0? The button you pressed you want to go to state 1 and if you press it again you want it to go to state 2?

I think I need a bit more detail on the behavior of the buttons that you want. In my mind right now, I think when you push a given button you want to set all other buttons to state 0.

Do you have a project file you can upload so I can take a look?

Steve Caldwell
Bome Customer Care


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

Here is some more info
if button one is in state 1
and button two is pressed button two goes in to state 1 and buttton one goes to state 0
but
if button one is in state 2 and button two is pressed and is in state 0 so it becomes state 1 do nothing to button one .
but when button two is pressed so it goes from state 1 to state 2
then reset button one to state 0.
so state 1 should only reset other state 1 and state 2 only other state 2
hope this clear it up a bit
will up load a file

mpc 40 back up.bmtp (64.2 KB)
its the presets in the botom of the list
Button Chift
and
Button normal
button Chift is the one with the three press
i know about the spelling !

When you say “reset” you mean to take other buttons to state 0?
So any time any button moves to state 1 or 2 the non-pressed buttons go to state 0?

yes
thats what i mean
except when going from 0 to 1 only changes the button in state 1 and going from 1 to 2 changes button in 2
since then all other buttons all ready are in 0
Im crap at explaining

OK, so tell me the Note number each of the 5 buttons send. Rather than try and evaluating your script, I can put something together to show how to do this with Bitmapping. Other than that, in rules, you will need to evaluate the state of each button and send either note-on or note off for each of the other buttons in a raw outgoing MIDI stream.

For instance say your note numbers are 01-05 and you are tracking their states in g1-g5

When you press button 5 you would set up rules to look at the state of each button
and send 90 01 g1 90 02 g2 90 03 g3 90 04 g4 90 05 g5.
If pressing button 5 you would set the value of g1-g4 to 0 and leave g5 in the current state.

Make sense?

yes it makes sense
my notes are 20, 18 , 10, 08, 00

OK, I put up an example for you.
I’m using a single variable as a bit map for the notes you are using with global variable ga
bits 0-1 is for the first note
bits 2-3 is for the second note
bits 4-5 is for the third note
bits 6-7 is for the forth note
bits 8-9 is for the fifth note.
What I do is look at which note is coming in and put that into a local variable.
I then clear the value of ga
Then I increment the value of the 2 bits, if it is greater than 2 I set it to 0
Then I OR the 2 bits with ga to make a modified ga with the note pressed.
Now ga contains a bit map of all 5 notes. I then set a timer to iterate through all notes and set the LED state based on their values. The timer also looks at each note’s 2 bit state.
Since you are not using consecutive note numbers I have some rules to:

  1. Translate the incoming note numbers to notes 1-5
  2. Translate the iteration number 5-1 back to the target note numbers.

I set the colors based on the state 0,2,2 in the iteration timer translator.

Exclusive Note-2020-11-24.bmtp (1.9 KB)

I know this bitmapping might seem more complicated but with it I can

  1. Use a single variable for all button states
  2. Clear all notes with a single statement ga=0

Steve Caldwell
Bome Customer Care


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

thank you
i was just trying some thing and im being stupid but im just not seeing it
this is a atempt to controll the other software
incoming note 90 20 7f
if if==0 then
exit rules, skip Outgoing Action
if if==1 then qq=9
if qq==9 then pp=127
exit rules, execute Outgoing Action
if if==2 then qq=8
if qq==8 then pp=0
exit rules, execute Outgoing Action

out going action
qq 20 pp
was trying to make it send a on note when 1 and an off when 2
at least i have voicemeeter set up like i like

Wow thats so many levels over my understanding
i think i blew a soft fuse in my head
think i need to sit down and do something mind numening easy like kill some people in cod
but thank you for your time and patience

Yes, sorry, I try to do things with as few translators as possible. Especially when you have a combination of 5 mutually exclusive buttons. Bit mapping is not for the faint of heart but is really effective if you know how to use it.

I make heavy use of the bit shift operators (>> and <<) the bitwise and operator (&) and the bitwise or operator (|). If you are not using ga and gc, it should be easily incorporated into your projects. If these global variables are already in use, you can still incorporate my project but change to use other unused global variables.

Sorry again for blowing a fuse!

Steve Caldwell
Bome Customer Care


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