Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Strange distortion when automating CLAP plug-in parameters in DAW? #324

Open
lewloiwc opened this issue May 13, 2023 · 7 comments
Open

Strange distortion when automating CLAP plug-in parameters in DAW? #324

lewloiwc opened this issue May 13, 2023 · 7 comments

Comments

@lewloiwc
Copy link

https://github.com/baconpaul/clap-c99-distortion
https://nakst.gitlab.io/tutorial/clap-part-2.html
I tried both of these in Bitwig and they behaved as I expected with direct mouse modification of parameters and modulation by modulation, but with automation I got this strange distortion.
image

When I test the CLAP plugin in REAPER, it looks ok at first glance, but the automation in the moment of playback part does not seem to be working.
image

Is the code for these two CLAP plugins written correctly?
Or is the problem with your DAW such as Bitwig or REAPER?

What I'm imagining:
-The code in the two Clap plugins is fine
-Bitwig's CLAP plugin automation is buggy
-REAPER's CLAP plugin has a bug where the automation of the part at the moment of playback does not work.

Translated with www.DeepL.com/Translator (free version)

@lewloiwc
Copy link
Author

I feel certain that there is at least a bug in Bitwig.

Purple is the value of the parameter and green is the number of times CLAP_EVENT_PARAM_VALUE was called.
The manual operation was successfully called only once for BUFFER SIZE.
image

Modulation was also successfully called every 128 samples in buffer size.
image

However, automation calls every 128 samples in the first buffer, then calls only once in buffer size, and after a while it calls every 128 samples again.
The parameter values are also unstable.
image

What do you think?

Translated with www.DeepL.com/Translator (free version)

@lewloiwc
Copy link
Author

https://github.com/free-audio/interop-tracker/issues
I just found this just now.
I should probably post these issues over there, right?
Can I move the issues?
Or should I close the issue and repost it over there?

Translated with www.DeepL.com/Translator (free version)

@baconpaul
Copy link
Collaborator

it probably does belong in the inter-op tracker yes.
which version of bitwig and which OS would also help I am sure
Does surge exhibit the same behavior? That's different code than the c99 distortion. But I looked at the c99 distortion and i looks alright (albeit a bit convoluted) in how it processes events. I would not rule out a bug there though.

@lewloiwc
Copy link
Author

Windows 10 Home
Bitwig Studio 4.4.10
Sample Rate: 96000 Hz / Buffer Size: 1024 Samples
Surge XT 1.2.3.bb8dd2b

Also, when I was trying to check the Surge XT version, I noticed that you set the buffer size to 1024 samples, but Surge XT recognizes it as 32 samples, isn't that strange?
image
image

I checked Surge XT and found that this also had the same distortion when using automation.
image

Modulation is still fine, but I am concerned that Surge XT is doing linear interpolation with 32 samples, probably because it recognizes the buffer size as 32 samples.
image

@mkruselj
Copy link

mkruselj commented May 15, 2023

but I am concerned that Surge XT is doing linear interpolation with 32 samples, probably because it recognizes the buffer size as 32

This is by design of Surge and expected, though. Internal DSP processing of Surge is running in 32 sample sized blocks. This has nothing to do with your audio driver buffer size, it's an internal processing buffer.

@baconpaul
Copy link
Collaborator

That’s correct. Production surge has an internal block of 32 and uses the sample time of events to interneave with profess calls appropriately no matter the parent block size

how are you making these charts?

@lewloiwc
Copy link
Author

lewloiwc commented May 16, 2023

I didn't know Surge was designed that way! Thanks for letting me know!

The chart is made by setting the Surge XT oscillator to a high frequency sine wave, automating A Osc 1 Level, and viewing the output audio on a ReaJS oscilloscope.
bwproject→https://drive.google.com/file/d/1-h8Zp8qPrFfLElhi75cgqB6ZvDhK7Q-W/view?usp=sharing

I also asked Bitwig Support and they said "We are not aware of a problem with commercially released CLAP plug-ins,
I checked u-he MFM2, a commercially released CLAP plug-ins, and found the same distortion.

First, output an audio file with this setup.
Windows 10 Home
Bitwig Studio 4.4.10
Sample Rate: 96000 Hz / Buffer Size: 1024 Samples
MFM2 2.5 (revision 13385) (CLAP)
image
bwproject→https://drive.google.com/file/d/1-ZLAaBPHRIkGOXoF44fjfQpnjtPzk0qU/view?usp=sharing

Next, check the output audio file with an oscilloscope. The shape now looks smooth and problem-free, but that is because MFM2 has smoothed the values with a 1-pole low-pass filter.
image

This audio file is then used to calculate the curvature using the following calculation.
B = A;
A = input;
output = A - B;
image

If you zoom in on this, it will look like this
image

Isn't this exactly the same distortion as this one? The shape of the distortion and the timing of the distortion are also the same?
image

Translated with www.DeepL.com/Translator (free version)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants