module Csound.Typed.Opcode.MixerOpcodes (
    
    
    
    mixerClear, mixerGetLevel, mixerReceive, mixerSend, mixerSetLevel, mixerSetLevel_i) where

import Control.Monad.Trans.Class
import Csound.Dynamic
import Csound.Typed

-- 

-- | 
-- Resets all channels of a buss to 0.
--
-- >  MixerClear 
--
-- csound doc: <http://csound.com/docs/manual/MixerClear.html>
mixerClear ::   SE ()
mixerClear :: SE ()
mixerClear  = Dep () -> SE ()
forall a. Dep a -> SE a
SE (Dep () -> SE ()) -> Dep () -> SE ()
forall a b. (a -> b) -> a -> b
$ (E -> Dep ()
forall (m :: * -> *). Monad m => E -> DepT m ()
depT_ (E -> Dep ()) -> DepT GE E -> Dep ()
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<<) (DepT GE E -> Dep ()) -> DepT GE E -> Dep ()
forall a b. (a -> b) -> a -> b
$ GE E -> DepT GE E
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (GE E -> DepT GE E) -> GE E -> DepT GE E
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall (m :: * -> *) a. Monad m => a -> m a
return (E -> GE E) -> E -> GE E
forall a b. (a -> b) -> a -> b
$ E
f 
    where f :: E
f  = Name -> Spec1 -> [E] -> E
opcs Name
"MixerClear" [(Rate
Xr,[])] []

