module Csound.Typed.Opcode.RealtimeMIDI (
    
    
    -- * Input.
    aftouch, chanctrl, ctrl14, ctrl21, ctrl7, ctrlinit, initc14, initc21, initc7, massign, midic14, midic21, midic7, midictrl, notnum, pchbend, pgmassign, polyaft, veloc,
    
    -- * Output.
    nrpn, outiat, outic, outic14, outipat, outipb, outipc, outkat, outkc, outkc14, outkpat, outkpb, outkpc,
    
    -- * Converters.
    ampmidi, ampmidid, cpsmidi, cpsmidib, cpstmid, octmidi, octmidib, pchmidi, pchmidib,
    
    -- * Generic I/O.
    midiin, midiout, midiout_i,
    
    -- * Event Extenders.
    release, xtratim,
    
    -- * Note Output.
    midion, midion2, moscil, noteoff, noteon, noteondur, noteondur2,
    
    -- * MIDI/Score Interoperability.
    midichannelaftertouch, midichn, midicontrolchange, mididefault, midinoteoff, midinoteoncps, midinoteonkey, midinoteonoct, midinoteonpch, midipitchbend, midipolyaftertouch, midiprogramchange,
    
    -- * System Realtime.
    mclock, mrtmsg) where

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

-- Input.

-- | 
-- Get the current after-touch value for this channel.
--
-- > kaft  aftouch  [imin] [, imax]
--
-- csound doc: <http://csound.com/docs/manual/aftouch.html>
aftouch ::   Sig
aftouch :: Sig
aftouch  = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall a. a -> GE a
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
"aftouch" [(Rate
Kr,[Rate
Ir,Rate
Ir])] []

-- | 
-- Get the current value of a MIDI channel controller.
--
-- Get the current value of a controller and optionally map it onto specified range.
--
-- > ival  chanctrl  ichnl, ictlno [, ilow] [, ihigh]
-- > kval  chanctrl  ichnl, ictlno [, ilow] [, ihigh]
--
-- csound doc: <http://csound.com/docs/manual/chanctrl.html>
chanctrl ::  D -> D -> Sig
chanctrl :: D -> D -> Sig
chanctrl D
b1 D
b2 = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
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 a b. GE (a -> b) -> GE a -> GE b
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
"chanctrl" [(Rate
Ir,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir]),(Rate
Kr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2]

-- | 
-- Allows a floating-point 14-bit MIDI signal scaled with a minimum and a maximum range.
--
-- > idest  ctrl14  ichan, ictlno1, ictlno2, imin, imax [, ifn]
-- > kdest  ctrl14  ichan, ictlno1, ictlno2, kmin, kmax [, ifn]
--
-- csound doc: <http://csound.com/docs/manual/ctrl14.html>
ctrl14 ::  D -> D -> D -> D -> D -> Sig
ctrl14 :: D -> D -> D -> D -> D -> Sig
ctrl14 D
b1 D
b2 D
b3 D
b4 D
b5 = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
forall a b. (a -> b) -> a -> b
$ E -> E -> E -> E -> E -> E
f (E -> E -> E -> E -> E -> E) -> GE E -> GE (E -> E -> 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 -> E -> E) -> GE E -> GE (E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b2 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b3 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b4 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b5
    where f :: E -> E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 E
a5 = Name -> Spec1 -> [E] -> E
opcs Name
"ctrl14" [(Rate
Ir,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir]),(Rate
Kr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Kr,Rate
Kr,Rate
Ir])] [E
a1
                                                                                               ,E
a2
                                                                                               ,E
a3
                                                                                               ,E
a4
                                                                                               ,E
a5]

