Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* DUY Code: ARP Arpeggio example */
- /*
- * short example for remapping a CC (with a configurable midi channel)
- * PARAMETERS:
- * MIDICHN :0=16 (0=omni, 1-16 (1=default))
- */
- RK002_DECLARE_PARAM(MIDICHN,1,0,16,1); // accessable parameter/range via portal
- byte midichn = 0; // holds internal midi working channel
- // handler for param changes
- void updateParams()
- {
- if(RK002_paramGet(MIDICHN)==0){ // is omni setting?
- midichn=16; // 16 is all channels
- }else{ // minus 1 for internal midi channel 0=15
- midichn = RK002_paramGet(MIDICHN) - 1;
- }
- }
- // called automatically on paramchange in portal
- void RK002_onParamChange(unsigned param_nr, int param_val)
- {
- updateParams();
- }
- bool RK002_onControlChange(byte chn, byte cc, byte ccvalue)
- {
- bool thru = true; // pass original parameter yes/no?
- if ((chn == midichn) || (midichn==16)) // are we in working channel?
- {
- if(cc==10){
- // remap cc 10 to cc 18
- RK002_sendControlChange(chn,18,ccvalue);
- // add more if you want here
- }
- if(cc==11){
- // remap cc 11 to cc 19
- RK002_sendControlChange(chn,19,ccvalue);
- // add more if you want here
- }
- thru=false; // omit original CC
- }
- return thru;
- }
- void setup()
- {
- updateParams(); // set/load user conf. parameters
- }
- void loop()
- {
- }
Add Comment
Please, Sign In to add comment