View Single Post
Old 10-19-2017, 10:32 AM   #2
goldenarpharazon
Human being with feelings
 
Join Date: Feb 2016
Posts: 189
Default

One will need to write some simple code in the @midimsg section that tracks the state of the button using a flag variable in the OSCII-bot (EEL2) code.

Firstly one can just ignore the button release midi message entirely unless the release is wanted for other reasons e.g. to do something with the button's LED state: the release is not of interest since you want successive button presses to act as a toggle.

Then one can just write some code that
- detects the press and sets a "flag" on the (first) press if the flag is not clear
- clears the flag on a press if the flag is already set.

Then if the flag is set it is a first press and if it is clear it is a subsequent press etc etc and you send the corresponding appropriate OSC output value. The flag's value creates the toggle function.

Conventionally flags should have the values 0 and 1 which then makes them easy to use in the EEL2 "if" statement.

It's a shame the APC Mini doesn't come with any editor for its midi mappings to create a toggle but Akai are expecting it will only be mapped to Ableton.
goldenarpharazon is offline   Reply With Quote