-- | Signal Output
module CsoundExpr.Opcodes.Sigio.Output
    (out,
     out32,
     outc,
     outch,
     outh,
     outo,
     outrg,
     outq,
     outq1,
     outq2,
     outq3,
     outq4,
     outs,
     outs1,
     outs2,
     outx,
     soundout,
     soundouts,
     outvalueK,
     outvalueS,
     outz)
where



import CsoundExpr.Base.Types
import CsoundExpr.Base.MultiOut
import CsoundExpr.Base.SideEffect
import CsoundExpr.Base.UserDefined



-- | * opcode : out
--  
--  
-- * syntax : 
--  
--  >   out asig
--  
--  
-- * description : 
--  
--  Writes mono audio data to an external device or stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/out.html>
 
out :: Arate -> SignalOut
out a0sig = outOpcode "out" args
  where args = [to a0sig]


-- | * opcode : out32
--  
--  
-- * syntax : 
--  
--  >   out32 asig1, asig2, asig3, asig4, asig5, asig6, asig7, asig8, asig10, 
--  >       asig11, asig12, asig13, asig14, asig15, asig16, asig17, asig18, 
--  >       asig19, asig20, asig21, asig22, asig23, asig24, asig25, asig26, 
--  >       asig27, asig28, asig29, asig30, asig31, asig32
--  
--  
-- * description : 
--  
--  Writes 32-channel audio data to an external device or stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/out32.html>
 
out32 ::
        Arate ->
          Arate ->
            Arate ->
              Arate ->
                Arate ->
                  Arate ->
                    Arate ->
                      Arate ->
                        Arate ->
                          Arate ->
                            Arate ->
                              Arate ->
                                Arate ->
                                  Arate ->
                                    Arate ->
                                      Arate ->
                                        Arate ->
                                          Arate ->
                                            Arate ->
                                              Arate ->
                                                Arate ->
                                                  Arate ->
                                                    Arate ->
                                                      Arate ->
                                                        Arate ->
                                                          Arate ->
                                                            Arate ->
                                                              Arate ->
                                                                Arate -> Arate -> Arate -> SignalOut
out32 a0sig1 a1sig2 a2sig3 a3sig4 a4sig5 a5sig6 a6sig7 a7sig8
  a8sig10 a9sig11 a10sig12 a11sig13 a12sig14 a13sig15 a14sig16
  a15sig17 a16sig18 a17sig19 a18sig20 a19sig21 a20sig22 a21sig23
  a22sig24 a23sig25 a24sig26 a25sig27 a26sig28 a27sig29 a28sig30
  a29sig31 a30sig32 = outOpcode "out32" args
  where args
          = [to a0sig1, to a1sig2, to a2sig3, to a3sig4, to a4sig5,
             to a5sig6, to a6sig7, to a7sig8, to a8sig10, to a9sig11,
             to a10sig12, to a11sig13, to a12sig14, to a13sig15, to a14sig16,
             to a15sig17, to a16sig18, to a17sig19, to a18sig20, to a19sig21,
             to a20sig22, to a21sig23, to a22sig24, to a23sig25, to a24sig26,
             to a25sig27, to a26sig28, to a27sig29, to a28sig30, to a29sig31,
             to a30sig32]


-- | * opcode : outc
--  
--  
-- * syntax : 
--  
--  >   outc asig1 [, asig2] [...]
--  
--  
-- * description : 
--  
--  Writes audio data with an arbitrary number of channels to an
-- external device or stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outc.html>
 
outc :: (K k0) => k0 -> [Arate] -> SignalOut
outc k0chan a1sigN = outOpcode "outc" args
  where args = [to k0chan] ++ map to a1sigN


-- | * opcode : outch
--  
--  
-- * syntax : 
--  
--  >   outch kchan1, asig1 [, kchan2] [, asig2] [...]
--  
--  
-- * description : 
--  
--  Writes multi-channel audio data, with user-controllable
-- channels, to an external device or stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outch.html>
 
outch :: (K k0) => k0 -> [Arate] -> SignalOut
outch k0chan a1sigN = outOpcode "outch" args
  where args = [to k0chan] ++ map to a1sigN


