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?
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?
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…
probably catch a ControlChangeEvent
transform the particular value 65 (Edit I originally wrote 64) with something (not sure what)(stop the actual value from going though)
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
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.
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.
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.
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.
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).
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
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…