mirror of
https://github.com/vsariola/sointu.git
synced 2026-02-20 07:03:30 -05:00
draft a simpler version of the bell eq
This commit is contained in:
parent
9b87589f7b
commit
8d4a7a5045
@ -594,6 +594,23 @@ func (s *GoSynth) Render(buffer sointu.AudioBuffer, maxtime int) (samples int, r
|
||||
if stereo {
|
||||
stack = append(stack, gain)
|
||||
}
|
||||
case opEq:
|
||||
for i := range channels {
|
||||
inputSample := stack[l-1-i]
|
||||
w := params[0] * params[0]
|
||||
alpha := w * params[1] * 2
|
||||
A := float32(math.Pow(2, float64(params[2]-.5)*6.643856189774724))
|
||||
u := alpha * A
|
||||
v := alpha / A
|
||||
|
||||
a0, a1, a2 := 1+v, w*w-2, 1-v
|
||||
b0, b1, b2 := 1+u, a1, 1-u
|
||||
|
||||
output := (b0*inputSample + unit.state[i]) / a0
|
||||
unit.state[i] = b1*inputSample - b1*output + unit.state[2+i]
|
||||
unit.state[2+i] = b2*inputSample - a2*output
|
||||
stack[l-1-i] = output
|
||||
}
|
||||
case opSync:
|
||||
break
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user