“Toggled State” mappings
Another popular request answered by virtual mappings: a toggle switch that alternates with successive key presses.
Here the mapping line is mapped to itself: the value stored is Argument 1 of a Transform pipe is flipped by the Rescale at the end of the pipeline. This “reversed” value is then mapped back the Argument itself, changing it ready for the next key-press.
This Demo
Many “switch” Transforms can be placed in the same mapping line.
This Demo uses 3 switches (but you can add as many as you like)- each controls a Bypass in the demo line.
One Button CC version (no Generator Lines)
Here’s a two line preset showing just a CC10 being used to switch an input On & Off
VM3.1_Single_CC_Toggle.mhp
These diagrams show the message flow…
…when the CC10 button is pressed…
…and then pressed again…
(Check this with the MIDI Monitor at various pipes)