-- | * opcode : outh
--  
--  
-- * syntax : 
--  
--  >   outh asig1, asig2, asig3, asig4, asig5, asig6
--  
--  
-- * description : 
--  
--  Writes 6-channel audio data to an external device or stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outh.html>
 
outh ::
       Arate -> Arate -> Arate -> Arate -> Arate -> Arate -> SignalOut
outh a0sig1 a1sig2 a2sig3 a3sig4 a4sig5 a5sig6
  = outOpcode "outh" args
  where args
          = [to a0sig1, to a1sig2, to a2sig3, to a3sig4, to a4sig5,
             to a5sig6]


-- | * opcode : outo
--  
--  
-- * syntax : 
--  
--  >   outo asig1, asig2, asig3, asig4, asig5, asig6, asig7, asig8
--  
--  
-- * description : 
--  
--  Writes 8-channel audio data to an external device or stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outo.html>
 
outo ::
       Arate ->
         Arate ->
           Arate -> Arate -> Arate -> Arate -> Arate -> Arate -> SignalOut
outo a0sig1 a1sig2 a2sig3 a3sig4 a4sig5 a5sig6 a6sig7 a7sig8
  = outOpcode "outo" args
  where args
          = [to a0sig1, to a1sig2, to a2sig3, to a3sig4, to a4sig5,
             to a5sig6, to a6sig7, to a7sig8]


-- | * opcode : outrg
--  
--  
-- * syntax : 
--  
--  >   outrg kstart, aout1 [,aout2, aout3,..., aoutN]
--  
--  
-- * description : 
--  
--  outrg outputs audio to a range of adjacent audio channels on the
-- audio output device.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outrg.html>
 
outrg :: (K k0) => k0 -> [Arate] -> SignalOut
outrg k0start a1outN = outOpcode "outrg" args
  where args = [to k0start] ++ map to a1outN


-- | * opcode : outq
--  
--  
-- * syntax : 
--  
--  >   outq asig1, asig2, asig3, asig4
--  
--  
-- * description : 
--  
--  Writes 4-channel audio data to an external device or stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outq.html>
 
outq :: Arate -> Arate -> Arate -> Arate -> SignalOut
outq a0sig1 a1sig2 a2sig3 a3sig4 = outOpcode "outq" args
  where args = [to a0sig1, to a1sig2, to a2sig3, to a3sig4]


-- | * opcode : outq1
--  
--  
-- * syntax : 
--  
--  >   outq1 asig
--  
--  
-- * description : 
--  
--  Writes samples to quad channel 1 of an external device or
-- stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outq1.html>
 
outq1 :: Arate -> SignalOut
outq1 a0sig = outOpcode "outq1" args
  where args = [to a0sig]


-- | * opcode : outq2
--  
--  
-- * syntax : 
--  
--  >   outq2 asig
--  
--  
-- * description : 
--  
--  Writes samples to quad channel 2 of an external device or
-- stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outq2.html>
 
outq2 :: Arate -> SignalOut
outq2 a0sig = outOpcode "outq2" args
  where args = [to a0sig]


-- | * opcode : outq3
--  
--  
-- * syntax : 
--  
--  >   outq3 asig
--  
--  
-- * description : 
--  
--  Writes samples to quad channel 3 of an external device or
-- stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outq3.html>
 
outq3 :: Arate -> SignalOut
outq3 a0sig = outOpcode "outq3" args
  where args = [to a0sig]


-- | * opcode : outq4
--  
--  
-- * syntax : 
--  
--  >   outq4 asig
--  
--  
-- * description : 
--  
--  Writes samples to quad channel 4 of an external device or
-- stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outq4.html>
 
outq4 :: Arate -> SignalOut
outq4 a0sig = outOpcode "outq4" args
  where args = [to a0sig]


-- | * opcode : outs
--  
--  
-- * syntax : 
--  
--  >   outs asig1, asig2
--  
--  
-- * description : 
--  
--  Writes stereo audio data to an external device or stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outs.html>
 
outs :: Arate -> Arate -> SignalOut
outs a0sig1 a1sig2 = outOpcode "outs" args
  where args = [to a0sig1, to a1sig2]


-- | * opcode : outs1
--  
--  
-- * syntax : 
--  
--  >   outs1 asig
--  
--  
-- * description : 
--  
--  Writes samples to stereo channel 1 of an external device or
-- stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outs1.html>
 