-- | 
-- Allows a floating-point 21-bit MIDI signal scaled with a minimum and a maximum range.
--
-- > idest  ctrl21  ichan, ictlno1, ictlno2, ictlno3, imin, imax [, ifn]
-- > kdest  ctrl21  ichan, ictlno1, ictlno2, ictlno3, kmin, kmax [, ifn]
--
-- csound doc: <http://csound.com/docs/manual/ctrl21.html>
ctrl21 ::  D -> D -> D -> D -> D -> D -> Sig
ctrl21 :: D -> D -> D -> D -> D -> D -> Sig
ctrl21 D
b1 D
b2 D
b3 D
b4 D
b5 D
b6 = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
forall a b. (a -> b) -> a -> b
$ E -> E -> E -> E -> E -> E -> E
f (E -> E -> E -> E -> E -> E -> E)
-> GE E -> GE (E -> E -> E -> 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 -> E -> E -> E)
-> GE E -> GE (E -> E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b2 GE (E -> E -> E -> E -> E) -> GE E -> GE (E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b3 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b4 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b5 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b6
    where f :: E -> E -> E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 E
a5 E
a6 = Name -> Spec1 -> [E] -> E
opcs Name
"ctrl21" [(Rate
Ir,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])
                                              ,(Rate
Kr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Kr,Rate
Kr,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4,E
a5,E
a6]

-- | 
-- Allows a floating-point 7-bit MIDI signal scaled with a minimum and a maximum range.
--
-- > idest  ctrl7  ichan, ictlno, imin, imax [, ifn]
-- > kdest  ctrl7  ichan, ictlno, kmin, kmax [, ifn]
-- > adest  ctrl7  ichan, ictlno, kmin, kmax [, ifn] [, icutoff]
--
-- csound doc: <http://csound.com/docs/manual/ctrl7.html>
ctrl7 ::  D -> D -> D -> D -> Sig
ctrl7 :: D -> D -> D -> D -> Sig
ctrl7 D
b1 D
b2 D
b3 D
b4 = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
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
<$> D -> GE E
unD D
b1 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"ctrl7" [(Rate
Ir,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])
                                       ,(Rate
Kr,[Rate
Ir,Rate
Ir,Rate
Kr,Rate
Kr,Rate
Ir])
                                       ,(Rate
Ar,[Rate
Ir,Rate
Ir,Rate
Kr,Rate
Kr,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4]

-- | 
-- Sets the initial values for a set of MIDI controllers.
--
-- >  ctrlinit  ichnl, ictlno1, ival1 [, ictlno2] [, ival2] [, ictlno3] \
-- >           [, ival3] [,...ival32]
--
-- csound doc: <http://csound.com/docs/manual/ctrlinit.html>
ctrlinit ::  [D] -> SE ()
ctrlinit :: [D] -> SE ()
ctrlinit [D]
b1 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
f ([E] -> E) -> GE [E] -> GE E
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (D -> GE E) -> [D] -> GE [E]
forall (t :: * -> *) (m :: * -> *) a b.
(Traversable t, Monad m) =>
(a -> m b) -> t a -> m (t b)
forall (m :: * -> *) a b. Monad m => (a -> m b) -> [a] -> m [b]
mapM D -> GE E
unD [D]
b1
    where f :: [E] -> E
f [E]
a1 = Name -> Spec1 -> [E] -> E
opcs Name
"ctrlinit" [(Rate
Xr,(Rate -> [Rate]
forall a. a -> [a]
repeat Rate
Ir))] [E]
a1

-- | 
-- Initializes the controllers used to create a 14-bit MIDI value.
--
-- >  initc14  ichan, ictlno1, ictlno2, ivalue
--
-- csound doc: <http://csound.com/docs/manual/initc14.html>
initc14 ::  D -> D -> D -> D -> SE ()
initc14 :: D -> D -> D -> D -> SE ()
initc14 D
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> D -> GE E
unD D
b1 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"initc14" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4]

-- | 
-- Initializes the controllers used to create a 21-bit MIDI value.
--
-- >  initc21  ichan, ictlno1, ictlno2, ictlno3, ivalue
--
-- csound doc: <http://csound.com/docs/manual/initc21.html>
initc21 ::  D -> D -> D -> D -> D -> SE ()
initc21 :: D -> D -> D -> D -> D -> SE ()
initc21 D
b1 D
b2 D
b3 D
b4 D
b5 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 -> E
f (E -> E -> E -> E -> E -> E) -> GE E -> GE (E -> E -> 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 -> E -> E) -> GE E -> GE (E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b2 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b3 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b4 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b5
    where f :: E -> E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 E
a5 = Name -> Spec1 -> [E] -> E
opcs Name
"initc21" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4,E
a5]

-- | 
-- Initializes the controller used to create a 7-bit MIDI value.
--
-- Initializes MIDI controller ictlno with ivalue
--
-- >  initc7  ichan, ictlno, ivalue
--
-- csound doc: <http://csound.com/docs/manual/initc7.html>
initc7 ::  D -> D -> D -> SE ()
initc7 :: D -> D -> D -> SE ()
initc7 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"initc7" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3]

-- | 
-- Assigns a MIDI channel number to a Csound instrument.
--
-- >  massign  ichnl, insnum[, ireset]
-- >  massign  ichnl, "insname"[, ireset]
--
-- csound doc: <http://csound.com/docs/manual/massign.html>
massign ::  D -> D -> SE ()
massign :: D -> D -> SE ()
massign D
b1 D
b2 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 a b. GE (a -> b) -> GE a -> GE b
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
"massign" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2]

-- | 
-- Allows a floating-point 14-bit MIDI signal scaled with a minimum and a maximum range.
--
-- > idest  midic14  ictlno1, ictlno2, imin, imax [, ifn]
-- > kdest  midic14  ictlno1, ictlno2, kmin, kmax [, ifn]
--
-- csound doc: <http://csound.com/docs/manual/midic14.html>
midic14 ::  D -> D -> D -> D -> Sig
midic14 :: D -> D -> D -> D -> Sig
midic14 D
b1 D
b2 D
b3 D
b4 = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
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
<$> D -> GE E
unD D
b1 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"midic14" [(Rate
Ir,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir]),(Rate
Kr,[Rate
Ir,Rate
Ir,Rate
Kr,Rate
Kr,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4]

-- | 
-- Allows a floating-point 21-bit MIDI signal scaled with a minimum and a maximum range.
--
-- > idest  midic21  ictlno1, ictlno2, ictlno3, imin, imax [, ifn]
-- > kdest  midic21  ictlno1, ictlno2, ictlno3, kmin, kmax [, ifn]
--
-- csound doc: <http://csound.com/docs/manual/midic21.html>
midic21 ::  D -> D -> D -> D -> D -> Sig
midic21 :: D -> D -> D -> D -> D -> Sig
midic21 D
b1 D
b2 D
b3 D
b4 D
b5 = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
forall a b. (a -> b) -> a -> b
$ E -> E -> E -> E -> E -> E
f (E -> E -> E -> E -> E -> E) -> GE E -> GE (E -> E -> 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 -> E -> E) -> GE E -> GE (E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b2 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b3 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b4 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b5
    where f :: E -> E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 E
a5 = Name -> Spec1 -> [E] -> E
opcs Name
"midic21" [(Rate
Ir,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir]),(Rate
Kr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Kr,Rate
Kr,Rate
Ir])] [E
a1
                                                                                                ,E
a2
                                                                                                ,E
a3
                                                                                                ,E
a4
                                                                                                ,E
a5]

-- | 
-- Allows a floating-point 7-bit MIDI signal scaled with a minimum and a maximum range.
--
-- > idest  midic7  ictlno, imin, imax [, ifn]
-- > kdest  midic7  ictlno, kmin, kmax [, ifn]
--
-- csound doc: <http://csound.com/docs/manual/midic7.html>
midic7 ::  D -> D -> D -> Sig
midic7 :: D -> D -> D -> Sig
midic7 D
b1 D
b2 D
b3 = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"midic7" [(Rate
Ir,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir]),(Rate
Kr,[Rate
Ir,Rate
Kr,Rate
Kr,Rate
Ir])] [E
a1,E
a2,E
a3]

