gibber-cc / gibber

An audiovisual live coding environment for the browser
MIT License
902 stars 79 forks source link

filters don't initialize modes correctly #87

Open ianhattwick opened 1 year ago

ianhattwick commented 1 year ago

I've been trying to implement highpass filters, and found that including the mode in the constructor is ineffective - but changing the mode later seems to work but also throws an error.

this should be a highpass filter (mode 1) but instead implements a lowpass filter:

s = Synth[4]('stringPad')
s.note.seq([0,2,4,1], 1/2,3/8,1/8)
s_filt = Filter({'model': 4, 'mode':1, 'cutoff': 0.05, 'Q':0})
s.fx.add(s_filt)

this correctly changes the mode to highpass but throws an error:

s = Synth[4]('stringPad')
s.note.seq([0,2,4,1], 1/2,3/8,1/8)
s_filt = Filter({'model': 4, 'mode':0, 'cutoff': 0.05, 'Q':0})
s_filt.mode = 1
s.fx.add(s_filt)