outs1 :: Arate -> SignalOut
outs1 a0sig = outOpcode "outs1" args
  where args = [to a0sig]


-- | * opcode : outs2
--  
--  
-- * syntax : 
--  
--  >   outs2 asig
--  
--  
-- * description : 
--  
--  Writes samples to stereo channel 2 of an external device or
-- stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outs2.html>
 
outs2 :: Arate -> SignalOut
outs2 a0sig = outOpcode "outs2" args
  where args = [to a0sig]


-- | * opcode : outx
--  
--  
-- * syntax : 
--  
--  >   outx asig1, asig2, asig3, asig4, asig5, asig6, asig7, asig8, 
--  >       asig9, asig10, asig11, asig12, asig13, asig14, asig15, asig16
--  
--  
-- * description : 
--  
--  Writes 16-channel audio data to an external device or stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outx.html>
 
outx ::
       Arate ->
         Arate ->
           Arate ->
             Arate ->
               Arate ->
                 Arate ->
                   Arate ->
                     Arate ->
                       Arate ->
                         Arate ->
                           Arate -> Arate -> Arate -> Arate -> Arate -> Arate -> SignalOut
outx a0sig1 a1sig2 a2sig3 a3sig4 a4sig5 a5sig6 a6sig7 a7sig8 a8sig9
  a9sig10 a10sig11 a11sig12 a12sig13 a13sig14 a14sig15 a15sig16
  = outOpcode "outx" args
  where args
          = [to a0sig1, to a1sig2, to a2sig3, to a3sig4, to a4sig5,
             to a5sig6, to a6sig7, to a7sig8, to a8sig9, to a9sig10,
             to a10sig11, to a11sig12, to a12sig13, to a13sig14, to a14sig15,
             to a15sig16]


-- | * opcode : soundout
--  
--  
-- * syntax : 
--  
--  >   soundout asig1, ifilcod [, iformat]
--  
--  
-- * description : 
--  
--  The usage of soundout is discouraged. Please use fout instead.
--  
--  
-- * url : <http://www.csounds.com/manual/html/soundout.html>
 
soundout :: [Irate] -> Arate -> String -> SignalOut
soundout i0init a1sig1 s2file = outOpcode "soundout" args
  where args = [to a1sig1, to s2file] ++ map to i0init


-- | * opcode : soundouts
--  
--  
-- * syntax : 
--  
--  >   soundouts asigl, asigr, ifilcod [, iformat]
--  
--  
-- * description : 
--  
--  The usage of soundouts is discouraged. Please use fout instead.
--  
--  
-- * url : <http://www.csounds.com/manual/html/soundouts.html>
 
soundouts :: [Irate] -> Arate -> Arate -> String -> SignalOut
soundouts i0init a1sigl a2sigr s3file = outOpcode "soundouts" args
  where args = [to a1sigl, to a2sigr, to s3file] ++ map to i0init


-- | * opcode : outvalue
--  
--  
-- * syntax : 
--  
--  >   outvalue "channel name", kvalue
--  >   outvalue "channel name", "string"
--  
--  
-- * description : 
--  
--  Sends a k-rate signal or string to a user-defined channel.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outvalue.html>
 
outvalueK :: (K k0) => String -> k0 -> SignalOut
outvalueK s0channelname k1value = outOpcode "outvalue" args
  where args = [to s0channelname, to k1value]


-- | * opcode : outvalue
--  
--  
-- * syntax : 
--  
--  >   outvalue "channel name", kvalue
--  >   outvalue "channel name", "string"
--  
--  
-- * description : 
--  
--  Sends a k-rate signal or string to a user-defined channel.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outvalue.html>
 
outvalueS :: String -> String -> SignalOut
outvalueS s0channelname s1string = outOpcode "outvalue" args
  where args = [to s0channelname, to s1string]


-- | * opcode : outz
--  
--  
-- * syntax : 
--  
--  >   outz ksig1
--  
--  
-- * description : 
--  
--  Writes multi-channel audio data from a ZAK array to an external
-- device or stream.
--  
--  
-- * url : <http://www.csounds.com/manual/html/outz.html>
 
outz :: (K k0) => k0 -> SignalOut
outz k0sig1 = outOpcode "outz" args
  where args = [to k0sig1]