What is the recommended way to notify the Controller of MIDI events from the Processor class ?
For example with every note on event, I want to update the UI to show the name of the pressed key in a label. How can I go about achieving this ?
Is there any code example in the samples or else where where one can see this in action ?
I saw vuPPM code in Again but that handles parameter changes. I am looking for ways to handle events.
I looked at the keyboard implementation hoping to see it highlight note on events on the keyboard in a different color but it does not seem to be aware of external MIDI events
If you should need to exchange more data than just parameter changes, such as tempo, sample rate, FFT, Pitch Analysis, or any other data resulting from your processing, you can use the IMessage interface (see AGain example). However, you need to be careful and send the data from a ātimerā thread and not directly from the process function, for example, when sending from a āprocessā call.
So does this imply that the simply implementing iNotify interface is not the solution and that I need to manually spawn a new thread using std::thread and then join at the end ? Can you please share some example on this ?
Thanks. Iāve found thereās not much help with this SDK available and so Iām trying to do my part if I can. But Iām no expert. Iāve come to really appreciate the depth of documentation one gets from the likes of Microsoft. With VST3 I find myself constantly trying to figure out how to invent the wheelš¬
This forum is disappointingly inactive but maybe people just give up due to the silence.
By the way you also need this in your controller.h and processor.h
Ah yes, I totally relate to that. With scant documentation progressing with my first attempt at some serious plugin work is slower than I would have liked it to go .
I almost forgot about this thread. Then after posting and not getting any replies, I started working on some other aspects of my plugin hoping to get back at this at some later point of time.
@spoonman2 May I ask how/where you spawn that sendThread?
I have tried similar approach creating a std::thread, detach it and sleep for some milliseconds for every callback but I get failing tests from the validator so it ends up with a build error for me
I was trying to create the thread in another function/thread in the Processor class. Which does not make any sense for what I want to do. Your reply inspired me to put the thread creation inside the process function call and it worked immediately
Iām afraid, this is not the solution. You should not create a thread inside the process function. To better understand what is allowed inside the process function read this nice blog post about it.
I suggest you use read-only parameters for this. This kind of parameters are perfect for this. You donāt have to worry about threading issues and as a bonus parameters are synced to the audio.
@Arne_Scheffler this only works if the amount of data you need to communicate is a) small b) can be represented as a value between [0, 1] (which is what vst3 parameters are limited to). That would obviously work for just sending a āpeak valueā.
If the controller and processor are on the same computer you can misuse a read-only parameter to transmit ordinary 64bits to the controller. But sure if you want to be prepared for the case that the controller is not on the same machine as the processor than youāre right.
The next SDK update contains a solution for sending data (even big amount of data) from the realtime context to the controller in an easy and safe way.