Set switch to send incremental CC values?


Mike Watkinson
 

So I’m having a go at programming the Uno2/FCB1010 to control Eventide’s Octavox plugin. I wish to use a switch to change the key that this harmoniser is set to, and it looks like I can set it up (via MainStage) to receive something like the following (using CC 83 as an example):
C# CC83 value 0-7
D CC83 value 8-14
D# CC83 value 15-21
etc
So can I set the Uno2/FCB1010 to send an incremental value each time I press the same switch? What I mean is:
Press 1 sends CC83 value 1
Press 2 sends CC83 value 8
Press 3 sends CC83 value 15
etc
Of course I could programme separate switches for each key, but I was hoping to programme 2switches to perform as follows:
‘key up by a semi tone’
’key down by a semi tone’

Thanks in advance :) 


ossandust
 

CHANNEL Octavox = 1
VAR $key = 1
 
TRIGGER_CLICK SemiToneUp =
{
   if($key < 121)
      $key += 7
   SendMidi Octavox CtrlChange 83 $key 
}
 
TRIGGER_CLICK SemiToneDown =
{
   if($key > 7)
      $key -= 7
   SendMidi Octavox CtrlChange 83 $key 
}


Mike Watkinson
 

Beautiful! I guess it helps to have a programmer’s brain (I do not lol)

I’ll give it a go and report back

On 13 Mar 2021, at 12:47, ossandust <ossan.dust@...> wrote:

CHANNEL Octavox = 1
VAR $key = 1
 
TRIGGER_CLICK SemiToneUp =
{
   if($key < 121)
      $key += 7
   SendMidi Octavox CtrlChange 83 $key 
}
 
TRIGGER_CLICK SemiToneDown =
{
   if($key > 7)
      $key -= 7
   SendMidi Octavox CtrlChange 83 $key 
}


Mike Watkinson
 
Edited

Ok so I have had a go at implementing the suggestions as follows:

Switch 9:
TRIGGER_CLICK Major Semitone up =
{
   if($majkey < 121)
      $majkey += 11
   SendMidi MainStage CtrlChange 90 $majkey  
}

Switch 10:

TRIGGER_CLICK Major Semitone down =
{
   if($majkey > 7)
      $majkey -= 11
   SendMidi MainStage CtrlChange 91 $majkey  
}

Switch 1 is set to do this:

EFFECT_ON major harmoniser = 
{
   SendMidi MainStage CtrlChange 80 127
   SendMidi MainStage CtrlChange 90 1
   $majkey = 1
   }

So the variable starts with value 1 when the effect is enabled, then the following values are sent by each press of switch 9:

12
23
34
45
56
67
78
89
100
111
122

which are mapped to 12 of the 18 key centres available in Octavox (which offers Db as well as C# etc which caught me out for a while!)

So far so good - thanks for the template!

BUT, the above only allows starting on C then working one semitone at a time through to B, then back again. What  I would like to also be able to do is start on C (which is what happens when the plug in is enabled) and go down say one step to B using the down switch (switch 10). At the moment I have to go up 11 clicks of the up swicth (switch 9) to get there. I have tried a few stabs at this using Else type statements but can't quite get the 'parsing' right.

What I think I am trying to achieve is something like 'if ($majkey < 7) then SendMidi MainStage CtrlChange 91 122' in addition to the lines above for 'TRIGGER_CLICK Major Semitone down' but not quite sure how to write it out correctly.

Any help much appreciated!