-- | Emulator of the AY (aka YM) soundchip, used in Spectrum/Atari
module Sound.SC3.UGen.Record.AY where
import qualified Sound.SC3.UGen as S
import Sound.SC3.UGen.Record
data AY = AY {
  tonea :: S.UGen,
  toneb :: S.UGen,
  tonec :: S.UGen,
  noise :: S.UGen,
  control :: S.UGen,
  vola :: S.UGen,
  volb :: S.UGen,
  volc :: S.UGen,
  envfreq :: S.UGen,
  envstyle :: S.UGen,
  chiptype :: S.UGen
  } deriving (Show)
aY :: AY
aY = AY {
  tonea = 1777.0,
  toneb = 1666.0,
  tonec = 1555.0,
  noise = 1.0,
  control = 7.0,
  vola = 15.0,
  volb = 15.0,
  volc = 15.0,
  envfreq = 4.0,
  envstyle = 1.0,
  chiptype = 0.0
  }
mkAY :: AY -> S.UGen
mkAY (AY  a' b' c' d' e' f' g' h' i' j' k') = S.mkOsc S.AR "AY" [a',b',c',d',e',f',g',h',i',j',k'] 1
instance Make AY where
  ugen = mkAY