sendVstEventsToHost

DSP, Plugin and Host development discussion.
RELATED
PRODUCTS

Post

ahhhh

cool. Thankyou very much for help. I have put the numEvents line in and now have midi (of sorts) coming out. It did however max out my cpu which can't be good. but its a start.

Your help is very much appreciated.

thanks admiral...again...for the explanation of those two lines. It is slowly all becoming clear!

Thankyou.
Ben

Post

Its maxxing out cuz you're probably sending a MIDI message for every sample. Check your counter logic.

Make your counter a protected member variable of your effect so any member function can access it.

Code: Select all

class CBeatD : public AudioEffectX
{ 
//...blah blah...
protected:
int iSampleCount;
//..blah blah..
}
Initialize it in your class constructor;

Code: Select all

CBeatD::CBeatD(audioMasterCallback audioMaster) 	: AudioEffectX (audioMaster, NUMPROGRAMS, kNumParams)
{
// init
iSampleCount = 0;
//..etc...
}
Then in your process loop, you just reference iSampleCount directly...

Code: Select all

#define BEATPERIODINSAMPLES 44100
if (++iSampleCount > BEATPERIODINSAMPLES) 
{
iSampleCount = 0;
// make a MIDI note...etc..
}
You should probably brush up on your C++ before getting much deeper into audio code. Most of this is first-week (or even first day) stuff. ;) It's not hard, there's only a few big-picture concepts you really need to grasp. Sorry I can't recommend any good learning resources though I'm sure others can, it's been too long since I learned it (from a book! An actual real book made out of dirty, solid, matter, if you can imagine such a thing.)


(Matter, doesn't.)

;)

Post

I found this thread very useful for getting started writting my midi generator. However I found that this method doesn't work in the new vstsdk 2.4, I was totally stumped why nothing was happening but when I switched to 2.3 everything started working. Is there something else that needs to be set in 2.4 to get this to work? (using EnergyXT)

Thanks, once again good thread! :)
xFlat Xb

Post

Note also that many hosts don't accept VST events from plugins.
Image
Don't do it my way.

Post

xflat wrote:I found this thread very useful for getting started writting my midi generator. However I found that this method doesn't work in the new vstsdk 2.4, I was totally stumped why nothing was happening but when I switched to 2.3 everything started working. Is there something else that needs to be set in 2.4 to get this to work? (using EnergyXT)

Thanks, once again good thread! :)
In 2.4 wantEvents has been deprecated but some host still expect it.

So, in resume call either the base class

AudioEffectX::resume();

or use this:

DECLARE_VST_DEPRECATED (wantEvents) ();

Post

Also, make sure that your PlugIn supports the "sendVstEvents" and "sendVstMidiEvent" plugCanDo strings.
"Until you spread your wings, you'll have no idea how far you can walk." Image

Post Reply

Return to “DSP and Plugin Development”