Oh no, I wouldn’t recommend that approach. Too risky. Better to say them in an eternal file and then load them with Csound.
That’s odd. Although I don’t think it’s related, I did notice that zerodbfs
is no longer being using the ProcessBlock()
method. It should definitely be in there. All samples to and from Csound should be scaled by this. It should probably be something like:
public void ProcessBlock(float[] samples, int numChannels)
{
if (compiledOk)
{
for (int i = 0; i < samples.Length; i += numChannels, ksmpsIndex++)
{
for (uint channel = 0; channel < numChannels; channel++)
{
if (mute == true)
samples[i + channel] = 0.0f;
else
{
if ((ksmpsIndex >= ksmps) && (ksmps > 0))
{
PerformKsmps();
ksmpsIndex = 0;
}
if (processClipAudio)
{
SetInputSample((int)ksmpsIndex, (int)channel, samples[i + channel] * zerdbfs);
}
samples[i + channel] = (float)GetOutputSample((int)ksmpsIndex, (int)channel) / zerdbfs;
}
}
}
}
}
In most cases this is redundant because 0dbfs will be 1, but if some unfortunate user doesn’t set 0dbfs to 1 they will blow the ears off themselves. By default, 0dbfs in Csound is 2^16/2.