Trying to use SendNow function and getting the following:
Syntax Error in “Main”: Line 5, Col 4: Unexpected or unrecognized token: ‘SendNow’
Is has the function been retired / renamed?
Thanks
Trying to use SendNow function and getting the following:
Syntax Error in “Main”: Line 5, Col 4: Unexpected or unrecognized token: ‘SendNow’
Is has the function been retired / renamed?
Thanks
Please show us your GPScript ![]()
for a midi out block you need to use this function
SendNowExternal(…)
how looks the wiring view?
There is no NoteOnMessage function
MakeNoteMessageEx(<number : int>, <velocity : int>, <channel : int>)
Still no joy… For context, what I’m aiming for is to send a midi message back to my keyboard once a rackspace is activated (such that the LED, on the pad I’ve just pressed, lights up)
I’m sure there must be a post elsewhere that I can tweak for my use case (if so please let me know), I’ve already gone down a few rabbit holes on this with no success sadly
Why did you change the code this way?
You have to use a handle for your midi out block.
You did that in the previous code.
Random changing of multiple items will just lead to confusion and frustration
Use MakeMidiMessage3(0x90 + (chan - 1), note, vel) and MakeMidiMessage3(0x80 + (chan - 1), note, vel)
Var TestOut: MidiOutBlock
On Activate
SendNowExternal(TestOut, MakeMidiMessage3(0x99, 36, 127))
End
On Deactivate
SendNowExternal(TestOut, MakeMidiMessage3(0x89, 36, 0))
End
The compiler clearly states what’s the actual issue: “Too many parameters”
…so, why is that??? Something has to be wrong!
And since there are only two functions in use, it must be either SendNowExternal or MakeNoteMessage
A brief consultation of the GP-Script Functions List (find the list in GP’s “Help” menu, under “documentation”) would have instantly showed you how the function’s syntax had to be used…
To make it short: The function MakeNoteMessage only uses two parameters (note number and velocity), but you used three (additionally using a channel number).
Hint: There is another function which looks very similar, and which uses three parameters (note number, velocity, channel number)!
Your “homework” will be to find the right one! ![]()
The best tool to find an available function is to use the “Code Helper” utility in the script-editor window:
Just make sure you have the code window large enough to have some free space below the last line of code, then activate the “Code Helper” and start to type what you are looking for…
The list of functions that contain the text of your entry will then show up as you type.
You can then choose the right function by doubleclicking the line or use the cursor keys and press enter to accept that function and add it into your code window. A single click or line change will show you a short explanation of the function. Pressing Escape will quit the Code Helper.
I hope this will help you with other upcoming problems.
I think I found it, but I keep it for me ![]()
![]()
Yeah… the best way is “learning by doing”!
Another helpful strategy if you don’t know what exactly is wrong is splitting up oneliners in multiple statements. This way the compiler messages are easier to interpret.
Then, when the parts are working, you put everything back together (if you want that)
Thanks to everyone who has contributed advice/suggestions - really appreciate the guidance.