Midi Controller help

I have an old AlphaTrack midi controller. I’m trying to hook up a rotary knob of the AlphaTrack to a pan parameter of a plugin via a rotary knob widget.

The AlphaTrack sends channel 1, cc 16, value 1 for one direction and value 65 for the other direction. This doesn’t work fully work. Selecting ‘catch’ and ‘relative offset’ does work when turning the knob in the ‘value 65’ way .

I’m thinking GP expects a different value… any idea what it is and how I go about intercepting and transforming the value via gscript?

Your controller is in relative mode and you have to change this. Formerly, GPScript was the only solution, but now you can use Rig Manager for this:

Define your control in Rig Manager, right-click on the alias name you defined for it and change the ‘control mode’ for the one which works for you.

1 Like

Thanks for the response. Ok did what you said but I still have a problem. None of the control modes work properly.

My physical device outputs a 1 value when turned left, and 65 when turned right. (Edit… I originally wrote 0 and 64) Only when I select ‘relative mode’ will it partial work… the widget knob ticks left as I turn the physical knob left (what I expect). Turning the knob right and the widget knob snaps all the way to the right.

It’s not clear what value ‘relative mode’ expects to work properly. Any ideas?

Well I just checked and you 0/64 coding is not part of the implemented coding.

Yes, a Gig GPScript. What are all the CC# you would like to convert for using with GP?

Thanks!

AlphaTrack broadcasts that particular knob on Channel 1 CC 16.

No other CC# than the CC 16? It will be the same price if I add all the controls in the GPScript :wink:

1 Like

Oh!! Thank you. You don’t have to write an entire script for me! I just need a code snippet and where to put it to continue. Even a verbal explanation would be enough. I can figure out the others after that.

I’m thinking…

  1. probably catch a ControlChangeEvent
  2. transform the particular value 65 (Edit I originally wrote 64) with something (not sure what)(stop the actual value from going though)
  3. inject new CC back in. (InjectViaRigManager??)

Not sure where this happens.

1 Like

OK, that’s a good way to learn. So, this is what I would do:

  • put the GPscript code int the Gig GPScript editor, here it will modify the CC16 before it enters in the MIDI in block
  • indeed you can use Rig Manager if you want to define your controller
  • On ControlChangeEvent matching 16 from YourControlerAlias is a good start
  • you will have to use a variable to hold the absolute value of the CC16
  • if the CC value is 0, decrease the CC16 value variable or increase it if it is 64
  • inject the CC back as you described is also correct

So, what is the code you propose? :wink:

Ok… by trial and error and looking at previous code you wrote in another post I got it working.

The magic numbers I needed to get ‘relative mode’ to step one value left/right are 65 and 61. By decreasing or increasing these I can get it to step more than one. Probably some bit shifting math behind it all but I don’t want to spend the time reverse engineering anymore than I have to. Lol.

Thanks for your time and effort helping me.

Jeff

I put this in the ‘Gig Script’ Editor.

Var
  AlphaTrack : MidiInDeviceAlias
 
On ControlChangeEvent(m : ControlChangeMessage) Matching 16 from AlphaTrack
    var 
        value : Integer = GetCCValue(m)
        
    if value < 10 then
        m = MakeControlChangeMessageEx(16, 61, GetChannel(m))
    end
    
    InjectMidiEventViaRigManager(AlphaTrack, m)
End
2 Likes

Congrats for your first GPScript. My idea was to get rid of any additional relative mode conversion, i.e. something like the following untested GPScript:

EDIT: THIS GPSCRIPT SOLVES AN UNEXISTING ISSUE AS THE CONSIDERED CONTROLLER FINALLY DOESN’T PRODUCES 0 AND 64 VALUES, BUT 1 AND 65 WHICH IS PERFECTLY HANDLED BY GP AND ITS RIG MANAGER OUT OF THE BOX. :wink:

Var
  AlphaTrack : MidiInDeviceAlias
  CC16_value : Integer = 0
 
On ControlChangeEvent(m : ControlChangeMessage) Matching 16 from AlphaTrack
    var 
        value : Integer = GetCCValue(m)
        
    if GetCCValue(m) < 64 then
    then
      If CC16_value > 0 then CC16_value = CC16_value -1 end
    else
      If CC16_value < 127 then CC16_value = CC16_value+1 end
    end

     Var msg = MakeControlChangeMessageEx(GetCCNumber(m), CC16_value, GetChannel(m))
     InjectMidiEventViaRigManager(AlphaTrack, msg)
End

But let’s come back to your code. Are you sure it is your last working version? Because if your controller produces CC16 with values 0 and 64, your code doesn’t convert anything to 65. I also think the magic values you are looking for are 65 and 63. If I remember well, 61 will also work, but will decrease the values by steps of 2.

Hi David,

My mistake… AlphaTrack was outputting 1 and 65, not 0 and 64. The value 65 works fine without change in GP. It was the 1 value that messed up. My trial and error method of substituting with 61 works perfect so I’ll just leave it with that. There are cases where if I spin the knob fast enough, it’ll send out incrementally higher numbers but I’ll leave things for now.

Thanks, I appreciate the help.
Jeff

Ok, we were wondering with the devs if we should add one more relative mode conversion, so it is good to know that is is not necessary as it already works out of the box. Don’t use GPScript without a very good reason, it is not very clean. :thinking:

Actually, it only partially works, the script is still necessary.

To sum it up…

  • AlphaTrack outputs the value 65 when turning a knob left. GP’s knob increments by 1. (good)
  • AlphaTrack outputs the value 1 when turning a knob right. GP’s knob jumps a lot in the other direction. (bad)
  • I use the script to change the 1 to a magic 61. Now GP’s knob increments by 1 in that direction.

Jeff

I suppose that turning a knob left (value 65) should decrement by 1, while turning a knob right (value 1) should increment by 1. Then remove the Gig GPScript and chose the ‘Signed 2 bit’ relative mode, then it should work without scripting. (Choose ‘Signed 1 bit’ if you want to change the value in the other direction).

There is no ‘signed 2 bit’ option and ‘signed 1 bit’ does not work.

If your controller is like you described and no Gig GPScript is running, both ‘Signed 1 Bit’ and ‘Signed 2 Bit’ should work, but one of this mode should be in the wrong direction

Which exact GP version are you using ?

Signed 2 bit is renamed to Signed Magnitude :slight_smile:

1 Like

I’ve tried all of those options and none work. That’s what brought me here.

V 4.8.12

If you confirm that you tested the right mode without Gig GPScript, will try to simulate what your controller is producing in order to check the Rig Manager relative mode conversion. But I doubt the Rig Manager conversion doesn’t work well… :thinking:

I think it is me who requested this naming change which is indeed correct :grimacing::