module Csound.Typed.Opcode.ZakPatchSystem ( zacl, zakinit, zamod, zar, zarg, zaw, zawm, zir, ziw, ziwm, zkcl, zkmod, zkr, zkw, zkwm) where import Control.Monad.Trans.Class import Csound.Dynamic import Csound.Typed -- -- | -- Clears one or more variables in the za space. -- -- > zacl kfirst, klast -- -- csound doc: zacl :: Sig -> Sig -> SE () zacl b1 b2 = SE $ (depT_ =<<) $ lift $ f <$> unSig b1 <*> unSig b2 where f a1 a2 = opcs "zacl" [(Xr,[Kr,Kr])] [a1,a2] -- | -- Establishes zak space. -- -- Establishes zak space. Must be called only once. -- -- > zakinit isizea, isizek -- -- csound doc: zakinit :: D -> D -> SE () zakinit b1 b2 = SE $ (depT_ =<<) $ lift $ f <$> unD b1 <*> unD b2 where f a1 a2 = opcs "zakinit" [(Xr,[Ir,Ir])] [a1,a2] -- | -- Modulates one a-rate signal by a second one. -- -- > ares zamod asig, kzamod -- -- csound doc: zamod :: Sig -> Sig -> Sig zamod b1 b2 = Sig $ f <$> unSig b1 <*> unSig b2 where f a1 a2 = opcs "zamod" [(Ar,[Ar,Kr])] [a1,a2] -- | -- Reads from a location in za space at a-rate. -- -- > ares zar kndx -- -- csound doc: zar :: Sig -> Sig zar b1 = Sig $ f <$> unSig b1 where f a1 = opcs "zar" [(Ar,[Kr])] [a1] -- | -- Reads from a location in za space at a-rate, adds some gain. -- -- > ares zarg kndx, kgain -- -- csound doc: zarg :: Sig -> Sig -> Sig zarg b1 b2 = Sig $ f <$> unSig b1 <*> unSig b2 where f a1 a2 = opcs "zarg" [(Ar,[Kr,Kr])] [a1,a2] -- | -- Writes to a za variable at a-rate without mixing. -- -- > zaw asig, kndx -- -- csound doc: zaw :: Sig -> Sig -> SE () zaw b1 b2 = SE $ (depT_ =<<) $ lift $ f <$> unSig b1 <*> unSig b2 where f a1 a2 = opcs "zaw" [(Xr,[Ar,Kr])] [a1,a2] -- | -- Writes to a za variable at a-rate with mixing. -- -- > zawm asig, kndx [, imix] -- -- csound doc: zawm :: Sig -> Sig -> SE () zawm b1 b2 = SE $ (depT_ =<<) $ lift $ f <$> unSig b1 <*> unSig b2 where f a1 a2 = opcs "zawm" [(Xr,[Ar,Kr,Ir])] [a1,a2] -- | -- Reads from a location in zk space at i-rate. -- -- > ir zir indx -- -- csound doc: zir :: D -> D zir b1 = D $ f <$> unD b1 where f a1 = opcs "zir" [(Ir,[Ir])] [a1] -- | -- Writes to a zk variable at i-rate without mixing. -- -- > ziw isig, indx -- -- csound doc: ziw :: D -> D -> SE () ziw b1 b2 = SE $ (depT_ =<<) $ lift $ f <$> unD b1 <*> unD b2 where f a1 a2 = opcs "ziw" [(Xr,[Ir,Ir])] [a1,a2] -- | -- Writes to a zk variable to an i-rate variable with mixing. -- -- > ziwm isig, indx [, imix] -- -- csound doc: ziwm :: D -> D -> SE () ziwm b1 b2 = SE $ (depT_ =<<) $ lift $ f <$> unD b1 <*> unD b2 where f a1 a2 = opcs "ziwm" [(Xr,[Ir,Ir,Ir])] [a1,a2] -- | -- Clears one or more variables in the zk space. -- -- > zkcl kfirst, klast -- -- csound doc: zkcl :: Sig -> Sig -> SE () zkcl b1 b2 = SE $ (depT_ =<<) $ lift $ f <$> unSig b1 <*> unSig b2 where f a1 a2 = opcs "zkcl" [(Xr,[Kr,Kr])] [a1,a2] -- | -- Facilitates the modulation of one signal by another. -- -- > kres zkmod ksig, kzkmod -- -- csound doc: zkmod :: Sig -> Sig -> Sig zkmod b1 b2 = Sig $ f <$> unSig b1 <*> unSig b2 where f a1 a2 = opcs "zkmod" [(Kr,[Kr,Kr])] [a1,a2] -- | -- Reads from a location in zk space at k-rate. -- -- > kres zkr kndx -- -- csound doc: zkr :: Sig -> Sig zkr b1 = Sig $ f <$> unSig b1 where f a1 = opcs "zkr" [(Kr,[Kr])] [a1] -- | -- Writes to a zk variable at k-rate without mixing. -- -- > zkw ksig, kndx -- -- csound doc: zkw :: Sig -> Sig -> SE () zkw b1 b2 = SE $ (depT_ =<<) $ lift $ f <$> unSig b1 <*> unSig b2 where f a1 a2 = opcs "zkw" [(Xr,[Kr,Kr])] [a1,a2] -- | -- Writes to a zk variable at k-rate with mixing. -- -- > zkwm ksig, kndx [, imix] -- -- csound doc: zkwm :: Sig -> Sig -> SE () zkwm b1 b2 = SE $ (depT_ =<<) $ lift $ f <$> unSig b1 <*> unSig b2 where f a1 a2 = opcs "zkwm" [(Xr,[Kr,Kr,Ir])] [a1,a2]