David Nahmani Posted January 15 Share Posted January 15 On 8/29/2017 at 1:42 AM, Dewdman42 said: Error produced is: GetParameter() called with an argument: (test) that does not equal any registered parameter name. I was frustrated getting that same error when trying to use GetParameter at the global level and a quick Google search led me right here! 😄 Thanks for this thread, I'll stop wasting my time trying to make it work. Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted January 15 Author Share Posted January 15 It might work if you put it inside the Initialize callback function. I haven't tried that yet, but if you need something fetched before any callbacks are happening, than that might work. if not then you have to basically do it in ProcessMIDI and keep a flag for whether it was done or not yet. Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted January 15 Share Posted January 15 2 minutes ago, Dewdman42 said: It might work if you put it inside the Initialize callback function. No, I just tried it and it doesn't work, I'm getting the same error. 2 minutes ago, Dewdman42 said: if not then you have to basically do it in ProcessMIDI Yes, it works inside ProcessMIDI or HandleMIDI. Thanks! 🙂 1 Quote Link to comment Share on other sites More sharing options...
Dewdman42 Posted January 15 Author Share Posted January 15 so just to clarify, the reason it doesn't work at the global level or inside Initialize...and only works in ProcessMIDI and HandleMIDI.....is not because its actually inside those functions. It's the timing of when its first called. the GetParameter function can't be called until scripter has completely bootstrapped itself. once it is bootstrapped, then you can put GetParameter inside any function that gets calle from that point forward, which basically includes ProcessMIDI, HandleMIDI, Idle, Reset and ParameterChanged. So when a script is loaded the following things happen to bootstrap it up, in the following order: the entire script is scanned from top to bottom to get all the function names, variables, etc all the global level code is executed from the top to the bottom. The Initialize callback function will be called (if you defined it) The PluginParameters internal structures are finalized in some way, this may be when the PluginParameters array is read and the GUI elements created, etc.. Finally, Scripter goes into a waiting mode where it waits for LogicPro to call the callback functions we all know and love: ProcessMIDI, HandleMIDI, Idle, Reset, ParameterChanged so basically you can't call GetParameter until step #4 above has completed, which unfortunately is after all the global code runs, and the initialize callback too apparently. 1 Quote Link to comment Share on other sites More sharing options...
David Nahmani Posted January 15 Share Posted January 15 3 minutes ago, Dewdman42 said: basically you can't call GetParameter until step #4 above has completed, which unfortunately is after all the global code runs, and the initialize callback too apparently. Ok great, that makes sense now! Still I think I'm going to experiment with the workarounds you listed in your 2nd post. 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.