Scaling midi assignments like MS? how to do this?

Hi GP community,

I’m trying Gig Performer as a possibly more stable alternative to MainStage for a specific project. It’s coming along quite good but one feature from MS I seem to miss is the ability to fine scale the in/out of a controller mapping. See the attached screenshot for one curve example that I would like to reproduce in GP. Is this possible? Scripting involved? Thanks!

Everything is possible with a few scripting. So, basically you want to control a GP widget with a MIDI controller ranging from value 0 to 127 and the output is intended to remap this range following your curve to transpose from -24 to +24 ?

yes exactly, important is that the values around the middle (63) are all outputting zero.

While it is possible to use scripting now to create non linear curves now, we hope to have GUI curves in our next update

5 Likes

You can test the following gig file:
rescaled_curve_transpose.gig (5.9 KB)

Which integrates this script:

//$<AutoDeclare>
// DO NOT EDIT THIS SECTION MANUALLY
Var
   PITCH_KNOB : Widget
   RESCALED_KNOB : Widget
//$</AutoDeclare>

function rescale(value : double) Returns double
Var
  rescaled_value : double;
  
  rescaled_value = 0;
  
  //originally a widget value ranges from 0.0 to 1.1 but the curve definition ranges from 0 to 127
  value = value * 127.0; 

  Select
    value < 47 Do rescaled_value = Scale(value, 0, 47, -24, 0);    
    value > 83 Do rescaled_value = Scale(value, 83, 127, 0, 24);    
  End

  // The MIDI in block plugin transpose ranges from -48 to 48 but its value ranges from 0 to 1
  rescaled_value = Scale(rescaled_value, -48, 48, 0, 1); 
  
  result = rescaled_value;
  
End

// Called when a widget value has changed
On WidgetValueChanged(newValue : double) from PITCH_KNOB

  RESCALED_KNOB.SetWidgetValue(rescale(newValue));
  
End

Such that you can check what happens, the first knob is controlled by your MIDI controller, the second one is modified by your rescale curve and controls the transpose parameter of an assigned MIDI in block plugin. This one way of doing it, there are other possibilities…

image

2 Likes

perfect, thanks, works like a charm!

somehow your script outputs -25 to 25, changing the -24/24 values to -23/23 narrows it to 2 octaves.

Oh, sorry, it is not clear why, but as you found a workaround, that’s fine. By the way I tried to make the script easy to understand with several rescale steps, but of course you can use only one if you prefer. It is also possible to address diectly the tranpose parameter of the MIDI in plugin within the script, without using a second widget. But one thing at a time :wink:

How do you like GP for the moment?

I like it! I think it has good potential, and if it proves as stable and CPU friendly as it seems to be, it will be a winner :slight_smile: I like the idea that if you’re missing a feature, you might very well be able to script it, I have to dig into that some more!

It does!

I like this too, however devs add also regularly new features.

1 Like