faustlibraries
faustlibraries copied to clipboard
CZ Oscillators: add anti-aliased versions
Is there any way to decrease the amount of repeated text, mostly in the comments?
The current fund2freq implementation doesn't update when the fund jumps.
I wrote an algorithm to avoid that, but I'm not sure if there's enough benefit to warrant the added complexity.
fund2freq(fund) = delta*ma.SR
with {
rawDelta = fund-fund';
absDelta = abs(rawDelta);
jump = absDelta>0.5;
posDelta = select2(jump,absDelta,1-absDelta);
delta = posDelta*select2(isPos,-1,1);
isPos = (rawDelta>=0)
<: select2( jump, _, (1-_) );
};
Any news on this?
Do you have any example code, showing the anti-aliased effect ? Any picture?
I tested by ear.
Should I write some code that does a sweep and then make a screenshot of the spectrum?
Yes this could be great.
In case it's useful, here is the test program I wrote for the existing alias-suppressed sawtooth oscillators and their derivatives:
// bandlimited sawtooth tests
ol = library("oscillators.lib");
ba = library("basics.lib");
amp = 1;
freq = 100;
process = par(i,6,i*0.1+ol.sawN(i+1,freq));
// Use faust2octave to look at 20*log10(abs(fft(faustout)))'
@josmithiii Thanks, but I don't get it. Isn't that just 6 detuned saws at about 100Hz? How does that help to show anti-aliassing?
Here is an example together with the spectrum from Octave (it's GIF but GitHub is complaining about it - will try again if it's no good):
amp = 1;
freq = 1200;
//offset = 0.1; // for visual separation in time domain
offset = 0;
process = par(i,6,i*offset+ol.sawN(i+1,freq));
