musikinformatik / SuperDirt

Tidal Audio Engine
GNU General Public License v2.0
524 stars 76 forks source link

amp parameter scaling #271

Closed Bubobubobubobubo closed 2 years ago

Bubobubobubobubo commented 2 years ago

Hi,

Technical setup

Hi. I updated my whole Tidal toolchain recently and started having issues with the way # amp is being handled by SuperDirt. Before updating, using # amp 1 was playing any sample at full volume, without any additional saturation or clipping. On the current version I am running, without any other modification, # amp 1 is now clipping hard and producing a very saturated and dirty tone.

Initially, I thought that the problem was coming from my audio interface or even from Ableton Live that I use for limiters / compression. However, even at -32db on an Live track, you can still hear very clearly that the audio signal is coming in too hot.

I started experimenting and found what I consider to be a safe value: 0.0055 ~ 0.0095. It is pretty much as loud as # amp 1 was before updating.

Have you ever encountered a similar bug? I can provide audio samples as examples if you wish. They are currently uploaded in the #superdirt-supercollider channel of the Tidal Discord channel.

Thanks for your work on SuperDirt!

telephon commented 2 years ago

so you need to trace the path of the amplitude. As a first step you can define this synth function (untested, but I think it will work):

~dirt.soundLibrary.addSynth(\info, (play: { "incoming values – amp: % gain: %".format(~amp, ~gain).postln }));

and send from tidal some values with s "info" # amp 0.2

Then you know on which half the problem is.

Also, try to play some normal synth in SuperCollider:

{ SinOsc.ar(270) * 0.1 }.play

Does this distort? Then you know on which half of the half the problem is ...

Bubobubobubobubo commented 2 years ago

I ran the first test and the values are good: amp 0.2 and gain 1.0. The problem might come from SuperCollider itself. The oscillator is not distorted / clipping with * 0.1 but it's very easy to jump over the fence with values like * 0.2~0.5, with * 1.0 not being the usual very loud sine that SC plays by default but a highly saturated/clipping version of it.

I'll try to investigate from here. It might be better to close this issue for now. It looks like the issue does not come from SuperDirt indeed.

telephon commented 2 years ago

Please do post your findings here or on the sc repo, and we can see where it is hidden.