Shared state - increment and decrement Topic is solved

Need help with Midiflow? Ask here!
Jwsadler
Posts: 9
Joined: Sun Sep 01, 2019 3:56 am

Shared state - increment and decrement

Post by Jwsadler »

I am using an IK Blueboard and OnSong to control a Peavey Vypyr Pro amp via Midiflow. In its default mode, the Blueboard outputs PC00-PC03 respectively for each of its four buttons. I would like to use two of the buttons to form an increment / decrement pair. The desired behavior is to cycle through PC00-PC03, where pressing button A increments the PC number stopping at 03, and pressing button B decrements it, stopping at 00.
For example, the following sequence

Button A -> PC00 —> midiflow outputs PC00
Button A -> PC00 —> midiflow outputs PC01
Button A -> PC00 —> midiflow outputs PC02
Button B —> PC01 —> midiflow outputs PC01

In order to do this in a coordinated way there needs to be some shared memory of the last output PC number so that the next incoming message can increment or decrement from the shared value.

Is there any way to do this in Midiflow? If not, please consider adding a named register that can be used this way.
Jwsadler
Posts: 9
Joined: Sun Sep 01, 2019 3:56 am

Re: Shared state - increment and decrement

Post by Jwsadler »

One more application of a register:
In my application OnSong selects a bank and a PC to configure the amplifier when a song is selected. I’d like to capture the PC argument (00-03) in a register and have the increment / decrement buttons on the Blueboard increment and decrement from this value. Without a shared register, the increment button on the blueboard would start at PC00 and increment to PC03, and the decrement button would start at PC03 and work down to PC00, regardless of what Onsong or a prior button press did.
User avatar
Johannes
Site Admin
Posts: 138
Joined: Mon Mar 25, 2019 3:06 pm

Re: Shared state - increment and decrement

Post by Johannes »

Hi,
this is already on the todo list, however, only in a way that both buttons send the same controller number (like CC1), but different controller values on the button press.

Best,
Johannes
Jwsadler
Posts: 9
Joined: Sun Sep 01, 2019 3:56 am

Re: Shared state - increment and decrement

Post by Jwsadler »

Will you be able to make that work for PC events as well?
It seems to me that PC increment and decrement would be a common use case.
Jwsadler
Posts: 9
Joined: Sun Sep 01, 2019 3:56 am

Re: Shared state - increment and decrementAccepted answer

Post by Jwsadler »

It looks like you already have a feature that does exactly what I wanted, as long as I start with the Blueboard in MIDI mode 2, where it emits CC events rather than PC. In the case of a CC remapping, select Increment mode, and at the bottom of the Increment dialog is a section titled “controller for decrement” - this shares state with the increment channel. I then selected PC as the output controller, and MidiFlow puts the argument in correctly. Thanks!
User avatar
Johannes
Site Admin
Posts: 138
Joined: Mon Mar 25, 2019 3:06 pm

Re: Shared state - increment and decrement

Post by Johannes »

Indeed! :-) It works if you use two different controllers (like CC1 for incrementing and CC2 for decrementing), but not, if you want to use the same controller for both. The latter is on the todo list.