Filters
Linear time invariant first and second filters, with controllable filter parameters. Main ones are lpf, hpf and bpf second order filters. Also, delay and tap make a delay line that can be tapped at multiple points.
Synth.filter1 — Functionfilter1(s :: Signal, gain :: Signal)A first order filter where the gain factor that controls the bandwidth of the filter can be live controlled.
Synth.filter2 — Functionfilter2(s :: Signal, f :: Signal, g :: Signal)
filter2(s :: Signal, f :: Signal, g :: Real)
filter2(s :: Signal, f :: Real, g :: Real)Constructs a second order filter where the frequency and the gamma can be controlled live.
Synth.fir — Functionfir(filt :: Vector{Float32}, sig :: Signal)Constructs a "finite impulse response" (FIR) filter with the given filt as the impulse response. Keep the filt argument short (to within about 1000 samples) in order for fir to be able to perform in realtime. The algorithm used is not suitable for very large FIR filter lengths ... which we'll perhaps add in the future.
Synth.lpf — Functionlpf(sig :: Signal, freq, q; samplingrate=48000)Standard second order LPF with frequency and Q factor.
Synth.bpf — Functionbpf(sig :: Signal, freq, q; samplingrate=48000)Standard second order bandpass filter with given centre frequency and Q factor.
Synth.bpf0 — Functionbpf0(sig :: Signal, freq, q; samplingrate=48000)Standard second order bandpass filter with given centre frequency and Q factor. This variant of bpf gives constant 0dB peak gain instead of the peak gain being determined by Q.
Synth.hpf — Functionhpf(sig :: Signal, freq, q; samplingrate=48000)Standard second order high pass filter with given cut off frequency and Q.
Synth.delay — Functiondelay(sig :: Signal, maxdelay :: Real; samplingrate=48000)Sets up a delay ring buffer through which the given signal is passed. A delay is pretty much a pass through and is useful only in conjunction with tap. A delay can fanout on its own, which means you can make multiple tap points on the same delay based on time varying tap locations.
sigis the signal that is delayed.maxdelayis the maximum amount of delay possible.samplingrateis the sampling rate in Hz. (This is needed to compute buffer size.)
Synth.tap — Functiontap(d :: Delay, t :: Signal)
tap(d :: Delay, t :: Real)You can setup multiple time varying tap points on a delay line by calling tap multiple times and using it elsewhere. Since a delay is intrinsically fanout capable, this is possible without further ado.
Synth.maxdelay — Functionmaxdelay(sig :: Delay)Returns the maximum delay (in seconds) supported by the given delay unit.
Synth.protect — Functionprotect(sig::Signal; cutoff::Real = 4000.0f0, q::Real = 10.0f0)Does a simple LPF of the signal with a modest cut off frequency to prevent too many high frequencies from getting through and possibly causing aliasing effects.