-- | Nested Allpass filters as proposed by Vercoe and Pluckett
module Sound.SC3.UGen.Record.NestedAllpassC where
import qualified Sound.SC3.UGen as S
import Sound.SC3.UGen.Record
data NestedAllpassC = NestedAllpassC {
  input :: S.UGen,
  maxdelay1 :: S.UGen,
  delay1 :: S.UGen,
  gain1 :: S.UGen,
  maxdelay2 :: S.UGen,
  delay2 :: S.UGen,
  gain2 :: S.UGen
  } deriving (Show)
nestedAllpassC :: NestedAllpassC
nestedAllpassC = NestedAllpassC {
  input = 0.0,
  maxdelay1 = 0.036,
  delay1 = 0.036,
  gain1 = 0.08,
  maxdelay2 = 0.03,
  delay2 = 0.03,
  gain2 = 0.3
  }
mkNestedAllpassC :: NestedAllpassC -> S.UGen
mkNestedAllpassC (NestedAllpassC  a' b' c' d' e' f' g') = S.mkOsc S.AR "NestedAllpassC" [a',b',c',d',e',f',g'] 1
instance Make NestedAllpassC where
  ugen = mkNestedAllpassC