Skip to content

Instantly share code, notes, and snippets.

@mouseos
Last active October 22, 2022 13:41
Show Gist options
  • Save mouseos/30d426efa29b335af4e24db269787457 to your computer and use it in GitHub Desktop.
Save mouseos/30d426efa29b335af4e24db269787457 to your computer and use it in GitHub Desktop.
import("stdfaust.lib");
average(x,y)=(x+y)/2;
encode(x,y)=(x:fi.lowpass(48,15000)*sw),(y@(1):fi.lowpass(48,15000)*sw)@(1):>_;
sw=waveform{
1,0}:_*0,_:>_;
decode(x)=(x*sw*2),((x*sw@(1))*2);
process1=encode:decode:(fi.lowpass(48,15000),fi.lowpass(48,15000));
lpfreq=hslider("freq",14000,3000,15000,1);
process=decode:fi.lowpass(48,lpfreq),fi.lowpass(48,lpfreq)<:_,_,_,_:high_st(lpfreq),_,_:ba.select2stereo(hslider("0=on 1=off",0,0,1,1) );//process1:fi.lowpass(48,lpfreq),fi.lowpass(48,lpfreq)<:_,_,_,_:high_st(lpfreq),_,_:ba.select2stereo(hslider("0=on 1=off",0,0,1,1) );
high_mono(freq)=high(freq,2);
high_st(freq)=high_mono(freq),high_mono(freq);
high(maxfreq,gain,x)=in+(high/gain)
with{
in=(x:fi.lowpass(48,maxfreq));
high=in:fi.highpass(48,3000)*(os.oscsin(maxfreq-3000)):fi.highpass(48,maxfreq-500):fi.highshelf(1,-20,maxfreq+4000);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment