From my own experience, generators never stops exactly where you want them to stop. If you want to use a generator make sure it stops after the value you want to reach, and clip the pitchbend value to the final value you want to reach when it exceeds it.
I usually prefer using the On TimerTick(ms : double) callback together with the TimeSinceStartup() function which give you an amount of ms since the start up.
How would you clip the pitchbend value to the final value you want to reach when it exceeds it, and how would you use the On TimerTick(ms : double) callback together with the TimeSinceStartup() ?
Yes, GigPerformer is a pleasure to work with and its capabilities and stability are amazing. I wrestled with Forte and Bome Midi Translator Pro and Copperlan etc, etc, etc for years and now I can configure a setup and recall it without holding my breath wondering whether it’s going to work. Thank you!
const
MinPitchBendValue : integer = 0
MaxPitchBendValue : integer = 16383
CenterPitch : integer = 8192
var
StartPitch : parameter MinPitchBendValue .. MaxPitchBendValue = CenterPitch
StopPitch : parameter MinPitchBendValue .. MaxPitchBendValue = CenterPitch + 100
TimeInMS : parameter 10 .. 5000 = 500
Trigger : parameter 0 .. 1 = 0
r : Ramp
lastValueSent : integer = -99999
function Go()
StopOneShotRamp(r)
TriggerOneShotRamp(r, TimeInMS , 50)
end
// Called when a parameter value has changed
On ParameterValueChanged matching Trigger
if Trigger > 0
then
Go()
Trigger = 0
end
End
On GeneratorEndCycle(time : integer) from r
var
newPitchMessage : PitchBendMessage = MakePitchBendMessage(StopPitch)
SendNow(newPitchMessage);
End
// Called by function generators as time passes
On GeneratorRunning(timeX : integer, timeY : double) from r
var
newValue : integer = Round(Scale(timeX, 0, TimeInMS, StartPitch, StopPitch))
newPitchMessage : PitchBendMessage = MakePitchBendMessage(newValue)
if newValue != lastValueSent
then
SendNow(newPitchMessage)
lastValueSent = newValue
end
End
On NoteOnEvent(m : NoteMessage)
Go()
End
When the rackspace is opened a popup says :
" Semantic error in “Main” : Line 2, Col 12:
Allowed in rackspace script only. This
Type is only allowed in backspace scripts"
It works fine when I dismiss the popup. And way around it?