sendVstEventsToHost
-
benfromshildon benfromshildon https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=96374
- KVRer
- Topic Starter
- 21 posts since 30 Jan, 2006
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
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
-
AdmiralQuality AdmiralQuality https://www.kvraudio.com/forum/memberlist.php?mode=viewprofile&u=83902
- Banned
- 6657 posts since 10 Oct, 2005 from Toronto, Canada
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.
Initialize it in your class constructor;
Then in your process loop, you just reference iSampleCount directly...
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.)
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..
}
Code: Select all
CBeatD::CBeatD(audioMasterCallback audioMaster) : AudioEffectX (audioMaster, NUMPROGRAMS, kNumParams)
{
// init
iSampleCount = 0;
//..etc...
}
Code: Select all
#define BEATPERIODINSAMPLES 44100
if (++iSampleCount > BEATPERIODINSAMPLES)
{
iSampleCount = 0;
// make a MIDI note...etc..
}
(Matter, doesn't.)
-
- KVRist
- 35 posts since 5 Nov, 2003 from British Columbia, Canada
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!
Thanks, once again good thread!
xFlat Xb
-
- KVRAF
- 2458 posts since 3 Oct, 2002 from SF CA USA NA Earth
-
- KVRian
- 1239 posts since 17 Jul, 2003
In 2.4 wantEvents has been deprecated but some host still expect it.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!
So, in resume call either the base class
AudioEffectX::resume();
or use this:
DECLARE_VST_DEPRECATED (wantEvents) ();
-
- KVRAF
- 1940 posts since 16 Aug, 2004 from Vienna, Austria