Vsti Host Development Some VSTi's require a wait before processing samples???

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

Post

Ladies and Gentlemen. I've been on this forum for maybe a year now. Never needed to ask a question because - most questions have been answered - 20+ years in the field (Developer), you learn to look first.

THIS is an UNUSUAL problem. I am just about ready to release a eval version/new software package and this issue has popped up a few times. There's a option in the software(HOST) (It stores the MIDI notes with the Chunk) - that lets you click on the file and it plays the melody (Quick Preview of your saves).

I parse the Notes, Load the Plug-in, load the chunk and yank the samples (calculated time for sample count) and just play the audio. BUT with some pluggins I recieve SILENCE about a BAR/MEASURE - Like the program NEEDS to wait a second before processing the audio. Using Microsoft Visual C++... in the debugger - A break point and quick continue and the AUDIO is there. No Break point only PARTIAL audio. I have about 50 pluggins for testing - and this occurs with 7. Two(2) of them in Kontakt ALTHOUGH the others in Kontakt work beautifully.

So the question is - IS there a REASON?? And is there a way to Check if Synth is Ready. Any Info would Help...

Just for the record - I process the following;

1) Load the Plugin (standard)
2) Process a Suspend (effMainsChanged)
3) Set/load the chunk
* (effBeginSetProgram)
* (effSetChunk)
* (effEndSetProgram)
4) Process a Resume (effsMainChanged)
5) Process MIDI and Samples Directly to Audio

(Just lighting fast straight thru...)

Thanks folks (in advance).

Post

First sanity check that the plugins in question don't report significant latency (ie. initialDelay field in the VST structure). It would seem odd for instruments to have much (since more than a dozen milliseconds or so tends to make things unplayable for humans), but you never know. Obviously if they do report latency, then you would want to compensate for that.

If you are calling processing with a large block size, see what happens if you make it smaller. In theory you'd expect plugins to handle MIDI time stamps properly, but there might be the odd few that don't. Also when you send MIDI events and then call process, make sure to keep the events list around until the process() call returns (since a lot of plugins are likely to just store the pointer and then parse the events during the next process() call; failure to do this would likely lead to crashes, but you never know).

Other than that, no ideas right now.

Post

mystran wrote:First sanity check that the plugins in question don't report significant latency (ie. initialDelay field in the VST structure). It would seem odd for instruments to have much (since more than a dozen milliseconds or so tends to make things unplayable for humans), but you never know. Obviously if they do report latency, then you would want to compensate for that.

If you are calling processing with a large block size, see what happens if you make it smaller. In theory you'd expect plugins to handle MIDI time stamps properly, but there might be the odd few that don't. Also when you send MIDI events and then call process, make sure to keep the events list around until the process() call returns (since a lot of plugins are likely to just store the pointer and then parse the events during the next process() call; failure to do this would likely lead to crashes, but you never know).

Other than that, no ideas right now.
Sorry - I didn't see this until now - On a few of the forums you are notified?!?! I have to check the settings here. BUT THANK YOU FOR THE RESPONSE :) - Latency - I didn't think about that! "Large block size" - Nope and IN FACT I was thinking about increasing its size to speed it up a bit. I'm Good on the MIDI events... In fact I've been running up and down the Host functions to be sure. I have it open now to review with fresh eyes. LOL - After setting breakpoints at different locations in route thru the steps I'm getting the 2 different results (Missing Samples in the beginning OR wait was enough time and the samples are there). I'm thinking - I'm missing something...

The software (Free version will be avail) was an idea to throw away track interface rules (sorta like ableton). So its built on concepts - No libraries - from bottom up everything written from scratch. So VSTi support is handled differently (in multiple ways). On need - the ability to pull the audio instantly.

AGAIN - THANK YOU SIR - for the quick response. I will double check your ideas in a few moments!

Post

aweonline wrote: Sorry - I didn't see this until now - On a few of the forums you are notified?!?!
There is email notification system for threads you subscribe to, but I think you have to go to the profile settings and nudge the option to automatically subscribe to whatever threads you post into. It at least used to default to no.

Post

Just a note that the latency may (should) be written by the plug-in as part of the Resume (effsMainChanged), there is no better place to do this.
Checkout our VST3/VST2/AU/AAX/LV2:
Inner Pitch | Lens | Couture | Panagement | Graillon

Post

OKAY NEW DETAILS!

It’s not latency. I was just about to say forget it on these few packages – and call it a quirk. But in the back of my mind – I kept thinking I’m going to regret this if I do (I’ve been a coder to long –ha ha ha).

So – for some reason I revisited the HOST Dispatcher (Callback). Turned back on the log and LOW-AND-BEHOLD!!!! What is the purpose of “audioMasterGetCurrentProcessLevel “. Only information I could get was in the “REAPER” forum (when I googled).

I was returning a 0 (kVstProcessLevelUnknown) when this is called. When I changed it to 4 (kVstProcessLevelOffline) . Audio came streaming thru. I’m going to try all the options – maybe toggle a switch when the host loads it in this manner. Feel free to Educate me on its purpose. :)

