Login / Register 0 items | $0.00 New @ KVR
NickCrow
KVRist
 
96 posts since 10 Nov, 2006, from Russia

Postby NickCrow; Sun Jun 10, 2007 12:10 am How to realize in VST plugin another process on mixdown?

Hi!

How to realize in VST plugin another process on mixdown? (I use VST SDK 2.4)

Thanks in advance.
User avatar
aciddose
KVRAF
 
11914 posts since 7 Dec, 2004

Postby aciddose; Sun Jun 10, 2007 12:55 am

you mean you want to detect when the host is rendering the output (not in realtime mode) and change your process based upon that?

if that is what you want to do, you can call getCurrentProcessLevel() in process(), processevents(), and resume(). hosts are supposed to update the process level and call resume before beginning to process events, however this will not always happen (naughty hosts) and so you will need to actually check on every call to process() in order to be sure. some hosts do not even support process-level and some may update it at odd (not useful) times.

if you want to write a plugin which follows the spec directly, you should call getCurrentProcessLevel() inside your resume() function. the levels should be 0 = realtime/normal, 1 = non-realtime/rendering, 2 = offline processing (i think?)

check the "sdk" headers for the comments about this function.

the sequence of events should be:

- plugin initialization
- setsamplerate() called
- host dependent initialization, opening editor, etc
- resume() called
if something changes in the host, for example rendering is requested, or the track is rewound and replayed:

- suspend() called
- the host changes it's internal flags and reconfigures things
- resume() called
- rendering calls to process()/others begin

like i said though not all hosts will behave in this way. some might go directly into offline processing or rendering without calling suspend()/resume() at all, and some may not bother to update flags.
NickCrow
KVRist
 
96 posts since 10 Nov, 2006, from Russia

Postby NickCrow; Sun Jun 10, 2007 9:59 pm

Thank you! I use getCurrentProcessLevel() value for switch process - it work (test in Cubase SX 3). In VST SDK 2.4 for rendering getCurrentProcessLevel() value = 2.
Miracles do not happen.
http://nickcrowlab.blogspot.com/

Moderator: Moderators (Main)

Return to DSP and Plug-in Development