I tried searching for any threads re sharing of pangoscript code and couldn't find anything, so figured I'd start this thread as a place to paste anything you might find useful.
Dual (or more) purpose faders :
(This assigns a toggle button to shift the faders to allow for a second purpose for them, and could be modified for multiple shift buttons or multiple presses of a single shift button to cycle through more functions)
To start with add this to initialization script (under the scripting tab of the midi controller settings)
Code:
globalvar myfadershift
myfadershift = 0
The either run the initialization script or exit and restart beyond
Then choose a button you want to use for the shift function, in this example I used #1 of the track selection on the apc40 (90 33 xx and 80 33 xx)
So under 90 33 xx in pangoscript setting under the midi controller add this
Code:
if (myfadershift = 0) goto toggleon
if (myfadershift = 1) goto toggleoff
toggleon:
myfadershift = 1
MidiOut 0x90, 0x33, 0x7F
exit
toggleoff:
myfadershift = 0
MidiOut 0x90, 0x33, 0x00
exit
Then I'll use fader #3 in this example (B2 07 xx)
Add the following code under b2 07 xx (using brightness and scanrate as examples, modify as needed)
Code:
if (myfadershift=0) goto scanrateset
brightness ExtValue(0,100);
exit
scanrateset:
ScanRate ExtValue(0,200);
exit
Of course you'll need to modify this code as needed and apply to any fader you want a double function for.