-- | 
-- Get the current value (0-127) of a specified MIDI controller.
--
-- > ival  midictrl  inum [, imin] [, imax]
-- > kval  midictrl  inum [, imin] [, imax]
--
-- csound doc: <http://csound.com/docs/manual/midictrl.html>
midictrl ::  D -> Sig
midictrl :: D -> Sig
midictrl D
b1 = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
forall a b. (a -> b) -> a -> b
$ E -> E
f (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> D -> GE E
unD D
b1
    where f :: E -> E
f E
a1 = Name -> Spec1 -> [E] -> E
opcs Name
"midictrl" [(Rate
Ir,[Rate
Ir,Rate
Ir,Rate
Ir]),(Rate
Kr,[Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1]

-- | 
-- Get a note number from a MIDI event.
--
-- > ival  notnum 
--
-- csound doc: <http://csound.com/docs/manual/notnum.html>
notnum ::  Msg -> D
notnum :: Msg -> D
notnum Msg
_  = GE E -> D
D (GE E -> D) -> GE E -> D
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall a. a -> GE a
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
"notnum" [(Rate
Ir,[])] []

-- | 
-- Get the current pitch-bend value for this channel.
--
-- > ibend  pchbend  [imin] [, imax]
-- > kbend  pchbend  [imin] [, imax]
--
-- csound doc: <http://csound.com/docs/manual/pchbend.html>
pchbend ::  Msg -> Sig
pchbend :: Msg -> Sig
pchbend Msg
_  = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall a. a -> GE a
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
"pchbend" [(Rate
Ir,[Rate
Ir,Rate
Ir]),(Rate
Kr,[Rate
Ir,Rate
Ir])] []

-- | 
-- Assigns an instrument number to a specified MIDI program.
--
-- Assigns an instrument number to a specified (or all) MIDI program(s).
--
-- >  pgmassign  ipgm, inst[, ichn]
-- >  pgmassign  ipgm, "insname"[, ichn]
--
-- csound doc: <http://csound.com/docs/manual/pgmassign.html>
pgmassign ::  D -> D -> SE ()
pgmassign :: D -> D -> SE ()
pgmassign D
b1 D
b2 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 a b. GE (a -> b) -> GE a -> GE b
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
"pgmassign" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2]

-- | 
-- Returns the polyphonic after-touch pressure of the selected note number.
--
-- polyaft returns the polyphonic pressure of the selected note number, optionally mapped to an user-specified range.
--
-- > ires  polyaft  inote [, ilow] [, ihigh]
-- > kres  polyaft  inote [, ilow] [, ihigh]
--
-- csound doc: <http://csound.com/docs/manual/polyaft.html>
polyaft ::  D -> Sig
polyaft :: D -> Sig
polyaft D
b1 = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
forall a b. (a -> b) -> a -> b
$ E -> E
f (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> D -> GE E
unD D
b1
    where f :: E -> E
f E
a1 = Name -> Spec1 -> [E] -> E
opcs Name
"polyaft" [(Rate
Ir,[Rate
Ir,Rate
Ir,Rate
Ir]),(Rate
Kr,[Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1]

-- | 
-- Get the velocity from a MIDI event.
--
-- > ival  veloc  [ilow] [, ihigh]
--
-- csound doc: <http://csound.com/docs/manual/veloc.html>
veloc ::  Msg -> D
veloc :: Msg -> D
veloc Msg
_  = GE E -> D
D (GE E -> D) -> GE E -> D
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall a. a -> GE a
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
"veloc" [(Rate
Ir,[Rate
Ir,Rate
Ir])] []

-- Output.

-- | 
-- Sends a Non-Registered Parameter Number to the MIDI OUT port.
--
-- Sends a NPRN (Non-Registered Parameter Number) message to the MIDI OUT port each time one of the input arguments changes.
--
-- >  nrpn  kchan, kparmnum, kparmvalue
--
-- csound doc: <http://csound.com/docs/manual/nrpn.html>
nrpn ::  Sig -> Sig -> Sig -> SE ()
nrpn :: Sig -> Sig -> Sig -> SE ()
nrpn Sig
b1 Sig
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> Sig -> GE E
unSig Sig
b1 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
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
"nrpn" [(Rate
Xr,[Rate
Kr,Rate
Kr,Rate
Kr])] [E
a1,E
a2,E
a3]

-- | 
-- Sends MIDI aftertouch messages at i-rate.
--
-- >  outiat  ichn, ivalue, imin, imax
--
-- csound doc: <http://csound.com/docs/manual/outiat.html>
outiat ::  D -> D -> D -> D -> SE ()
outiat :: D -> D -> D -> D -> SE ()
outiat D
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> D -> GE E
unD D
b1 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"outiat" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4]

-- | 
-- Sends MIDI controller output at i-rate.
--
-- >  outic  ichn, inum, ivalue, imin, imax
--
-- csound doc: <http://csound.com/docs/manual/outic.html>
outic ::  D -> D -> D -> D -> D -> SE ()
outic :: D -> D -> D -> D -> D -> SE ()
outic D
b1 D
b2 D
b3 D
b4 D
b5 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 -> E
f (E -> E -> E -> E -> E -> E) -> GE E -> GE (E -> E -> 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 -> E -> E) -> GE E -> GE (E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b2 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b3 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b4 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b5
    where f :: E -> E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 E
a5 = Name -> Spec1 -> [E] -> E
opcs Name
"outic" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4,E
a5]

-- | 
-- Sends 14-bit MIDI controller output at i-rate.
--
-- >  outic14  ichn, imsb, ilsb, ivalue, imin, imax
--
-- csound doc: <http://csound.com/docs/manual/outic14.html>
outic14 ::  D -> D -> D -> D -> D -> D -> SE ()
outic14 :: D -> D -> D -> D -> D -> D -> SE ()
outic14 D
b1 D
b2 D
b3 D
b4 D
b5 D
b6 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 -> E -> E
f (E -> E -> E -> E -> E -> E -> E)
-> GE E -> GE (E -> E -> E -> 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 -> E -> E -> E)
-> GE E -> GE (E -> E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b2 GE (E -> E -> E -> E -> E) -> GE E -> GE (E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b3 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b4 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b5 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b6
    where f :: E -> E -> E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 E
a5 E
a6 = Name -> Spec1 -> [E] -> E
opcs Name
"outic14" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4,E
a5,E
a6]

-- | 
-- Sends polyphonic MIDI aftertouch messages at i-rate.
--
-- >  outipat  ichn, inotenum, ivalue, imin, imax
--
-- csound doc: <http://csound.com/docs/manual/outipat.html>
outipat ::  D -> D -> D -> D -> D -> SE ()
outipat :: D -> D -> D -> D -> D -> SE ()
outipat D
b1 D
b2 D
b3 D
b4 D
b5 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 -> E
f (E -> E -> E -> E -> E -> E) -> GE E -> GE (E -> E -> 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 -> E -> E) -> GE E -> GE (E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b2 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b3 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b4 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> D -> GE E
unD D
b5
    where f :: E -> E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 E
a5 = Name -> Spec1 -> [E] -> E
opcs Name
"outipat" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4,E
a5]

-- | 
-- Sends MIDI pitch-bend messages at i-rate.
--
-- >  outipb  ichn, ivalue, imin, imax
--
-- csound doc: <http://csound.com/docs/manual/outipb.html>
outipb ::  D -> D -> D -> D -> SE ()
outipb :: D -> D -> D -> D -> SE ()
outipb D
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> D -> GE E
unD D
b1 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"outipb" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4]

-- | 
-- Sends MIDI program change messages at i-rate
--
-- >  outipc  ichn, iprog, imin, imax
--
-- csound doc: <http://csound.com/docs/manual/outipc.html>
outipc ::  D -> D -> D -> D -> SE ()
outipc :: D -> D -> D -> D -> SE ()
outipc D
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> D -> GE E
unD D
b1 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"outipc" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4]

-- | 
-- Sends MIDI aftertouch messages at k-rate.
--
-- >  outkat  kchn, kvalue, kmin, kmax
--
-- csound doc: <http://csound.com/docs/manual/outkat.html>
outkat ::  Sig -> Sig -> Sig -> Sig -> SE ()
outkat :: Sig -> Sig -> Sig -> Sig -> SE ()
outkat Sig
b1 Sig
b2 Sig
b3 Sig
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b3 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b4
    where f :: E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 = Name -> Spec1 -> [E] -> E
opcs Name
"outkat" [(Rate
Xr,[Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr])] [E
a1,E
a2,E
a3,E
a4]

-- | 
-- Sends MIDI controller messages at k-rate.
--
-- >  outkc  kchn, knum, kvalue, kmin, kmax
--
-- csound doc: <http://csound.com/docs/manual/outkc.html>
outkc ::  Sig -> Sig -> Sig -> Sig -> Sig -> SE ()
outkc :: Sig -> Sig -> Sig -> Sig -> Sig -> SE ()
outkc Sig
b1 Sig
b2 Sig
b3 Sig
b4 Sig
b5 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 -> E
f (E -> E -> E -> E -> E -> E) -> GE E -> GE (E -> 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 -> E) -> GE E -> GE (E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b3 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b4 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b5
    where f :: E -> E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 E
a5 = Name -> Spec1 -> [E] -> E
opcs Name
"outkc" [(Rate
Xr,[Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr])] [E
a1,E
a2,E
a3,E
a4,E
a5]

-- | 
-- Sends 14-bit MIDI controller output at k-rate.
--
-- >  outkc14  kchn, kmsb, klsb, kvalue, kmin, kmax
--
-- csound doc: <http://csound.com/docs/manual/outkc14.html>
outkc14 ::  Sig -> Sig -> Sig -> Sig -> Sig -> Sig -> SE ()
outkc14 :: Sig -> Sig -> Sig -> Sig -> Sig -> Sig -> SE ()
outkc14 Sig
b1 Sig
b2 Sig
b3 Sig
b4 Sig
b5 Sig
b6 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 -> E -> E
f (E -> E -> E -> E -> E -> E -> E)
-> GE E -> GE (E -> E -> 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 -> E -> E)
-> GE E -> GE (E -> E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2 GE (E -> E -> E -> E -> E) -> GE E -> GE (E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b3 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b4 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b5 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b6
    where f :: E -> E -> E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 E
a5 E
a6 = Name -> Spec1 -> [E] -> E
opcs Name
"outkc14" [(Rate
Xr,[Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr])] [E
a1,E
a2,E
a3,E
a4,E
a5,E
a6]

-- | 
-- Sends polyphonic MIDI aftertouch messages at k-rate.
--
-- >  outkpat  kchn, knotenum, kvalue, kmin, kmax
--
-- csound doc: <http://csound.com/docs/manual/outkpat.html>
outkpat ::  Sig -> Sig -> Sig -> Sig -> Sig -> SE ()
outkpat :: Sig -> Sig -> Sig -> Sig -> Sig -> SE ()
outkpat Sig
b1 Sig
b2 Sig
b3 Sig
b4 Sig
b5 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 -> E
f (E -> E -> E -> E -> E -> E) -> GE E -> GE (E -> 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 -> E) -> GE E -> GE (E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b3 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b4 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b5
    where f :: E -> E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 E
a5 = Name -> Spec1 -> [E] -> E
opcs Name
"outkpat" [(Rate
Xr,[Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr])] [E
a1,E
a2,E
a3,E
a4,E
a5]

-- | 
-- Sends MIDI pitch-bend messages at k-rate.
--
-- >  outkpb  kchn, kvalue, kmin, kmax
--
-- csound doc: <http://csound.com/docs/manual/outkpb.html>
outkpb ::  Sig -> Sig -> Sig -> Sig -> SE ()
outkpb :: Sig -> Sig -> Sig -> Sig -> SE ()
outkpb Sig
b1 Sig
b2 Sig
b3 Sig
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b3 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b4
    where f :: E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 = Name -> Spec1 -> [E] -> E
opcs Name
"outkpb" [(Rate
Xr,[Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr])] [E
a1,E
a2,E
a3,E
a4]

-- | 
-- Sends MIDI program change messages at k-rate.
--
-- >  outkpc  kchn, kprog, kmin, kmax
--
-- csound doc: <http://csound.com/docs/manual/outkpc.html>
outkpc ::  Sig -> Sig -> Sig -> Sig -> SE ()
outkpc :: Sig -> Sig -> Sig -> Sig -> SE ()
outkpc Sig
b1 Sig
b2 Sig
b3 Sig
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b3 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b4
    where f :: E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 = Name -> Spec1 -> [E] -> E
opcs Name
"outkpc" [(Rate
Xr,[Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr])] [E
a1,E
a2,E
a3,E
a4]

-- Converters.

-- | 
-- Get the velocity of the current MIDI event.
--
-- > iamp  ampmidi  iscal [, ifn]
--
-- csound doc: <http://csound.com/docs/manual/ampmidi.html>
ampmidi ::  Msg -> D -> D
ampmidi :: Msg -> D -> D
ampmidi Msg
_ D
b1 = GE E -> D
D (GE E -> D) -> GE E -> D
forall a b. (a -> b) -> a -> b
$ E -> E
f (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> D -> GE E
unD D
b1
    where f :: E -> E
f E
a1 = Name -> Spec1 -> [E] -> E
opcs Name
"ampmidi" [(Rate
Ir,[Rate
Ir,Rate
Ir])] [E
a1]

-- | 
-- Musically map MIDI velocity to peak amplitude within a specified dynamic range in decibels.
--
-- > iamplitude  ampmidid  ivelocity, idecibels
-- > kamplitude  ampmidid  kvelocity, idecibels
--
-- csound doc: <http://csound.com/docs/manual/ampmidid.html>
ampmidid ::  D -> D -> Sig
ampmidid :: D -> D -> Sig
ampmidid D
b1 D
b2 = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
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 a b. GE (a -> b) -> GE a -> GE b
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
"ampmidid" [(Rate
Ir,[Rate
Ir,Rate
Ir]),(Rate
Kr,[Rate
Kr,Rate
Ir])] [E
a1,E
a2]

-- | 
-- Get the note number of the current MIDI event, expressed in cycles-per-second.
--
-- > icps  cpsmidi 
--
-- csound doc: <http://csound.com/docs/manual/cpsmidi.html>
cpsmidi ::  Msg -> D
cpsmidi :: Msg -> D
cpsmidi Msg
_  = GE E -> D
D (GE E -> D) -> GE E -> D
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall a. a -> GE a
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
"cpsmidi" [(Rate
Ir,[])] []

-- | 
-- Get the note number of the current MIDI event and modify it by the current pitch-bend value, express it in cycles-per-second.
--
-- > icps  cpsmidib  [irange]
-- > kcps  cpsmidib  [irange]
--
-- csound doc: <http://csound.com/docs/manual/cpsmidib.html>
cpsmidib ::  Msg -> Sig
cpsmidib :: Msg -> Sig
cpsmidib Msg
_  = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall a. a -> GE a
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
"cpsmidib" [(Rate
Ir,[Rate
Ir]),(Rate
Kr,[Rate
Ir])] []

-- | 
-- Get a MIDI note number (allows customized micro-tuning scales).
--
-- This unit is similar to cpsmidi, but allows fully customized micro-tuning scales.
--
-- > icps  cpstmid  ifn
--
-- csound doc: <http://csound.com/docs/manual/cpstmid.html>
cpstmid ::  Msg -> Tab -> D
cpstmid :: Msg -> Tab -> D
cpstmid Msg
_ Tab
b1 = GE E -> D
D (GE E -> D) -> GE E -> D
forall a b. (a -> b) -> a -> b
$ E -> E
f (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Tab -> GE E
unTab Tab
b1
    where f :: E -> E
f E
a1 = Name -> Spec1 -> [E] -> E
opcs Name
"cpstmid" [(Rate
Ir,[Rate
Ir])] [E
a1]

-- | 
-- Get the note number, in octave-point-decimal units, of the current MIDI event.
--
-- > ioct  octmidi 
--
-- csound doc: <http://csound.com/docs/manual/octmidi.html>
octmidi ::  Msg -> D
octmidi :: Msg -> D
octmidi Msg
_  = GE E -> D
D (GE E -> D) -> GE E -> D
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall a. a -> GE a
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
"octmidi" [(Rate
Ir,[])] []

-- | 
-- Get the note number of the current MIDI event and modify it by the current pitch-bend value, express it in octave-point-decimal.
--
-- > ioct  octmidib  [irange]
-- > koct  octmidib  [irange]
--
-- csound doc: <http://csound.com/docs/manual/octmidib.html>
octmidib ::  Msg -> Sig
octmidib :: Msg -> Sig
octmidib Msg
_  = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall a. a -> GE a
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
"octmidib" [(Rate
Ir,[Rate
Ir]),(Rate
Kr,[Rate
Ir])] []

-- | 
-- Get the note number of the current MIDI event, expressed in pitch-class units.
--
-- > ipch  pchmidi 
--
-- csound doc: <http://csound.com/docs/manual/pchmidi.html>
pchmidi ::  Msg -> D
pchmidi :: Msg -> D
pchmidi Msg
_  = GE E -> D
D (GE E -> D) -> GE E -> D
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall a. a -> GE a
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
"pchmidi" [(Rate
Ir,[])] []

-- | 
-- Get the note number of the current MIDI event and modify it by the current pitch-bend value, express it in pitch-class units.
--
-- > ipch  pchmidib  [irange]
-- > kpch  pchmidib  [irange]
--
-- csound doc: <http://csound.com/docs/manual/pchmidib.html>
pchmidib ::  Msg -> Sig
pchmidib :: Msg -> Sig
pchmidib Msg
_  = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall a. a -> GE a
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
"pchmidib" [(Rate
Ir,[Rate
Ir]),(Rate
Kr,[Rate
Ir])] []

-- Generic I/O.

-- | 
-- Returns a generic MIDI message received by the MIDI IN port.
--
-- Returns a generic MIDI message received by the MIDI IN port
--
-- > kstatus, kchan, kdata1, kdata2  midiin 
--
-- csound doc: <http://csound.com/docs/manual/midiin.html>
midiin ::   (Sig,Sig,Sig,Sig)
midiin :: (Sig, Sig, Sig, Sig)
midiin  = GE (MultiOut [E]) -> (Sig, Sig, Sig, Sig)
forall a. Tuple a => GE (MultiOut [E]) -> a
pureTuple (GE (MultiOut [E]) -> (Sig, Sig, Sig, Sig))
-> GE (MultiOut [E]) -> (Sig, Sig, Sig, Sig)
forall a b. (a -> b) -> a -> b
$ MultiOut [E] -> GE (MultiOut [E])
forall a. a -> GE a
forall (m :: * -> *) a. Monad m => a -> m a
return (MultiOut [E] -> GE (MultiOut [E]))
-> MultiOut [E] -> GE (MultiOut [E])
forall a b. (a -> b) -> a -> b
$ MultiOut [E]
f 
    where f :: MultiOut [E]
f  = Name -> Specs -> [E] -> MultiOut [E]
mopcs Name
"midiin" ([Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr],[]) []

-- | 
-- Sends a generic MIDI message to the MIDI OUT port.
--
-- >  midiout  kstatus, kchan, kdata1, kdata2
--
-- csound doc: <http://csound.com/docs/manual/midiout.html>
midiout ::  Sig -> Sig -> Sig -> Sig -> SE ()
midiout :: Sig -> Sig -> Sig -> Sig -> SE ()
midiout Sig
b1 Sig
b2 Sig
b3 Sig
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b3 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b4
    where f :: E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 = Name -> Spec1 -> [E] -> E
opcs Name
"midiout" [(Rate
Xr,[Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr])] [E
a1,E
a2,E
a3,E
a4]

-- | 
-- Sends a generic MIDI message to the MIDI OUT port.
--
-- >  midiout_i  istatus, ichan, idata1, idata2
--
-- csound doc: <http://csound.com/docs/manual/midiout_i.html>
midiout_i ::  D -> D -> D -> D -> SE ()
midiout_i :: D -> D -> D -> D -> SE ()
midiout_i D
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> D -> GE E
unD D
b1 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"midiout_i" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4]

-- Event Extenders.

-- | 
-- Indicates whether a note is in its “release” stage.
--
-- Provides a way of knowing when a note off message for the current note is received. Only a noteoff message with the same MIDI note number as the one which triggered the note will be reported by release.
--
-- > kflag  release 
--
-- csound doc: <http://csound.com/docs/manual/release.html>
release ::   Sig
release :: Sig
release  = GE E -> Sig
Sig (GE E -> Sig) -> GE E -> Sig
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall a. a -> GE a
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
"release" [(Rate
Kr,[])] []

-- | 
-- Extend the duration of real-time generated events.
--
-- Extend the duration of real-time generated events and handle their extra life (Usually for usage along with release instead of linenr, linsegr, etc).
--
-- >  xtratim  iextradur
--
-- csound doc: <http://csound.com/docs/manual/xtratim.html>
xtratim ::  D -> SE ()
xtratim :: D -> SE ()
xtratim D
b1 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
f (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> D -> GE E
unD D
b1
    where f :: E -> E
f E
a1 = Name -> Spec1 -> [E] -> E
opcs Name
"xtratim" [(Rate
Xr,[Rate
Ir])] [E
a1]

-- Note Output.

-- | 
-- Generates MIDI note messages at k-rate.
--
-- >  midion  kchn, knum, kvel
--
-- csound doc: <http://csound.com/docs/manual/midion.html>
midion ::  Sig -> Sig -> Sig -> SE ()
midion :: Sig -> Sig -> Sig -> SE ()
midion Sig
b1 Sig
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> Sig -> GE E
unSig Sig
b1 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
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
"midion" [(Rate
Xr,[Rate
Kr,Rate
Kr,Rate
Kr])] [E
a1,E
a2,E
a3]

-- | 
-- Sends noteon and noteoff messages to the MIDI OUT port.
--
-- Sends noteon and noteoff messages to the MIDI OUT port when triggered by a value different than zero.
--
-- >  midion2  kchn, knum, kvel, ktrig
--
-- csound doc: <http://csound.com/docs/manual/midion2.html>
midion2 ::  Sig -> Sig -> Sig -> Sig -> SE ()
midion2 :: Sig -> Sig -> Sig -> Sig -> SE ()
midion2 Sig
b1 Sig
b2 Sig
b3 Sig
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b3 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b4
    where f :: E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 = Name -> Spec1 -> [E] -> E
opcs Name
"midion2" [(Rate
Xr,[Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr])] [E
a1,E
a2,E
a3,E
a4]

-- | 
-- Sends a stream of the MIDI notes.
--
-- >  moscil  kchn, knum, kvel, kdur, kpause
--
-- csound doc: <http://csound.com/docs/manual/moscil.html>
moscil ::  Sig -> Sig -> Sig -> Sig -> Sig -> SE ()
moscil :: Sig -> Sig -> Sig -> Sig -> Sig -> SE ()
moscil Sig
b1 Sig
b2 Sig
b3 Sig
b4 Sig
b5 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 -> E
f (E -> E -> E -> E -> E -> E) -> GE E -> GE (E -> 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 -> E) -> GE E -> GE (E -> E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b3 GE (E -> E -> E) -> GE E -> GE (E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b4 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b5
    where f :: E -> E -> E -> E -> E -> E
f E
a1 E
a2 E
a3 E
a4 E
a5 = Name -> Spec1 -> [E] -> E
opcs Name
"moscil" [(Rate
Xr,[Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr,Rate
Kr])] [E
a1,E
a2,E
a3,E
a4,E
a5]

-- | 
-- Send a noteoff message to the MIDI OUT port.
--
-- >  noteoff  ichn, inum, ivel
--
-- csound doc: <http://csound.com/docs/manual/noteoff.html>
noteoff ::  D -> D -> D -> SE ()
noteoff :: D -> D -> D -> SE ()
noteoff 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"noteoff" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3]

-- | 
-- Send a noteon message to the MIDI OUT port.
--
-- >  noteon  ichn, inum, ivel
--
-- csound doc: <http://csound.com/docs/manual/noteon.html>
noteon ::  D -> D -> D -> SE ()
noteon :: D -> D -> D -> SE ()
noteon 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"noteon" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3]

-- | 
-- Sends a noteon and a noteoff MIDI message both with the same channel, number and velocity.
--
-- >  noteondur  ichn, inum, ivel, idur
--
-- csound doc: <http://csound.com/docs/manual/noteondur.html>
noteondur ::  D -> D -> D -> D -> SE ()
noteondur :: D -> D -> D -> D -> SE ()
noteondur D
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> D -> GE E
unD D
b1 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"noteondur" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4]

-- | 
-- Sends a noteon and a noteoff MIDI message both with the same channel, number and velocity.
--
-- >  noteondur2  ichn, inum, ivel, idur
--
-- csound doc: <http://csound.com/docs/manual/noteondur2.html>
noteondur2 ::  D -> D -> D -> D -> SE ()
noteondur2 :: D -> D -> D -> D -> SE ()
noteondur2 D
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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> D -> GE E
unD D
b1 GE (E -> E -> E -> E) -> GE E -> GE (E -> E -> E)
forall a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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 a b. GE (a -> b) -> GE a -> GE b
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
"noteondur2" [(Rate
Xr,[Rate
Ir,Rate
Ir,Rate
Ir,Rate
Ir])] [E
a1,E
a2,E
a3,E
a4]

-- MIDI/Score Interoperability.

-- | 
-- Gets a MIDI channel's aftertouch value.
--
-- midichannelaftertouch is designed to simplify writing instruments that can be used interchangeably for either score or MIDI input, and to make it easier to adapt instruments originally written for score input to work with MIDI input.
--
-- >  midichannelaftertouch  xchannelaftertouch [, ilow] [, ihigh]
--
-- csound doc: <http://csound.com/docs/manual/midichannelaftertouch.html>
midichannelaftertouch ::  Sig -> SE ()
midichannelaftertouch :: Sig -> SE ()
midichannelaftertouch Sig
b1 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
f (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Sig -> GE E
unSig Sig
b1
    where f :: E -> E
f E
a1 = Name -> Spec1 -> [E] -> E
opcs Name
"midichannelaftertouch" [(Rate
Xr,[Rate
Xr,Rate
Ir,Rate
Ir])] [E
a1]

-- | 
-- Returns the MIDI channel number from which the note was activated.
--
-- midichn returns the MIDI channel number (1 - 16) from which the note was activated. In the case of score notes, it returns 0.
--
-- > ichn  midichn 
--
-- csound doc: <http://csound.com/docs/manual/midichn.html>
midichn ::   D
midichn :: D
midichn  = GE E -> D
D (GE E -> D) -> GE E -> D
forall a b. (a -> b) -> a -> b
$ E -> GE E
forall a. a -> GE a
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
"midichn" [(Rate
Ir,[])] []

-- | 
-- Gets a MIDI control change value.
--
-- midicontrolchange is designed to simplify writing instruments that can be used interchangeably for either score or MIDI input, and to make it easier to adapt instruments originally written for score input to work with MIDI input.
--
-- >  midicontrolchange  xcontroller, xcontrollervalue [, ilow] [, ihigh]
--
-- csound doc: <http://csound.com/docs/manual/midicontrolchange.html>
midicontrolchange ::  Sig -> Sig -> SE ()
midicontrolchange :: Sig -> Sig -> SE ()
midicontrolchange Sig
b1 Sig
b2 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> Sig -> GE E
unSig Sig
b1 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2
    where f :: E -> E -> E
f E
a1 E
a2 = Name -> Spec1 -> [E] -> E
opcs Name
"midicontrolchange" [(Rate
Xr,[Rate
Xr,Rate
Xr,Rate
Ir,Rate
Ir])] [E
a1,E
a2]

-- | 
-- Changes values, depending on MIDI activation.
--
-- mididefault is designed to simplify writing instruments that can be used interchangeably for either score or MIDI input, and to make it easier to adapt instruments originally written for score input to work with MIDI input.
--
-- >  mididefault  xdefault, xvalue
--
-- csound doc: <http://csound.com/docs/manual/mididefault.html>
mididefault ::  Sig -> Sig -> SE ()
mididefault :: Sig -> Sig -> SE ()
mididefault Sig
b1 Sig
b2 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> Sig -> GE E
unSig Sig
b1 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2
    where f :: E -> E -> E
f E
a1 E
a2 = Name -> Spec1 -> [E] -> E
opcs Name
"mididefault" [(Rate
Xr,[Rate
Xr,Rate
Xr])] [E
a1,E
a2]

-- | 
-- Gets a MIDI noteoff value.
--
-- midinoteoff is designed to simplify writing instruments that can be used interchangeably for either score or MIDI input, and to make it easier to adapt instruments originally written for score input to work with MIDI input.
--
-- >  midinoteoff  xkey, xvelocity
--
-- csound doc: <http://csound.com/docs/manual/midinoteoff.html>
midinoteoff ::  Sig -> Sig -> SE ()
midinoteoff :: Sig -> Sig -> SE ()
midinoteoff Sig
b1 Sig
b2 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> Sig -> GE E
unSig Sig
b1 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2
    where f :: E -> E -> E
f E
a1 E
a2 = Name -> Spec1 -> [E] -> E
opcs Name
"midinoteoff" [(Rate
Xr,[Rate
Xr,Rate
Xr])] [E
a1,E
a2]

-- | 
-- Gets a MIDI note number as a cycles-per-second frequency.
--
-- midinoteoncps is designed to simplify writing instruments that can be used interchangeably for either score or MIDI input, and to make it easier to adapt instruments originally written for score input to work with MIDI input.
--
-- >  midinoteoncps  xcps, xvelocity
--
-- csound doc: <http://csound.com/docs/manual/midinoteoncps.html>
midinoteoncps ::  Sig -> Sig -> SE ()
midinoteoncps :: Sig -> Sig -> SE ()
midinoteoncps Sig
b1 Sig
b2 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> Sig -> GE E
unSig Sig
b1 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2
    where f :: E -> E -> E
f E
a1 E
a2 = Name -> Spec1 -> [E] -> E
opcs Name
"midinoteoncps" [(Rate
Xr,[Rate
Xr,Rate
Xr])] [E
a1,E
a2]

-- | 
-- Gets a MIDI note number value.
--
-- midinoteonkey is designed to simplify writing instruments that can be used interchangeably for either score or MIDI input, and to make it easier to adapt instruments originally written for score input to work with MIDI input.
--
-- >  midinoteonkey  xkey, xvelocity
--
-- csound doc: <http://csound.com/docs/manual/midinoteonkey.html>
midinoteonkey ::  Sig -> Sig -> SE ()
midinoteonkey :: Sig -> Sig -> SE ()
midinoteonkey Sig
b1 Sig
b2 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> Sig -> GE E
unSig Sig
b1 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2
    where f :: E -> E -> E
f E
a1 E
a2 = Name -> Spec1 -> [E] -> E
opcs Name
"midinoteonkey" [(Rate
Xr,[Rate
Xr,Rate
Xr])] [E
a1,E
a2]

-- | 
-- Gets a MIDI note number value as octave-point-decimal value.
--
-- midinoteonoct is designed to simplify writing instruments that can be used interchangeably for either score or MIDI input, and to make it easier to adapt instruments originally written for score input to work with MIDI input.
--
-- >  midinoteonoct  xoct, xvelocity
--
-- csound doc: <http://csound.com/docs/manual/midinoteonoct.html>
midinoteonoct ::  Sig -> Sig -> SE ()
midinoteonoct :: Sig -> Sig -> SE ()
midinoteonoct Sig
b1 Sig
b2 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> Sig -> GE E
unSig Sig
b1 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2
    where f :: E -> E -> E
f E
a1 E
a2 = Name -> Spec1 -> [E] -> E
opcs Name
"midinoteonoct" [(Rate
Xr,[Rate
Xr,Rate
Xr])] [E
a1,E
a2]

-- | 
-- Gets a MIDI note number as a pitch-class value.
--
-- midinoteonpch is designed to simplify writing instruments that can be used interchangeably for either score or MIDI input, and to make it easier to adapt instruments originally written for score input to work with MIDI input.
--
-- >  midinoteonpch  xpch, xvelocity
--
-- csound doc: <http://csound.com/docs/manual/midinoteonpch.html>
midinoteonpch ::  Sig -> Sig -> SE ()
midinoteonpch :: Sig -> Sig -> SE ()
midinoteonpch Sig
b1 Sig
b2 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> Sig -> GE E
unSig Sig
b1 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2
    where f :: E -> E -> E
f E
a1 E
a2 = Name -> Spec1 -> [E] -> E
opcs Name
"midinoteonpch" [(Rate
Xr,[Rate
Xr,Rate
Xr])] [E
a1,E
a2]

-- | 
-- Gets a MIDI pitchbend value.
--
-- midipitchbend is designed to simplify writing instruments that can be used interchangeably for either score or MIDI input, and to make it easier to adapt instruments originally written for score input to work with MIDI input.
--
-- >  midipitchbend  xpitchbend [, ilow] [, ihigh]
--
-- csound doc: <http://csound.com/docs/manual/midipitchbend.html>
midipitchbend ::  Sig -> SE ()
midipitchbend :: Sig -> SE ()
midipitchbend Sig
b1 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
f (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Sig -> GE E
unSig Sig
b1
    where f :: E -> E
f E
a1 = Name -> Spec1 -> [E] -> E
opcs Name
"midipitchbend" [(Rate
Xr,[Rate
Xr,Rate
Ir,Rate
Ir])] [E
a1]

-- | 
-- Gets a MIDI polyphonic aftertouch value.
--
-- midipolyaftertouch is designed to simplify writing instruments that can be used interchangeably for either score or MIDI input, and to make it easier to adapt instruments originally written for score input to work with MIDI input.
--
-- >  midipolyaftertouch  xpolyaftertouch, xcontrollervalue [, ilow] [, ihigh]
--
-- csound doc: <http://csound.com/docs/manual/midipolyaftertouch.html>
midipolyaftertouch ::  Sig -> Sig -> SE ()
midipolyaftertouch :: Sig -> Sig -> SE ()
midipolyaftertouch Sig
b1 Sig
b2 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
<$> Sig -> GE E
unSig Sig
b1 GE (E -> E) -> GE E -> GE E
forall a b. GE (a -> b) -> GE a -> GE b
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
<*> Sig -> GE E
unSig Sig
b2
    where f :: E -> E -> E
f E
a1 E
a2 = Name -> Spec1 -> [E] -> E
opcs Name
"midipolyaftertouch" [(Rate
Xr,[Rate
Xr,Rate
Xr,Rate
Ir,Rate
Ir])] [E
a1,E
a2]

-- | 
-- Gets a MIDI program change value.
--
-- midiprogramchange is designed to simplify writing instruments that can be used interchangeably for either score or MIDI input, and to make it easier to adapt instruments originally written for score input to work with MIDI input.
--
-- >  midiprogramchange  xprogram
--
-- csound doc: <http://csound.com/docs/manual/midiprogramchange.html>
midiprogramchange ::  Sig -> SE ()
midiprogramchange :: Sig -> SE ()
midiprogramchange Sig
b1 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
f (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> Sig -> GE E
unSig Sig
b1
    where f :: E -> E
f E
a1 = Name -> Spec1 -> [E] -> E
opcs Name
"midiprogramchange" [(Rate
Xr,[Rate
Xr])] [E
a1]

-- System Realtime.

-- | 
-- Sends a MIDI CLOCK message.
--
-- >  mclock  ifreq
--
-- csound doc: <http://csound.com/docs/manual/mclock.html>
mclock ::  D -> SE ()
mclock :: D -> SE ()
mclock D
b1 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
f (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> D -> GE E
unD D
b1
    where f :: E -> E
f E
a1 = Name -> Spec1 -> [E] -> E
opcs Name
"mclock" [(Rate
Xr,[Rate
Ir])] [E
a1]

-- | 
-- Send system real-time messages to the MIDI OUT port.
--
-- >  mrtmsg  imsgtype
--
-- csound doc: <http://csound.com/docs/manual/mrtmsg.html>
mrtmsg ::  D -> SE ()
mrtmsg :: D -> SE ()
mrtmsg D
b1 = 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 (m :: * -> *) a. Monad m => m a -> DepT m a
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
f (E -> E) -> GE E -> GE E
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> D -> GE E
unD D
b1
    where f :: E -> E
f E
a1 = Name -> Spec1 -> [E] -> E
opcs Name
"mrtmsg" [(Rate
Xr,[Rate
Ir])] [E
a1]