-- | 
-- Gets the level of a send to a buss.
--
-- Gets the level at which signals from the send are being added to the buss. The actual sending of the signal to the buss 
-- is performed by the MixerSend opcode.
--
-- > kgain  MixerGetLevel  isend, ibuss
--
-- csound doc: <http://csound.com/docs/manual/MixerGetLevel.html>
mixerGetLevel ::  D -> D -> SE Sig
mixerGetLevel :: D -> D -> SE Sig
mixerGetLevel D
b1 D
b2 = (E -> Sig) -> SE E -> SE Sig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ( GE E -> Sig
Sig (GE E -> Sig) -> (E -> GE E) -> E -> Sig
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E -> GE E
forall (m :: * -> *) a. Monad m => a -> m a
return) (SE E -> SE Sig) -> SE E -> SE Sig
forall a b. (a -> b) -> a -> b
$ DepT GE E -> SE E
forall a. Dep a -> SE a
SE (DepT GE E -> SE E) -> DepT GE E -> SE E
forall a b. (a -> b) -> a -> b
$ (E -> DepT GE E
forall (m :: * -> *). Monad m => E -> DepT m E
depT (E -> DepT GE E) -> DepT GE E -> DepT GE E
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<<) (DepT GE E -> DepT GE E) -> DepT GE E -> DepT GE E
forall a b. (a -> b) -> a -> b
$ GE E -> DepT GE E
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (GE E -> DepT GE E) -> GE E -> DepT GE E
forall a b. (a -> b) -> a -> b
$ E -> E -> E
f (E -> E -> E) -> GE E -> GE (E -> E)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> D -> GE E
unD D
b1 GE (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b2
    where f :: E -> E -> E
f E
a1 E
a2 = Name -> Spec1 -> [E] -> E
opcs Name
"MixerGetLevel" [(Rate
Kr,[Rate
Ir,Rate
Ir])] [E
a1,E
a2]

-- | 
-- Receives an arate signal from a channel of a buss.
--
-- Receives an arate signal that has been mixed onto a channel of a buss.
--
-- > asignal  MixerReceive  ibuss, ichannel
--
-- csound doc: <http://csound.com/docs/manual/MixerReceive.html>
mixerReceive ::  D -> D -> SE Sig
mixerReceive :: D -> D -> SE Sig
mixerReceive D
b1 D
b2 = (E -> Sig) -> SE E -> SE Sig
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
fmap ( GE E -> Sig
Sig (GE E -> Sig) -> (E -> GE E) -> E -> Sig
forall b c a. (b -> c) -> (a -> b) -> a -> c
. E -> GE E
forall (m :: * -> *) a. Monad m => a -> m a
return) (SE E -> SE Sig) -> SE E -> SE Sig
forall a b. (a -> b) -> a -> b
$ DepT GE E -> SE E
forall a. Dep a -> SE a
SE (DepT GE E -> SE E) -> DepT GE E -> SE E
forall a b. (a -> b) -> a -> b
$ (E -> DepT GE E
forall (m :: * -> *). Monad m => E -> DepT m E
depT (E -> DepT GE E) -> DepT GE E -> DepT GE E
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<<) (DepT GE E -> DepT GE E) -> DepT GE E -> DepT GE E
forall a b. (a -> b) -> a -> b
$ GE E -> DepT GE E
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (GE E -> DepT GE E) -> GE E -> DepT GE E
forall a b. (a -> b) -> a -> b
$ E -> E -> E
f (E -> E -> E) -> GE E -> GE (E -> E)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> D -> GE E
unD D
b1 GE (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b2
    where f :: E -> E -> E
f E
a1 E
a2 = Name -> Spec1 -> [E] -> E
opcs Name
"MixerReceive" [(Rate
Ar,[Rate
Ir,Rate
Ir])] [E
a1,E
a2]

-- | 
-- Mixes an arate signal into a channel of a buss.
--
-- >  MixerSend  asignal, isend, ibuss, ichannel
--
-- csound doc: <http://csound.com/docs/manual/MixerSend.html>
mixerSend ::  Sig -> D -> D -> D -> SE ()
mixerSend :: Sig -> D -> D -> D -> SE ()
mixerSend Sig
b1 D
b2 D
b3 D
b4 = Dep () -> SE ()
forall a. Dep a -> SE a
SE (Dep () -> SE ()) -> Dep () -> SE ()
forall a b. (a -> b) -> a -> b
$ (E -> Dep ()
forall (m :: * -> *). Monad m => E -> DepT m ()
depT_ (E -> Dep ()) -> DepT GE E -> Dep ()
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<<) (DepT GE E -> Dep ()) -> DepT GE E -> Dep ()
forall a b. (a -> b) -> a -> b
$ GE E -> DepT GE E
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (GE E -> DepT GE E) -> GE E -> DepT GE E
forall a b. (a -> b) -> a -> b
$ E -> E -> E -> E -> E
f (E -> E -> E -> E -> E) -> GE E -> GE (E -> E -> E -> E)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Sig -> GE E
unSig Sig
b1 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b2 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b3 GE (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b4
    where f :: E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 = Name -> Spec1 -> [E] -> E
opcs Name
"MixerSend" [(Rate
Xr,[Rate
Ar,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4]

-- | 
-- Sets the level of a send to a buss.
--
-- Sets the level at which signals from the send are added to the buss. The actual sending of the signal to the buss 
-- is performed by the MixerSend opcode.
--
-- >  MixerSetLevel  isend, ibuss, kgain
--
-- csound doc: <http://csound.com/docs/manual/MixerSetLevel.html>
mixerSetLevel ::  D -> D -> Sig -> SE ()
mixerSetLevel :: D -> D -> Sig -> SE ()
mixerSetLevel D
b1 D
b2 Sig
b3 = Dep () -> SE ()
forall a. Dep a -> SE a
SE (Dep () -> SE ()) -> Dep () -> SE ()
forall a b. (a -> b) -> a -> b
$ (E -> Dep ()
forall (m :: * -> *). Monad m => E -> DepT m ()
depT_ (E -> Dep ()) -> DepT GE E -> Dep ()
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<<) (DepT GE E -> Dep ()) -> DepT GE E -> Dep ()
forall a b. (a -> b) -> a -> b
$ GE E -> DepT GE E
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (GE E -> DepT GE E) -> GE E -> DepT GE E
forall a b. (a -> b) -> a -> b
$ E -> E -> E -> E
f (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> D -> GE E
unD D
b1 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b2 GE (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b3
    where f :: E -> E -> E -> E
f E
a1 E
a2 E
a3 = Name -> Spec1 -> [E] -> E
opcs Name
"MixerSetLevel" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Kr])] [E
a1,E
a2,E
a3]

-- | 
-- Sets the level of a send to a buss.
--
-- Sets the level at which signals from the send are added to the buss. This opcode, because all parameters are irate, may 
--       be used in the orchestra header. The actual sending of the signal to the buss 
--       is performed by the MixerSend opcode.
--
-- >  MixerSetLevel_i  isend, ibuss, igain
--
-- csound doc: <http://csound.com/docs/manual/MixerSetLevel_i.html>
mixerSetLevel_i ::  D -> D -> D -> SE ()
mixerSetLevel_i :: D -> D -> D -> SE ()
mixerSetLevel_i D
b1 D
b2 D
b3 = Dep () -> SE ()
forall a. Dep a -> SE a
SE (Dep () -> SE ()) -> Dep () -> SE ()
forall a b. (a -> b) -> a -> b
$ (E -> Dep ()
forall (m :: * -> *). Monad m => E -> DepT m ()
depT_ (E -> Dep ()) -> DepT GE E -> Dep ()
forall (m :: * -> *) a b. Monad m => (a -> m b) -> m a -> m b
=<<) (DepT GE E -> Dep ()) -> DepT GE E -> Dep ()
forall a b. (a -> b) -> a -> b
$ GE E -> DepT GE E
forall (t :: (* -> *) -> * -> *) (m :: * -> *) a.
(MonadTrans t, Monad m) =>
m a -> t m a
lift (GE E -> DepT GE E) -> GE E -> DepT GE E
forall a b. (a -> b) -> a -> b
$ E -> E -> E -> E
f (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> D -> GE E
unD D
b1 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b2 GE (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b3
    where f :: E -> E -> E -> E
f E
a1 E
a2 E
a3 = Name -> Spec1 -> [E] -> E
opcs Name
"MixerSetLevel_i" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3]