obiwanjacobi / vst.net

Virtual Studio Technology (VST) for .NET. Plugins and Host applications.
https://obiwanjacobi.github.io/vst.net/index.html
GNU Lesser General Public License v2.1
420 stars 52 forks source link

TimeInfo properties not changing specifically in FL Studio #54

Closed SixBeeps closed 2 years ago

SixBeeps commented 2 years ago

Describe the bug The time properties provided by the host sequencer's TimeInfo instance (working with the default delay sample, look at AudioProcessor.TimeInfo) do not appear to be changing, even when the song is played

To Reproduce Steps to reproduce the behavior: 1.) Open any other DAW, I used both Ableton Live 10 Lite and Cantabile 3.0. 2.) Load the plugin as an effect and play some notes, time-based processing works. 3.) Open FL Studio and load the same effect onto a track. 3.) Play some notes, time does not affect processing.

Expected behavior TimeInfo.PpqPosition and other related properties return what they say they do

Desktop (please complete the following information):

Additional context To further explain how I know these values aren't changing, here are some relevant snippets of code from my plugin.

From AudioProcessor.cs:

private float GetBeatProgress() {
        return (float)(TimeInfo.PpqPosition % 1f);
}

From Heart.cs, the class which handles my plugin's logic:

// The result of GetBeatProgress() is passed on as beatProgress
public float ProcessSample(float sample, float beatProgress) {
        float pumpPercent = _parameters.PumpAmtMgr.CurrentValue / 100f;
        float output = sample * pumpPercent * beatProgress;
        return output;
}

This plugin applies a fake sidechain effect to the given signal. This works fine in other DAWs, but FL Studio in particular returns an empty signal. Furthermore, removing the beatProgress multiplier outputs a clean signal. Therefore, beatProgress is somehow kept constant at 0.

obiwanjacobi commented 2 years ago

What value do you have specified for _defaultTimeInfoFlags? If you want ppq to be valid you have to specify the PpqPositionValid enum value in _defaultTimeInfoFlags.

SixBeeps commented 2 years ago

What value do you have specified for _defaultTimeInfoFlags? If you want ppq to be valid you have to specify the PpqPositionValid enum value in _defaultTimeInfoFlags.

I had it set to the default VstTimeInfoFlags.ClockValid, but changing it to the value you mentioned didn't seem to have an effect.

SixBeeps commented 2 years ago

Ahh, it started working all of a sudden. Guess that change actually did work. Thanks!