NOTE: This is the closing of a 1 year project of mine. Theres a time when you have been programming for Companies so long – you feel like “It’s time to create your own”. I’ve had many ideas for a NEW DAWS – Automating everything to focus on creativity and NOT the software (Aligning clips on a track, etc). So the look and feel is totally different. BUT Smoother, faster – in creating music from the bottom up. The VST engine, I wrote from scratch (you don’t know whats happening if you don’t write your own) and researched libraries to fill in the holes. So I still have a lot of questions. LOL.

I will be sharing this with KVR. While Music lovers, Producers, Composers will be testing its work flow – Many of you are programmers and can have a different perspective on Tweaking its work flow. I will be OpenSourcing a light version of the Multi-Mixer Library after the Evaluation package is released. STILL OPEN to ANY information about what I found. :)

Post

OH and THANKS AGAIN - " Guillaume " and "Mystran""

Post

I have absolutely no clue about host programming, but "offline proces level" sounds an awful lot like the rendering state that would be sent to a plugin, where "offline" means the host is in full blown export rendering mode where audio doesn't have to be processed in realtime, and "online" or "live" or something in that direction would mean the host has to do processing in realtime since the audio also needs to be played back. I assume that reporting an "unknown" state there could screw with a plugin that always expects to know whether the host is in realtime or non-realtime mode, since a bunch of plugins have the ability to switch their processing quality based on the host's rendering mode. Low-CPU processing in "online" mode to avoid crackles, full High-CPU processing in "offline" mode to sound better. I might be totally mislead here, but the keywords sound like it may have something to do with this.

Quick google tells me I might not be off track.
https://forum.juce.com/t/vst-2-4-detect ... ring/12477
Confucamus.

Post

aweonline wrote:Just for the record - I process the following;

1) Load the Plugin (standard)
2) Process a Suspend (effMainsChanged)
3) Set/load the chunk
* (effBeginSetProgram)
* (effSetChunk)
* (effEndSetProgram)
4) Process a Resume (effsMainChanged)
5) Process MIDI and Samples Directly to Audio

(Just lighting fast straight thru...)

Thanks folks (in advance).
Are you doing all of this in the same thread ?

1,2,3,4 should be done from your UI thread.
5 should be done from your audio thread.

Many plugins assume these 2-threads architecture and will not work properly if you process midi and samples in the UI thread.

Post

Not sure if you have seen this:

enum VstProcessLevels
{
//-------------------------------------------------------------------------------------------------------
kVstProcessLevelUnknown = 0, ///< not supported by Host
kVstProcessLevelUser, ///< 1: currently in user thread (GUI)
kVstProcessLevelRealtime, ///< 2: currently in audio thread (where process is called)
kVstProcessLevelPrefetch, ///< 3: currently in 'sequencer' thread (MIDI, timer etc)
kVstProcessLevelOffline ///< 4: currently offline processing and thus in user thread
//-------------------------------------------------------------------------------------------------------
};

Post

THANK YOU!!!! ALL!!!

Rockatansky, Big Tick, Keith99... You are All correct!

I'll try to make this quick. This is what I'm doing. Imagine the Mix Track. Sometimes you would highlight say 8 bars, to loop thru - while you work. You have to align and duplicate smaller clips. Now imagine you just click that region. A Pianoroll pops up and you place - 1 Bar Piano stab of C-Major in the C-Major scale. When you close the Pianoroll its auto aligned and auto filled in that region. Now C-Major stab for 8 bars is boring. So you get a Matrix Sequencer - to the left is the cord progression for what scale you are in. You just move the squares until it gets the melody you like. Now you click the track beneath it... create a Trumpet line on G. for one bar. When you close the piano roll, its melody changes to match the piano roll. You don't need to know the scale to know the chords - it handles that for you (Old school band member, I've seen all the youtube videos about chord progressions - so many working with daws need the help).

SO NOW... When you create a instrument - I combine the chord/arpeggio with the VSTi Bank. (The melody is recyclable because you just load it and change the sequence again). Like playing a Song on piano this week. and another song on the same piano next week. BUT you may want to preview these saved instruments - So its just a previewer that allows you to click on it. It LOADS the instrument pulls the audio (MIDI to sample correct) and plays the audio.

SO YEP - BIG TICK, It is one THREAD :) NOPE Rockatansky, I did not know this... going to look at the link you had. AND YES Keith99 I found that this morning - LOL LOL LOL :) ...

BIG TICK - This works beautifully now... I just toggle it in preview mode and things are rolling. You can now tell if it was a sustained instrument, JAB, arpeggio etc.

You all have been very Helpful - I promise to get you a link to the VIDEO on the package, and download link - Monday I have to get Code-Signing from one of these companies and it will be ready to roll. OH YEA - and the reason I didn't focus on learning PLUG ins is because there are so many Unique and Powerful ones out there from you and the others. Standard mixing track software - about 100+ with a new one that came out a few months ago. It was time for something new - unique... But it needs to handle the things you all develop like any other professional package. So my study was on the host and my concept. YOU GUYS been GREAT!

Post Reply

Return to “DSP and Plugin Development”