Created
April 4, 2021 20:54
-
-
Save jpcima/53093aabcfc133c54081ad1b002d86c0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import("stdfaust.lib"); | |
snes_fir(x) = sum(i, 8, in(i) * tap(i)) with { | |
refSR = 32000; // sample rate of SNES | |
// the filter inputs | |
in(0) = x; // at 0 it's the undelayed input sample | |
// at I, it's the sample at I frames back based on SNES reference rate | |
// convert this sample delay to DAC rate, which gives a fractional time | |
in(i) = x : de.fdelay(64, i*(ma.SR/refSR)); | |
// the Ith value of the FIR filter, as a 0-1 slider | |
// first tap is default to 1, others 0 | |
tap(i) = hgroup("Coefficients", | |
vslider("[%i] FIR Tap %i", ba.if(i == 0, 255, 0), 0, 255, 0)) : /(255.0); | |
}; | |
// test by sending noise in the filter, and output in stereo | |
process = testSignal : snes_fir <: (_, _) with { | |
testSignal = no.noise : *(0.25); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment