Detecting rendering?

DSP, Plugin and Host development discussion.
Post Reply New Topic
RELATED
PRODUCTS

Post

I'm 99% sure the answer is no, but does anybody know of a way to detect if a VSTi is playing in real-time vs. rendering?

I suppose I could compare the sample count to real system time. But Cubase has a real time export feature which would fool that. Also I'd only be able to detect that after some period of time had passed, and the render would have already started.

Why I'm wanting to do this is; I'd like my plug-in instrument to force highest quality during rendering. I guess maybe that's a bad idea as it takes control away from the user. Hell, maybe someone will even WANT the artifacts from lower quality? (In fact, I know some people will.) So I guess I'll just not bother. What I was hoping to avoid though was people who had set it to low qualility just to get through a real time performance/recording... then forget to set the quality back to maximum before rendering. Even if it could pop a dialog to remind them and give them the option of setting it, that would be great. Of course you don't want to deal with this every time you load the plug.

Oh well.

Post

How about getCurrentProcessLevel(). If it returns 4 then maybe set your quality to high? The question is though, how many hosts actually support this? Anyway, hope this helps :)

From the VSTSDK documentation:

Returns the hosts's process level. A plug is like a black box processing some audio coming in on some inputs (if any) and going out of some outputs (if any). This may be used to do offline or real-time processing, and sometimes it may be desirable to know the current context.

return
0 : Not supported.
1 : Currently in user thread (gui).
2 : Currently in audio thread or irq (where process is called).
3 : Currently in 'sequencer' thread or irq (midi, timer etc).
4 : Currently offline processing and thus in user thread.
other : Not defined, but probably pre-empting user thread.

Post

HEY THANKS FOR THAT! Missed that one. Will give it a try. :)

Post

FL has a "detect rendering" option in it's wrapper for VSTs.

As I recall from something in Looptalk when I was a newbie that FL's weird options for plug-ins are due to the fact that their dev team insists on meeting all the standards in the VSTSDK something or other but many VSTs themselves aren't made to rigorously meet those standards.

Hope that's useful info.

Post

Caco wrote:How about getCurrentProcessLevel(). If it returns 4 then maybe set your quality to high? The question is though, how many hosts actually support this? Anyway, hope this helps :)
Good one. Tunafish currently doesn't support this, but that was because plugins never seemed to use it. However, this smells like a chicken 'n egg situation so I'll add it in the next TF release.

Cheers!

Post

Xphraze & HALion also support "getCurrentProcessLevel" and have an option to switch to highest quality automatically.

Post

Michael Kleps from reFX wrote:Xphraze & HALion also support "getCurrentProcessLevel" and have an option to switch to highest quality automatically.
So how about Nexus? [Nudge nuge wink wink] :wink:

Post

Yep, will also have that option :hihi:

Post

Ok this is starting to sound like not such a whack idea after all. Thanks again everybody!

Post

I knew that there was an offline mode, but couldn't for the life of me remember how to check for it. In full offline mode, the plug can play the host and should have access to samples from anypoint in the sequence, but I doubt many hosts support that level of sophistication.

It's all in the initial Steinberg docs :)

DSP
Image

Post

A better option: put the "high quality" option ON THE GUI!! I don't want a plugin to sound different just because we're rendering, I want that superiour sound NOW!

That's how e.g. SFZ has done it: a quality control ranging from Draft to Superb, at your own control.
We are the KVR collective. Resistance is futile. You will be assimilated. Image
My MusicCalc is served over https!!

Post

BertKoor wrote:A better option: put the "high quality" option ON THE GUI!! I don't want a plugin to sound different just because we're rendering, I want that superiour sound NOW!

That's how e.g. SFZ has done it: a quality control ranging from Draft to Superb, at your own control.
Yes yes, but I didn't want people forgetting it's on "draft" is all.

Still not even sure I'm going to attempt this. Think I'll leave it up to the user. At first anyway... might add it later if I can make it work and it's not screwy across different hosts.

Post Reply

Return to “DSP and Plugin Development”