csound-expression (empty) → 0.0
raw patch · 141 files changed
+31519/−0 lines, 141 filesdep +basedep +containersdep +mtlsetup-changed
Dependencies added: base, containers, mtl, pretty, temporal-media
Files
- LICENSE +30/−0
- Setup.hs +3/−0
- csound-expression.cabal +168/−0
- src/CsoundExpr.hs +6/−0
- src/CsoundExpr/Base.hs +27/−0
- src/CsoundExpr/Base/Arithmetic.hs +87/−0
- src/CsoundExpr/Base/Gens.hs +257/−0
- src/CsoundExpr/Base/Header.hs +128/−0
- src/CsoundExpr/Base/Literal.hs +726/−0
- src/CsoundExpr/Base/MultiOut.hs +1230/−0
- src/CsoundExpr/Base/Pitch.hs +80/−0
- src/CsoundExpr/Base/Score.hs +59/−0
- src/CsoundExpr/Base/SideEffect.hs +95/−0
- src/CsoundExpr/Base/Types.hs +232/−0
- src/CsoundExpr/Base/UserDefined.hs +118/−0
- src/CsoundExpr/Opcodes.hs +40/−0
- src/CsoundExpr/Opcodes/Control.hs +36/−0
- src/CsoundExpr/Opcodes/Control/Clockctl.hs +53/−0
- src/CsoundExpr/Opcodes/Control/Durctl.hs +95/−0
- src/CsoundExpr/Opcodes/Control/FltkAppearance.hs +411/−0
- src/CsoundExpr/Opcodes/Control/FltkGeneral.hs +32/−0
- src/CsoundExpr/Opcodes/Control/FltkIntro.hs +366/−0
- src/CsoundExpr/Opcodes/Control/FltkOther.hs +456/−0
- src/CsoundExpr/Opcodes/Control/FltkValuators.hs +207/−0
- src/CsoundExpr/Opcodes/Control/Invocat.hs +58/−0
- src/CsoundExpr/Opcodes/Control/Pgmctl.hs +54/−0
- src/CsoundExpr/Opcodes/Control/Realtime.hs +164/−0
- src/CsoundExpr/Opcodes/Control/Reinitn.hs +98/−0
- src/CsoundExpr/Opcodes/Control/Sensing.hs +604/−0
- src/CsoundExpr/Opcodes/Control/Stacks.hs +76/−0
- src/CsoundExpr/Opcodes/Control/Subinstrument.hs +13/−0
- src/CsoundExpr/Opcodes/Control/Timeread.hs +256/−0
- src/CsoundExpr/Opcodes/Imageopcodes.hs +8/−0
- src/CsoundExpr/Opcodes/Imageopcodes/Top.hs +125/−0
- src/CsoundExpr/Opcodes/Math.hs +18/−0
- src/CsoundExpr/Opcodes/Math/Amp.hs +122/−0
- src/CsoundExpr/Opcodes/Math/Matfunc.hs +336/−0
- src/CsoundExpr/Opcodes/Math/Opeqfunc.hs +191/−0
- src/CsoundExpr/Opcodes/Math/Rndfunc.hs +54/−0
- src/CsoundExpr/Opcodes/Math/SigmodCompaccum.hs +350/−0
- src/CsoundExpr/Opcodes/Math/Trig.hs +200/−0
- src/CsoundExpr/Opcodes/Midi.hs +24/−0
- src/CsoundExpr/Opcodes/Midi/Convert.hs +258/−0
- src/CsoundExpr/Opcodes/Midi/Extender.hs +58/−0
- src/CsoundExpr/Opcodes/Midi/Generic.hs +54/−0
- src/CsoundExpr/Opcodes/Midi/Input.hs +661/−0
- src/CsoundExpr/Opcodes/Midi/Interop.hs +304/−0
- src/CsoundExpr/Opcodes/Midi/Onoff.hs +164/−0
- src/CsoundExpr/Opcodes/Midi/Output.hs +326/−0
- src/CsoundExpr/Opcodes/Midi/Realtime.hs +53/−0
- src/CsoundExpr/Opcodes/Midi/Slidrbk.hs +421/−0
- src/CsoundExpr/Opcodes/Miscopcodes.hs +8/−0
- src/CsoundExpr/Opcodes/Miscopcodes/Top.hs +69/−0
- src/CsoundExpr/Opcodes/MixerOpcodes.hs +8/−0
- src/CsoundExpr/Opcodes/MixerOpcodes/MixerOpcodes.hs +147/−0
- src/CsoundExpr/Opcodes/OSCNetwork.hs +12/−0
- src/CsoundExpr/Opcodes/OSCNetwork/Network.hs +63/−0
- src/CsoundExpr/Opcodes/OSCNetwork/OSC.hs +81/−0
- src/CsoundExpr/Opcodes/OSCNetwork/Remote.hs +33/−0
- src/CsoundExpr/Opcodes/Pitch.hs +10/−0
- src/CsoundExpr/Opcodes/Pitch/Funcs.hs +246/−0
- src/CsoundExpr/Opcodes/Pitch/Tuning.hs +98/−0
- src/CsoundExpr/Opcodes/Plugin.hs +10/−0
- src/CsoundExpr/Opcodes/Plugin/Dssi4cs.hs +123/−0
- src/CsoundExpr/Opcodes/Plugin/Vst4cs.hs +174/−0
- src/CsoundExpr/Opcodes/Siggen.hs +38/−0
- src/CsoundExpr/Opcodes/Siggen/Additive.hs +117/−0
- src/CsoundExpr/Opcodes/Siggen/Basic.hs +661/−0
- src/CsoundExpr/Opcodes/Siggen/Dynamic.hs +213/−0
- src/CsoundExpr/Opcodes/Siggen/Envelope.hs +409/−0
- src/CsoundExpr/Opcodes/Siggen/Fmsynth.hs +491/−0
- src/CsoundExpr/Opcodes/Siggen/Granular.hs +588/−0
- src/CsoundExpr/Opcodes/Siggen/Hvs.hs +124/−0
- src/CsoundExpr/Opcodes/Siggen/Lineexp.hs +587/−0
- src/CsoundExpr/Opcodes/Siggen/Models.hs +715/−0
- src/CsoundExpr/Opcodes/Siggen/Noise.hs +2725/−0
- src/CsoundExpr/Opcodes/Siggen/Phasors.hs +125/−0
- src/CsoundExpr/Opcodes/Siggen/Sample.hs +1076/−0
- src/CsoundExpr/Opcodes/Siggen/ScanTop.hs +250/−0
- src/CsoundExpr/Opcodes/Siggen/Tableacc.hs +447/−0
- src/CsoundExpr/Opcodes/Siggen/Waveterr.hs +38/−0
- src/CsoundExpr/Opcodes/Siggen/Wavguide.hs +315/−0
- src/CsoundExpr/Opcodes/Sigio.hs +18/−0
- src/CsoundExpr/Opcodes/Sigio/FileIO.hs +506/−0
- src/CsoundExpr/Opcodes/Sigio/Input.hs +348/−0
- src/CsoundExpr/Opcodes/Sigio/Output.hs +535/−0
- src/CsoundExpr/Opcodes/Sigio/Pdisplay.hs +234/−0
- src/CsoundExpr/Opcodes/Sigio/Queries.hs +95/−0
- src/CsoundExpr/Opcodes/Sigio/SoftwareBus.hs +575/−0
- src/CsoundExpr/Opcodes/Sigmod.hs +30/−0
- src/CsoundExpr/Opcodes/Sigmod/Delay.hs +464/−0
- src/CsoundExpr/Opcodes/Sigmod/Panspatl.hs +711/−0
- src/CsoundExpr/Opcodes/Sigmod/Reverbtn.hs +282/−0
- src/CsoundExpr/Opcodes/Sigmod/Sample.hs +370/−0
- src/CsoundExpr/Opcodes/Sigmod/SigProcAmpMod.hs +138/−0
- src/CsoundExpr/Opcodes/Sigmod/SigProcConmorph.hs +157/−0
- src/CsoundExpr/Opcodes/Sigmod/Siglimit.hs +221/−0
- src/CsoundExpr/Opcodes/Sigmod/Speciale.hs +161/−0
- src/CsoundExpr/Opcodes/Sigmod/Speciali.hs +283/−0
- src/CsoundExpr/Opcodes/Sigmod/Standard.hs +976/−0
- src/CsoundExpr/Opcodes/Sigmod/Wavguide.hs +33/−0
- src/CsoundExpr/Opcodes/Sigmod/Wavshape.hs +166/−0
- src/CsoundExpr/Opcodes/SignalFlowGraphOpcodes.hs +8/−0
- src/CsoundExpr/Opcodes/SignalFlowGraphOpcodes/SignalFlowGraphOpcodes.hs +119/−0
- src/CsoundExpr/Opcodes/Spectral.hs +18/−0
- src/CsoundExpr/Opcodes/Spectral/ATS.hs +261/−0
- src/CsoundExpr/Opcodes/Spectral/Loris.hs +97/−0
- src/CsoundExpr/Opcodes/Spectral/Lpcresyn.hs +119/−0
- src/CsoundExpr/Opcodes/Spectral/Nonstand.hs +13/−0
- src/CsoundExpr/Opcodes/Spectral/RealTime.hs +13/−0
- src/CsoundExpr/Opcodes/Spectral/SiggenStft.hs +268/−0
- src/CsoundExpr/Opcodes/Table.hs +12/−0
- src/CsoundExpr/Opcodes/Table/Queries.hs +162/−0
- src/CsoundExpr/Opcodes/Table/Readwrit.hs +600/−0
- src/CsoundExpr/Opcodes/Table/Select.hs +122/−0
- src/CsoundExpr/Opcodes/Vectorial.hs +20/−0
- src/CsoundExpr/Opcodes/Vectorial/EnvelopeGenerators.hs +82/−0
- src/CsoundExpr/Opcodes/Vectorial/Vectorialdelay.hs +78/−0
- src/CsoundExpr/Opcodes/Vectorial/Vectorialimiting.hs +74/−0
- src/CsoundExpr/Opcodes/Vectorial/Vectorialrandom.hs +61/−0
- src/CsoundExpr/Opcodes/Vectorial/Vectorialscalar.hs +183/−0
- src/CsoundExpr/Opcodes/Vectorial/Vectorialtables.hs +294/−0
- src/CsoundExpr/Opcodes/Vectorial/Vectorialvectorial.hs +335/−0
- src/CsoundExpr/Opcodes/Zak.hs +8/−0
- src/CsoundExpr/Opcodes/Zak/Top.hs +326/−0
- src/CsoundExpr/Translator/AssignmentElimination.hs +159/−0
- src/CsoundExpr/Translator/Cs/CsTree.hs +301/−0
- src/CsoundExpr/Translator/Cs/CsoundFile.hs +327/−0
- src/CsoundExpr/Translator/Cs/IM.hs +8/−0
- src/CsoundExpr/Translator/Cs/Utils.hs +37/−0
- src/CsoundExpr/Translator/Csd.hs +98/−0
- src/CsoundExpr/Translator/ExprTree/ExprTree.hs +87/−0
- src/CsoundExpr/Translator/ExprTree/Tree.hs +74/−0
- src/CsoundExpr/Translator/ExprTree/TreeSeq.hs +123/−0
- src/CsoundExpr/Translator/Ftable.hs +110/−0
- src/CsoundExpr/Translator/Header.hs +85/−0
- src/CsoundExpr/Translator/Instr.hs +32/−0
- src/CsoundExpr/Translator/InstrOrder.hs +54/−0
- src/CsoundExpr/Translator/MultiOutsFolding.hs +110/−0
- src/CsoundExpr/Translator/Score.hs +130/−0
- src/CsoundExpr/Translator/Types.hs +215/−0
+ LICENSE view
@@ -0,0 +1,30 @@+Copyright Anton Kholomiov 2010++All rights reserved.++Redistribution and use in source and binary forms, with or without+modification, are permitted provided that the following conditions are met:++ * Redistributions of source code must retain the above copyright+ notice, this list of conditions and the following disclaimer.++ * Redistributions in binary form must reproduce the above+ copyright notice, this list of conditions and the following+ disclaimer in the documentation and/or other materials provided+ with the distribution.++ * Neither the name of Anton Kholomiov nor the names of other+ contributors may be used to endorse or promote products derived+ from this software without specific prior written permission.++THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ Setup.hs view
@@ -0,0 +1,3 @@+#!/usr/bin/env runhaskell+import Distribution.Simple+main = defaultMain
+ csound-expression.cabal view
@@ -0,0 +1,168 @@+Name: csound-expression+Version: 0.0+Cabal-Version: >= 1.2+License: BSD3+License-File: LICENSE+Author: Anton Kholomiov+Maintainer: <anton.kholomiov@gmail.com>+Synopsis: Csound combinator library+Description: Csound code generator+Category: Sound, Music+Stability: Experimental+Tested-With: GHC==6.12.1+Build-Type: Simple+++Library+ Build-Depends:+ base >= 4, base < 5, containers, mtl, pretty, temporal-media == 0.0+ Hs-Source-Dirs: src/+ Exposed-Modules:+ CsoundExpr+-- Base+ CsoundExpr.Base+ CsoundExpr.Base.Types+ CsoundExpr.Base.Literal+ CsoundExpr.Base.MultiOut+ CsoundExpr.Base.SideEffect+ CsoundExpr.Base.Arithmetic+ CsoundExpr.Base.Header+ CsoundExpr.Base.Score+ CsoundExpr.Base.Gens+ CsoundExpr.Base.Pitch+ CsoundExpr.Base.UserDefined+-- Opcodes+ CsoundExpr.Opcodes+ CsoundExpr.Opcodes.Siggen+ CsoundExpr.Opcodes.Sigio+ CsoundExpr.Opcodes.Sigmod+ CsoundExpr.Opcodes.Control+ CsoundExpr.Opcodes.Table+ CsoundExpr.Opcodes.Math+ CsoundExpr.Opcodes.Pitch+ CsoundExpr.Opcodes.Midi+ CsoundExpr.Opcodes.Spectral+ CsoundExpr.Opcodes.Vectorial+ CsoundExpr.Opcodes.Zak+ CsoundExpr.Opcodes.Plugin+ CsoundExpr.Opcodes.OSCNetwork+ CsoundExpr.Opcodes.MixerOpcodes+ CsoundExpr.Opcodes.SignalFlowGraphOpcodes+ CsoundExpr.Opcodes.Imageopcodes+ CsoundExpr.Opcodes.Miscopcodes+ CsoundExpr.Opcodes.Siggen.Additive+ CsoundExpr.Opcodes.Siggen.Basic+ CsoundExpr.Opcodes.Siggen.Dynamic+ CsoundExpr.Opcodes.Siggen.Fmsynth+ CsoundExpr.Opcodes.Siggen.Granular+ CsoundExpr.Opcodes.Siggen.Hvs+ CsoundExpr.Opcodes.Siggen.Lineexp+ CsoundExpr.Opcodes.Siggen.Envelope+ CsoundExpr.Opcodes.Siggen.Models+ CsoundExpr.Opcodes.Siggen.Phasors+ CsoundExpr.Opcodes.Siggen.Noise+ CsoundExpr.Opcodes.Siggen.Sample+ CsoundExpr.Opcodes.Siggen.ScanTop+ CsoundExpr.Opcodes.Siggen.Tableacc+ CsoundExpr.Opcodes.Siggen.Waveterr+ CsoundExpr.Opcodes.Siggen.Wavguide+ CsoundExpr.Opcodes.Sigio.FileIO+ CsoundExpr.Opcodes.Sigio.Input+ CsoundExpr.Opcodes.Sigio.Output+ CsoundExpr.Opcodes.Sigio.SoftwareBus+ CsoundExpr.Opcodes.Sigio.Pdisplay+ CsoundExpr.Opcodes.Sigio.Queries+ CsoundExpr.Opcodes.Sigmod.SigProcAmpMod+ CsoundExpr.Opcodes.Sigmod.SigProcConmorph+ CsoundExpr.Opcodes.Sigmod.Delay+ CsoundExpr.Opcodes.Sigmod.Panspatl+ CsoundExpr.Opcodes.Sigmod.Reverbtn+ CsoundExpr.Opcodes.Sigmod.Sample+ CsoundExpr.Opcodes.Sigmod.Siglimit+ CsoundExpr.Opcodes.Sigmod.Speciale+ CsoundExpr.Opcodes.Sigmod.Standard+ CsoundExpr.Opcodes.Sigmod.Speciali+ CsoundExpr.Opcodes.Sigmod.Wavguide+ CsoundExpr.Opcodes.Sigmod.Wavshape+ CsoundExpr.Opcodes.Control.Clockctl+ CsoundExpr.Opcodes.Control.Durctl+ CsoundExpr.Opcodes.Control.FltkIntro+ CsoundExpr.Opcodes.Control.FltkValuators+ CsoundExpr.Opcodes.Control.FltkOther+ CsoundExpr.Opcodes.Control.FltkAppearance+ CsoundExpr.Opcodes.Control.FltkGeneral+ CsoundExpr.Opcodes.Control.Invocat+ CsoundExpr.Opcodes.Control.Pgmctl+ CsoundExpr.Opcodes.Control.Realtime+ CsoundExpr.Opcodes.Control.Reinitn+ CsoundExpr.Opcodes.Control.Sensing+ CsoundExpr.Opcodes.Control.Stacks+ CsoundExpr.Opcodes.Control.Subinstrument+ CsoundExpr.Opcodes.Control.Timeread+ CsoundExpr.Opcodes.Table.Queries+ CsoundExpr.Opcodes.Table.Readwrit+ CsoundExpr.Opcodes.Table.Select+ CsoundExpr.Opcodes.Math.Amp+ CsoundExpr.Opcodes.Math.SigmodCompaccum+ CsoundExpr.Opcodes.Math.Matfunc+ CsoundExpr.Opcodes.Math.Opeqfunc+ CsoundExpr.Opcodes.Math.Rndfunc+ CsoundExpr.Opcodes.Math.Trig+ CsoundExpr.Opcodes.Pitch.Funcs+ CsoundExpr.Opcodes.Pitch.Tuning+ CsoundExpr.Opcodes.Midi.Input+ CsoundExpr.Opcodes.Midi.Output+ CsoundExpr.Opcodes.Midi.Generic+ CsoundExpr.Opcodes.Midi.Convert+ CsoundExpr.Opcodes.Midi.Extender+ CsoundExpr.Opcodes.Midi.Onoff+ CsoundExpr.Opcodes.Midi.Interop+ CsoundExpr.Opcodes.Midi.Realtime+ CsoundExpr.Opcodes.Midi.Slidrbk+ CsoundExpr.Opcodes.Spectral.SiggenStft+ CsoundExpr.Opcodes.Spectral.Lpcresyn+ CsoundExpr.Opcodes.Spectral.Nonstand+ CsoundExpr.Opcodes.Spectral.RealTime+ CsoundExpr.Opcodes.Spectral.ATS+ CsoundExpr.Opcodes.Spectral.Loris+ CsoundExpr.Opcodes.Vectorial.Vectorialtables+ CsoundExpr.Opcodes.Vectorial.Vectorialscalar+ CsoundExpr.Opcodes.Vectorial.Vectorialvectorial+ CsoundExpr.Opcodes.Vectorial.EnvelopeGenerators+ CsoundExpr.Opcodes.Vectorial.Vectorialimiting+ CsoundExpr.Opcodes.Vectorial.Vectorialdelay+ CsoundExpr.Opcodes.Vectorial.Vectorialrandom+ CsoundExpr.Opcodes.Zak.Top+ CsoundExpr.Opcodes.Plugin.Dssi4cs+ CsoundExpr.Opcodes.Plugin.Vst4cs+ CsoundExpr.Opcodes.OSCNetwork.OSC+ CsoundExpr.Opcodes.OSCNetwork.Network+ CsoundExpr.Opcodes.OSCNetwork.Remote+ CsoundExpr.Opcodes.MixerOpcodes.MixerOpcodes+ CsoundExpr.Opcodes.SignalFlowGraphOpcodes.SignalFlowGraphOpcodes+ CsoundExpr.Opcodes.Imageopcodes.Top+ CsoundExpr.Opcodes.Miscopcodes.Top+---------------------------------------------------------------------------------- + Other-Modules:+-- Trees+ CsoundExpr.Translator.ExprTree.Tree+ CsoundExpr.Translator.ExprTree.TreeSeq+ CsoundExpr.Translator.ExprTree.ExprTree+-- Cs+ CsoundExpr.Translator.Cs.CsoundFile+ CsoundExpr.Translator.Cs.CsTree+ CsoundExpr.Translator.Cs.IM+ CsoundExpr.Translator.Cs.Utils+-- Translator+ CsoundExpr.Translator.Csd+ CsoundExpr.Translator.Ftable+ CsoundExpr.Translator.Header+ CsoundExpr.Translator.Instr+ CsoundExpr.Translator.Score+ CsoundExpr.Translator.InstrOrder+ CsoundExpr.Translator.Types+ CsoundExpr.Translator.AssignmentElimination+ CsoundExpr.Translator.MultiOutsFolding+++
+ src/CsoundExpr.hs view
@@ -0,0 +1,6 @@+module CsoundExpr (+ module CsoundExpr.Base+)+where++import CsoundExpr.Base
+ src/CsoundExpr/Base.hs view
@@ -0,0 +1,27 @@++-- | basic combinators and types+--+-- Imports all 'Base' modules, but "CsoundExpr.Base.UserDefined" +-- and "CsoundExpr.Base.Pitch".+module CsoundExpr.Base (+ module CsoundExpr.Base.Types,+ module CsoundExpr.Base.Literal,+ module CsoundExpr.Base.MultiOut,+ module CsoundExpr.Base.Arithmetic,+ module CsoundExpr.Base.SideEffect,+ module CsoundExpr.Base.Header,+ module CsoundExpr.Base.Score,+ module CsoundExpr.Base.Gens +)+where++import CsoundExpr.Base.Types+import CsoundExpr.Base.Literal+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.Arithmetic+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.Header+import CsoundExpr.Base.Score+import CsoundExpr.Base.Gens ++
+ src/CsoundExpr/Base/Arithmetic.hs view
@@ -0,0 +1,87 @@+{-# LANGUAGE + MultiParamTypeClasses, + TypeSynonymInstances, + FlexibleContexts #-}++-- | Arithmetic operators++module CsoundExpr.Base.Arithmetic + (Opr2, (<+>), neg, (<->), (<*>), (</>))+where++import Prelude hiding (div)++import Control.Applicative(liftA2, (<$>))+import Data.Function(on)++import CsoundExpr.Base.Types+import CsoundExpr.Translator.Cs.CsTree+import CsoundExpr.Translator.ExprTree.ExprTree+import CsoundExpr.Base.UserDefined+++infixr 7 <*>, </>+infixr 6 <+>, <->+++subst :: (IM d a, IM d b, IM d c) => (d -> d -> c) -> (a -> b -> c)+subst f x y = f (to x) (to y)++opr1 :: IM CsTree a => Name -> (Double -> Double) -> CsTree -> a+opr1 name fun a = maybe (infixOperation name $ return a) + from (optim1 fun a)++opr1p :: IM CsTree a => Name -> (Double -> Double) -> CsTree -> a+opr1p name fun a = maybe (prefixOperation name $ return a)+ from (optim1 fun a) ++opr2 :: IM CsTree a => Name -> (Double -> Double -> Double) -> CsTree -> CsTree -> a+opr2 name fun a b = maybe (infixOperation name [a, b])+ from (optim2 fun a b)++optim1 :: (Double -> Double) -> CsTree -> Maybe CsTree+optim1 fun a+ | isVal a' = fmap (double . fun) $ toDouble $ value a'+ | otherwise = Nothing+ where a' = exprOp $ exprTreeTag a++optim2 :: (Double -> Double -> Double) -> CsTree -> CsTree -> Maybe CsTree+optim2 fun a b + | isVal a' && isVal b' = fmap double $+ (liftA2 fun `on` toDouble . value) a' b' + | otherwise = Nothing+ where a' = exprOp $ exprTreeTag a + b' = exprOp $ exprTreeTag b +++----------------------------------------------------------+-- Type inference++(<+>), (<->), (<*>), (</>) :: (X a, X b, X (Opr2 a b)) => a -> b -> Opr2 a b++(<+>) = subst $ opr2 "+" (+)+(<->) = subst $ opr2 "-" (-)+(<*>) = subst $ opr2 "*" (*)+(</>) = subst $ opr2 "/" (/)++-- | negation+neg :: (X a) => a -> a+neg = opr1 "-" negate . to++----------------------------------------------------------+-- Irates+++instance Num Irate where+ (+) = (<+>)+ (*) = (<*>)+ abs = opr1p "abs" abs . to+ signum = error "is undefined"+ (-) = (<->)+ fromInteger = double . fromInteger+++instance Fractional Irate where+ (/) = (</>)+ fromRational = double . fromRational+
+ src/CsoundExpr/Base/Gens.hs view
@@ -0,0 +1,257 @@+{-# LANGUAGE + MultiParamTypeClasses, + FlexibleContexts #-}++-- | Gen routines+-- <http://www.csounds.com/manual/html/ScoreGenRef.html>++module CsoundExpr.Base.Gens + (+ skipNorm,+-- * Empty table (csound f0)+ ftempty,+-- * Sine/Cosine generators+ gen09, gen10, gen11, gen19, gen30, gen33, gen34,+-- * Line/Exponential Segment Generators:+ gen05, gen06, gen07, gen08, gen16, gen25, gen27, +-- * File Access GEN Routines:+ gen01, gen23, gen28,+-- * Numeric Value Access GEN Routines+ gen02, gen17,+-- * Window Function GEN Routines+ gen20,+-- * Random Function GEN Routines+ gen21, gen40, gen41, gen42, gen43, +-- * Waveshaping GEN Routines+ gen03, gen13, gen14, gen15,+-- * Amplitude Scaling GEN Routines+ gen04, gen12, gen24,+-- * Mixing GEN Routines+ gen18, gen31, gen32+) +where++import CsoundExpr.Base.SideEffect+import CsoundExpr.Translator.Types+import CsoundExpr.Translator.ExprTree.ExprTree+import CsoundExpr.Translator.Cs.CsTree+import CsoundExpr.Translator.Cs.Utils+import CsoundExpr.Translator.Cs.IM++-- | ftempty value is rendered to 0 +ftempty :: Irate+ftempty = ftable EmptyFtable++gen :: IM CsTree a => Id -> Size -> [CsTree] -> a +gen id n = ftable . Ftable n . GEN id++genD :: Id -> Size -> [Double] -> Irate+genD id n = gen id n . map ftvalD++ftvalI :: Int -> CsTree+ftvalI = int+ftvalD = double+ftvalS = string++ftvalF :: Irate -> CsTree+ftvalF = ftable . getFtable . to++-- | skip normalization+skipNorm :: Irate -> Irate+skipNorm = from . mapFtable skip . to+ where skip (Ftable n (GEN id xs)) = Ftable n $ GEN (-(abs id)) xs+ ++-- Sine/Cosine generators+-- gen09, gen10, gen11, gen19, gen30, gen33, gen34,++-- GEN09 -- Generate composite waveforms made up of weighted +-- sums of simple sinusoids+-- f # time size 9 pna stra phsa pnb strb phsb+-- pnX - partial no (relative to fundamental)+-- strX - strength+-- phsX - phase++-- | GEN09 - Composite waveforms made up of weighted sums of simple sinusoids.+gen09 :: Int -> [Double] -> Irate+gen09 = genD 9++-- | GEN10 - Composite waveforms made up of weighted sums of simple sinusoids.+gen10 :: Int -> [Double] -> Irate+gen10 = genD 10++-- | GEN11 - Additive set of cosine partials.+gen11 :: Int -> [Double] -> Irate+gen11 = genD 11++-- | GEN19 - Composite waveforms made up of weighted sums of simple sinusoids.+gen19 :: Int -> [Double] -> Irate+gen19 = genD 19+++-- | GEN30 - Generates harmonic partials by analyzing an existing table.+gen30 :: Int -> Irate -> [Double] -> Irate+gen30 = gen3x 30++-- | GEN33 - Generate composite waveforms by mixing simple sinusoids.+gen33 :: Int -> Irate -> [Double] -> Irate+gen33 = gen3x 33+++-- | GEN34 - Generate composite waveforms by mixing simple sinusoids.+gen34 :: Int -> Irate -> [Double] -> Irate+gen34 = gen3x 34++gen3x :: Int -> Int -> Irate -> [Double] -> Irate+gen3x id n ft vs = gen id n $ [ftvalF ft] ++ map ftvalD vs+++-- Line/Exponential Segment Generators:+-- gen05, gen06, gen07, gen08, gen16, gen25, gen27, ++-- GEN05 -- Constructs functions from segments of exponential curves.+-- f # time size 5 a n1 b n2 c ...+-- a, b, c, etc. -- ordinate values, in odd-numbered pfields p5, p7, p9, . . . +-- These must be nonzero and must be alike in sign.+-- n1, n2,... -- length of segment++-- | GEN05 - Constructs functions from segments of exponential curves.+gen05 :: Int -> [Double] -> Irate+gen05 = genD 5++-- | GEN06 - Generates a function comprised of segments of cubic polynomials.+gen06 :: Int -> [Double] -> Irate+gen06 = genD 6++-- | GEN07 - Constructs functions from segments of straight lines.+gen07 :: Int -> [Double] -> Irate+gen07 = genD 7++-- | GEN08 - Generate a piecewise cubic spline curve.+gen08 :: Int -> [Double] -> Irate+gen08 = genD 8++-- | GEN16 - Creates a table from a starting value to an ending value.+gen16 :: Int -> [Double] -> Irate+gen16 = genD 16++-- | GEN25 - Construct functions from segments of exponential curves in breakpoint fashion.+gen25 :: Int -> [Double] -> Irate+gen25 = genD 25++-- | GEN27 - Construct functions from segments of straight lines in breakpoint fashion.+gen27 :: Int -> [Double] -> Irate+gen27 = genD 27+++-- File Access GEN Routines:+-- gen01, gen23, gen28,++-- | GEN01 - Transfers data from a soundfile into a function table.+gen01 :: Int -> String -> [Double] -> Irate+gen01 n file xs = gen 1 n $ [ftvalS file] ++ map ftvalD xs++-- | GEN23 - Reads numeric values from a text file.+gen23 :: Int -> String -> Irate+gen23 n file = gen 23 n [ftvalS file]++-- | GEN28 - Reads a text file which contains a time-tagged trajectory.+gen28 :: Int -> String -> Irate+gen28 n file = gen 28 n [ftvalS file]+++-- Numeric Value Access GEN Routines+-- gen02, gen17,++-- | GEN02 - Transfers data from immediate pfields into a function table.+gen02 :: Int -> [Double] -> Irate+gen02 = genD 2 ++-- | GEN17 - Creates a step function from given x-y pairs.+gen17 :: Int -> [Double] -> Irate+gen17 = genD 17++-- Window Function GEN Routines+-- gen20,++-- | GEN20 - Generates functions of different windows.+gen20 :: Int -> [Double] -> Irate+gen20 = genD 20+++-- Random Function GEN Routines+-- gen21, gen40, gen41, gen42, gen43, ++-- | GEN21 - Generates tables of different random distributions.+gen21 :: Int -> [Double] -> SideEffect Irate+gen21 = gen21 ++-- | GEN41 - Generates a random list of numerical pairs.+gen41 :: Int -> [Double] -> SideEffect Irate+gen41 = gen41 ++-- | GEN42 - Generates a random distribution of discrete ranges of values.+gen42 :: Int -> [Double] -> SideEffect Irate+gen42 = gen42 ++-- | GEN40 - Generates a random distribution using a distribution histogram.+gen40 :: Int -> Irate -> SideEffect Irate+gen40 n ft = gen 40 n [ftvalF ft]++-- | GEN43 - Loads a PVOCEX file containing a PV analysis.+gen43 :: Int -> String -> [Double] -> Irate+gen43 n file vs = gen 43 n $ [ftvalS file] ++ map ftvalD vs+++-- Waveshaping GEN Routines+-- gen03, gen13, gen14, gen15,+++-- | GEN03 - Generates a stored function table by evaluating a polynomial.+gen03 :: Int -> [Double] -> Irate+gen03 = genD 3++-- | GEN13 - Stores a polynomial whose coefficients derive from the Chebyshev polynomials of the first kind.+gen13 :: Int -> [Double] -> Irate+gen13 = genD 13++-- | GEN14 - Stores a polynomial whose coefficients derive from Chebyshevs of the second kind.+gen14 :: Int -> [Double] -> Irate+gen14 = genD 14++-- | GEN15 - Creates two tables of stored polynomial functions.+gen15 :: Int -> [Double] -> Irate+gen15 = genD 15++-- Amplitude Scaling GEN Routines+-- gen04, gen12, gen24,++-- | GEN12 - Generates the log of a modified Bessel function of the second kind.+gen12 :: Int -> [Double] -> Irate+gen12 = genD 12 ++-- | GEN04 - Generates a normalizing function.+gen04 :: Int -> Irate -> [Double] -> Irate+gen04 n ft vs = gen 4 n $ [ftvalF ft] ++ map ftvalD vs++-- | GEN24 - Reads numeric values from another allocated function-table and rescales them.+gen24 :: Int -> Irate -> [Double] -> Irate+gen24 n ft vs = gen 24 n $ [ftvalF ft] ++ map ftvalD vs+++-- Mixing GEN Routines+-- gen18, gen31, gen32++-- | GEN18 - Writes composite waveforms made up of pre-existing waveforms.+gen18 :: Int -> [(Irate, Double, Int, Int)] -> Irate+gen18 n xs = gen 18 n (f =<< xs)+ where f (x1, x2, x3, x4) = [ftvalF x1, ftvalD x2, ftvalI x3, ftvalI x4]++-- | GEN31 - Mixes any waveform specified in an existing table.+gen31 :: Int -> Irate -> [Double] -> Irate+gen31 n ft vs = gen 31 n $ [ftvalF ft] ++ map ftvalD vs++-- | GEN32 - Mixes any waveform, resampled with either FFT or linear interpolation.+gen32 :: Int -> [(Irate, Int, Double, Double)] -> Irate+gen32 n xs = gen 32 n (f =<< xs)+ where f (x1, x2, x3, x4) = [ftvalF x1, ftvalI x2, ftvalD x3, ftvalD x4]
+ src/CsoundExpr/Base/Header.hs view
@@ -0,0 +1,128 @@+-- | Header section++module CsoundExpr.Base.Header + (Header, SignalInit,+ gSr, gKr, gKsmps, gNchnls, g0dbfs,+ massign, pgmassign, instrOrder,+ instr0,+ initA, initK, initI,+ seed, ctrlinit, ftgen+ )+where++import CsoundExpr.Translator.Cs.CsTree (int, argIn, Rate(..))+import CsoundExpr.Translator.Types+import CsoundExpr.Base.UserDefined++-- | Header section+type Header = [SignalInit]++gSr, gKr, gKsmps, gNchnls, g0dbfs :: Irate++gSr = argIn SetupRate "sr"+gKr = argIn SetupRate "kr"+gKsmps = argIn SetupRate "ksmps"+gNchnls = argIn SetupRate "nchnls"+g0dbfs = argIn SetupRate "0dbfs"++massign :: [Int] -- ^ ireset + -> Int -- ^ ichnl+ -> SignalOut -- ^ midi instrument+ -> SignalInit +massign = Massign++pgmassign :: [Int] -- ^ ichn + -> Int -- ^ ipgm+ -> SignalOut -- ^ midi instrument+ -> SignalInit +pgmassign = Pgmassign+++-- | 'instrOrder' defines relative order of instruments in orchestra+-- +-- Instrument is a mapping from note-interface to 'SignalOut'. If two SignalOut's +-- have equal expression-tree structure they are rendered to the same instrument. +-- Value in list refers to expresion-tree structure of instrument.+-- +-- Example :+-- +-- > header = [+-- > gSr 44100,+-- > gKr 4410, +-- > gKsmps 10,+-- > gNchnls 1, +-- > instrOrder [instr1 (0, 0), instr2 ""]+-- > ]+-- +-- > instr1 :: (Irate, Irate) -> SignalOut+-- > instr1 (amp, cps) = out $ oscilA [] amp cps +--+-- > instr2 :: String -> SignalOut+-- > instr2 file = out $ moA1 $ diskin2 [] file (num 1) +-- ++instrOrder :: [SignalOut] -> SignalInit +instrOrder = InstrOrder+++-- | header's initialization statements, like global variables initialization, seed, ctrlinit, fltk, etc.+-- +-- Example :+-- +-- > instr0 [+-- > gar "sig0" <=> initA 0,+-- > gar "sig1" <=> initA 0,+-- > gir "fn" <=> ftgen 0 16384 10 [1],+-- > seed 0+-- > ] ++instr0 :: [SignalOut] -> SignalInit+instr0 = Instr0 . outList ++++init' :: X a => Irate -> a+init' x = opcode "init" [to x]++-- | Puts the value of the i-time expression into a a-rate variable. ++initA :: Irate -> Arate+initA = init'++-- | Puts the value of the i-time expression into a k-rate variable. ++initK :: Irate -> Krate+initK = init'++-- | Puts the value of the i-time expression into a i-rate variable. ++initI :: Irate -> Irate+initI = init'++-- | Sets the global seed value for all x-class noise generators, as well as other opcodes that use a random call, such as grain. +-- +-- > seed ival++seed :: Irate -> SignalOut+seed = outOpcode "seed" . return . to++-- | Sets the initial values for a set of MIDI controllers. +-- +-- > ctrlinit ichnl, ictlno1, ival1 [, ictlno2] [, ival2] [, ictlno3] \+-- > [, ival3] [,...ival32]++ctrlinit :: Irate -> [Irate] -> SignalOut+ctrlinit ichnl ivals = outOpcode "ctrlinit" args+ where args = to ichnl : map to ivals++-- | Generate a score function table from within the orchestra.+-- +-- > gir ftgen ifn, itime, isize, igen, iarga [, iargb ] [...] +-- +-- @ifn@ - is set to zero+-- +-- > ftgen itime isize igen [iargs]++ftgen :: Irate -> Irate -> Irate -> [Irate] -> Irate+ftgen itime isize igen inits = opcode "ftgen" args+ where args = [int 0, to itime, to isize, to igen] ++ map to inits
+ src/CsoundExpr/Base/Literal.hs view
@@ -0,0 +1,726 @@+{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses,+ TypeSynonymInstances, FlexibleContexts #-} + +-- | Functions to write imperative style csound code + +module CsoundExpr.Base.Literal(+ ar,+ kr,+ ir,+ gar,+ gkr,+ gir,+ Assign(..))+where + +import CsoundExpr.Translator.Types+import CsoundExpr.Translator.Cs.IM+import CsoundExpr.Translator.Cs.CsTree+import CsoundExpr.Translator.ExprTree.ExprTree + + +ar :: Name -> Arate+ar = argIn A + + +kr :: Name -> Krate+kr = argIn K + + +ir :: Name -> Irate+ir = argIn I + + +gar :: Name -> Arate+gar = argIn GA + + +gkr :: Name -> Krate+gkr = argIn GK + + +gir :: Name -> Irate+gir = argIn GI + + +fromArgIn :: (IM CsTree a) => a -> (Rate, Name)+fromArgIn a+ | isArg e = (argRate e, argName e)+ | otherwise =+ error "left hand side of <=> should be named expression"+ where e = exprOp $ exprTreeTag t+ t = to a :: CsTree + +-- Assign Class + + +infixr 0 <=> + + +class Assign a where+ + (<=>) :: a -> a -> SignalOut + + +instance Assign Arate where+ sig <=> expr+ = let (rate, name) = fromArgIn sig in+ SignalOut $ return $ argOut rate name expr + + +instance Assign Krate where+ sig <=> expr+ = let (rate, name) = fromArgIn sig in+ SignalOut $ return $ argOut rate name expr + + +instance Assign Irate where+ sig <=> expr+ = let (rate, name) = fromArgIn sig in+ SignalOut $ return $ argOut rate name expr + + +instance (Assign a) => Assign [a] where+ sigs <=> exprs = outList $ zipWith (<=>) sigs exprs + + +instance (Assign a0, Assign a1) => Assign (a0, a1) where+ (sig0, sig1) <=> (exprs0, exprs1)+ = outList [sig0 <=> exprs0, sig1 <=> exprs1] + + +instance (Assign a0, Assign a1, Assign a2) => Assign (a0, a1, a2)+ where+ (sig0, sig1, sig2) <=> (exprs0, exprs1, exprs2)+ = outList [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3) => Assign+ (a0, a1, a2, a3) where+ (sig0, sig1, sig2, sig3) <=> (exprs0, exprs1, exprs2, exprs3)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4) =>+ Assign (a0, a1, a2, a3, a4) where+ (sig0, sig1, sig2, sig3, sig4) <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5) =>+ Assign (a0, a1, a2, a3, a4, a5) where+ (sig0, sig1, sig2, sig3, sig4, sig5) <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6) =>+ Assign (a0, a1, a2, a3, a4, a5, a6) where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6) <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7) =>+ Assign (a0, a1, a2, a3, a4, a5, a6, a7) where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7) <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8) =>+ Assign (a0, a1, a2, a3, a4, a5, a6, a7, a8) where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8) <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9) =>+ Assign (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9) where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9) <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9,+ Assign a10) =>+ Assign (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10) where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11) =>+ Assign (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11) where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12) =>+ Assign (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13) =>+ Assign (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19, Assign a20) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19,+ sig20)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19, exprs20)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19, sig20 <=> exprs20] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19, Assign a20,+ Assign a21) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19,+ sig20, sig21)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19, exprs20, exprs21)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19, sig20 <=> exprs20, sig21 <=> exprs21] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19, Assign a20,+ Assign a21, Assign a22) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19,+ sig20, sig21, sig22)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19, exprs20, exprs21,+ exprs22)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19, sig20 <=> exprs20, sig21 <=> exprs21,+ sig22 <=> exprs22] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19, Assign a20,+ Assign a21, Assign a22, Assign a23) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19,+ sig20, sig21, sig22, sig23)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19, exprs20, exprs21,+ exprs22, exprs23)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19, sig20 <=> exprs20, sig21 <=> exprs21,+ sig22 <=> exprs22, sig23 <=> exprs23] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19, Assign a20,+ Assign a21, Assign a22, Assign a23, Assign a24) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19,+ sig20, sig21, sig22, sig23, sig24)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19, exprs20, exprs21,+ exprs22, exprs23, exprs24)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19, sig20 <=> exprs20, sig21 <=> exprs21,+ sig22 <=> exprs22, sig23 <=> exprs23, sig24 <=> exprs24] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19, Assign a20,+ Assign a21, Assign a22, Assign a23, Assign a24, Assign a25) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19,+ sig20, sig21, sig22, sig23, sig24, sig25)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19, exprs20, exprs21,+ exprs22, exprs23, exprs24, exprs25)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19, sig20 <=> exprs20, sig21 <=> exprs21,+ sig22 <=> exprs22, sig23 <=> exprs23, sig24 <=> exprs24,+ sig25 <=> exprs25] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19, Assign a20,+ Assign a21, Assign a22, Assign a23, Assign a24, Assign a25,+ Assign a26) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19,+ sig20, sig21, sig22, sig23, sig24, sig25, sig26)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19, exprs20, exprs21,+ exprs22, exprs23, exprs24, exprs25, exprs26)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19, sig20 <=> exprs20, sig21 <=> exprs21,+ sig22 <=> exprs22, sig23 <=> exprs23, sig24 <=> exprs24,+ sig25 <=> exprs25, sig26 <=> exprs26] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19, Assign a20,+ Assign a21, Assign a22, Assign a23, Assign a24, Assign a25,+ Assign a26, Assign a27) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19,+ sig20, sig21, sig22, sig23, sig24, sig25, sig26, sig27)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19, exprs20, exprs21,+ exprs22, exprs23, exprs24, exprs25, exprs26, exprs27)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19, sig20 <=> exprs20, sig21 <=> exprs21,+ sig22 <=> exprs22, sig23 <=> exprs23, sig24 <=> exprs24,+ sig25 <=> exprs25, sig26 <=> exprs26, sig27 <=> exprs27] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19, Assign a20,+ Assign a21, Assign a22, Assign a23, Assign a24, Assign a25,+ Assign a26, Assign a27, Assign a28) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27,+ a28)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19,+ sig20, sig21, sig22, sig23, sig24, sig25, sig26, sig27, sig28)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19, exprs20, exprs21,+ exprs22, exprs23, exprs24, exprs25, exprs26, exprs27, exprs28)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19, sig20 <=> exprs20, sig21 <=> exprs21,+ sig22 <=> exprs22, sig23 <=> exprs23, sig24 <=> exprs24,+ sig25 <=> exprs25, sig26 <=> exprs26, sig27 <=> exprs27,+ sig28 <=> exprs28] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19, Assign a20,+ Assign a21, Assign a22, Assign a23, Assign a24, Assign a25,+ Assign a26, Assign a27, Assign a28, Assign a29) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27,+ a28, a29)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19,+ sig20, sig21, sig22, sig23, sig24, sig25, sig26, sig27, sig28,+ sig29)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19, exprs20, exprs21,+ exprs22, exprs23, exprs24, exprs25, exprs26, exprs27, exprs28,+ exprs29)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19, sig20 <=> exprs20, sig21 <=> exprs21,+ sig22 <=> exprs22, sig23 <=> exprs23, sig24 <=> exprs24,+ sig25 <=> exprs25, sig26 <=> exprs26, sig27 <=> exprs27,+ sig28 <=> exprs28, sig29 <=> exprs29] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19, Assign a20,+ Assign a21, Assign a22, Assign a23, Assign a24, Assign a25,+ Assign a26, Assign a27, Assign a28, Assign a29, Assign a30) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27,+ a28, a29, a30)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19,+ sig20, sig21, sig22, sig23, sig24, sig25, sig26, sig27, sig28,+ sig29, sig30)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19, exprs20, exprs21,+ exprs22, exprs23, exprs24, exprs25, exprs26, exprs27, exprs28,+ exprs29, exprs30)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19, sig20 <=> exprs20, sig21 <=> exprs21,+ sig22 <=> exprs22, sig23 <=> exprs23, sig24 <=> exprs24,+ sig25 <=> exprs25, sig26 <=> exprs26, sig27 <=> exprs27,+ sig28 <=> exprs28, sig29 <=> exprs29, sig30 <=> exprs30] + + +instance (Assign a0, Assign a1, Assign a2, Assign a3, Assign a4,+ Assign a5, Assign a6, Assign a7, Assign a8, Assign a9, Assign a10,+ Assign a11, Assign a12, Assign a13, Assign a14, Assign a15,+ Assign a16, Assign a17, Assign a18, Assign a19, Assign a20,+ Assign a21, Assign a22, Assign a23, Assign a24, Assign a25,+ Assign a26, Assign a27, Assign a28, Assign a29, Assign a30,+ Assign a31) =>+ Assign+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27,+ a28, a29, a30, a31)+ where+ (sig0, sig1, sig2, sig3, sig4, sig5, sig6, sig7, sig8, sig9, sig10,+ sig11, sig12, sig13, sig14, sig15, sig16, sig17, sig18, sig19,+ sig20, sig21, sig22, sig23, sig24, sig25, sig26, sig27, sig28,+ sig29, sig30, sig31)+ <=>+ (exprs0, exprs1, exprs2, exprs3, exprs4, exprs5, exprs6, exprs7,+ exprs8, exprs9, exprs10, exprs11, exprs12, exprs13, exprs14,+ exprs15, exprs16, exprs17, exprs18, exprs19, exprs20, exprs21,+ exprs22, exprs23, exprs24, exprs25, exprs26, exprs27, exprs28,+ exprs29, exprs30, exprs31)+ = outList+ [sig0 <=> exprs0, sig1 <=> exprs1, sig2 <=> exprs2,+ sig3 <=> exprs3, sig4 <=> exprs4, sig5 <=> exprs5, sig6 <=> exprs6,+ sig7 <=> exprs7, sig8 <=> exprs8, sig9 <=> exprs9,+ sig10 <=> exprs10, sig11 <=> exprs11, sig12 <=> exprs12,+ sig13 <=> exprs13, sig14 <=> exprs14, sig15 <=> exprs15,+ sig16 <=> exprs16, sig17 <=> exprs17, sig18 <=> exprs18,+ sig19 <=> exprs19, sig20 <=> exprs20, sig21 <=> exprs21,+ sig22 <=> exprs22, sig23 <=> exprs23, sig24 <=> exprs24,+ sig25 <=> exprs25, sig26 <=> exprs26, sig27 <=> exprs27,+ sig28 <=> exprs28, sig29 <=> exprs29, sig30 <=> exprs30,+ sig31 <=> exprs31]
+ src/CsoundExpr/Base/MultiOut.hs view
@@ -0,0 +1,1230 @@+{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses,+ TypeSynonymInstances, FlexibleContexts #-} + +-- | Multiple Out + +module CsoundExpr.Base.MultiOut(+ MultiOut,+ mo,+ moA,+ moK,+ moI,+ mo1,+ mo2,+ mo3,+ mo4,+ mo5,+ mo6,+ mo7,+ mo8,+ mo9,+ mo10,+ mo11,+ mo12,+ mo13,+ mo14,+ mo15,+ mo16,+ mo17,+ mo18,+ mo19,+ mo20,+ mo21,+ mo22,+ mo23,+ mo24,+ mo25,+ mo26,+ mo27,+ mo28,+ mo29,+ mo30,+ mo31,+ mo32,+ moA1,+ moA2,+ moA3,+ moA4,+ moA6,+ moA8,+ moA16,+ moA24,+ moA32,+ moK1,+ moK2,+ moK3,+ moK4,+ moK6,+ moK8,+ moK16,+ moK24,+ moK32,+ moI1,+ moI2,+ moI3,+ moI4,+ moI6,+ moI8,+ moI16,+ moI24,+ moI32)+where + +import CsoundExpr.Translator.Types+import CsoundExpr.Base.Types+import CsoundExpr.Translator.ExprTree.ExprTree+import CsoundExpr.Translator.Cs.CsTree+import CsoundExpr.Translator.Cs.IM + +data MultiOut = MultiOut CsTree + + +instance IM CsTree MultiOut where+ from = MultiOut+ to (MultiOut a) = a + + +labelMO :: (IM CsTree a) => Int -> MultiOut -> a+labelMO id x = from $ outPort id $ (to x :: CsTree) + + +rateOf :: (X a) => a -> Rate+rateOf a = head $ exprType $ exprTreeTag t1+ where t1 = to $ from t0 `asTypeOf` a :: CsTree+ t0 = pure (opc "") [] :: CsTree + +-- | extracts list of values+ +mo :: (X a) => Int -> MultiOut -> [a]+mo n x = map (flip labelMO x) [0 .. n - 1] + + +moA :: Int -> MultiOut -> [Arate]+moA = mo + + +moK :: Int -> MultiOut -> [Krate]+moK = mo + + +moI :: Int -> MultiOut -> [Irate]+moI = mo + + +moA1 :: MultiOut -> (Arate)+moA1 = mo1 + + +moA2 :: MultiOut -> (Arate, Arate)+moA2 = mo2 + + +moA3 :: MultiOut -> (Arate, Arate, Arate)+moA3 = mo3 + + +moA4 :: MultiOut -> (Arate, Arate, Arate, Arate)+moA4 = mo4 + + +moA6 :: MultiOut -> (Arate, Arate, Arate, Arate, Arate, Arate)+moA6 = mo6 + + +moA8 ::+ MultiOut ->+ (Arate, Arate, Arate, Arate, Arate, Arate, Arate, Arate)+moA8 = mo8 + + +moA16 ::+ MultiOut ->+ (Arate, Arate, Arate, Arate, Arate, Arate, Arate, Arate, Arate,+ Arate, Arate, Arate, Arate, Arate, Arate, Arate)+moA16 = mo16 + + +moA24 ::+ MultiOut ->+ (Arate, Arate, Arate, Arate, Arate, Arate, Arate, Arate, Arate,+ Arate, Arate, Arate, Arate, Arate, Arate, Arate, Arate, Arate,+ Arate, Arate, Arate, Arate, Arate, Arate)+moA24 = mo24 + + +moA32 ::+ MultiOut ->+ (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, Arate)+moA32 = mo32 + + +moK1 :: MultiOut -> (Krate)+moK1 = mo1 + + +moK2 :: MultiOut -> (Krate, Krate)+moK2 = mo2 + + +moK3 :: MultiOut -> (Krate, Krate, Krate)+moK3 = mo3 + + +moK4 :: MultiOut -> (Krate, Krate, Krate, Krate)+moK4 = mo4 + + +moK6 :: MultiOut -> (Krate, Krate, Krate, Krate, Krate, Krate)+moK6 = mo6 + + +moK8 ::+ MultiOut ->+ (Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate)+moK8 = mo8 + + +moK16 ::+ MultiOut ->+ (Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate,+ Krate, Krate, Krate, Krate, Krate, Krate, Krate)+moK16 = mo16 + + +moK24 ::+ MultiOut ->+ (Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate,+ Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate,+ Krate, Krate, Krate, Krate, Krate, Krate)+moK24 = mo24 + + +moK32 ::+ MultiOut ->+ (Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate,+ Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate,+ Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate, Krate,+ Krate, Krate, Krate, Krate, Krate)+moK32 = mo32 + + +moI1 :: MultiOut -> (Irate)+moI1 = mo1 + + +moI2 :: MultiOut -> (Irate, Irate)+moI2 = mo2 + + +moI3 :: MultiOut -> (Irate, Irate, Irate)+moI3 = mo3 + + +moI4 :: MultiOut -> (Irate, Irate, Irate, Irate)+moI4 = mo4 + + +moI6 :: MultiOut -> (Irate, Irate, Irate, Irate, Irate, Irate)+moI6 = mo6 + + +moI8 ::+ MultiOut ->+ (Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate)+moI8 = mo8 + + +moI16 ::+ MultiOut ->+ (Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate,+ Irate, Irate, Irate, Irate, Irate, Irate, Irate)+moI16 = mo16 + + +moI24 ::+ MultiOut ->+ (Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate,+ Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate,+ Irate, Irate, Irate, Irate, Irate, Irate)+moI24 = mo24 + + +moI32 ::+ MultiOut ->+ (Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate,+ Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate,+ Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate, Irate,+ Irate, Irate, Irate, Irate, Irate)+moI32 = mo32 + + +mo1 :: (X a0) => MultiOut -> (a0)+mo1 x = (y0)+ where y0 = rateMO rs $ labelMO 0 x+ rs = [rateOf y0] + + +mo2 :: (X a0, X a1) => MultiOut -> (a0, a1)+mo2 x = (y0, y1)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ rs = [rateOf y0, rateOf y1] + + +mo3 :: (X a0, X a1, X a2) => MultiOut -> (a0, a1, a2)+mo3 x = (y0, y1, y2)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ rs = [rateOf y0, rateOf y1, rateOf y2] + + +mo4 :: (X a0, X a1, X a2, X a3) => MultiOut -> (a0, a1, a2, a3)+mo4 x = (y0, y1, y2, y3)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ rs = [rateOf y0, rateOf y1, rateOf y2, rateOf y3] + + +mo5 ::+ (X a0, X a1, X a2, X a3, X a4) => MultiOut -> (a0, a1, a2, a3, a4)+mo5 x = (y0, y1, y2, y3, y4)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ rs = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4] + + +mo6 ::+ (X a0, X a1, X a2, X a3, X a4, X a5) =>+ MultiOut -> (a0, a1, a2, a3, a4, a5)+mo6 x = (y0, y1, y2, y3, y4, y5)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5] + + +mo7 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6) =>+ MultiOut -> (a0, a1, a2, a3, a4, a5, a6)+mo7 x = (y0, y1, y2, y3, y4, y5, y6)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6] + + +mo8 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7) =>+ MultiOut -> (a0, a1, a2, a3, a4, a5, a6, a7)+mo8 x = (y0, y1, y2, y3, y4, y5, y6, y7)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7] + + +mo9 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8) =>+ MultiOut -> (a0, a1, a2, a3, a4, a5, a6, a7, a8)+mo9 x = (y0, y1, y2, y3, y4, y5, y6, y7, y8)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8] + + +mo10 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9) =>+ MultiOut -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9)+mo10 x = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9] + + +mo11 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9,+ X a10) =>+ MultiOut -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)+mo11 x = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10] + + +mo12 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11) =>+ MultiOut -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11)+mo12 x = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11] + + +mo13 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12) =>+ MultiOut -> (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12)+mo13 x = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12] + + +mo14 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13)+mo14 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13] + + +mo15 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14)+mo15 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14] + + +mo16 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15)+mo16 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15] + + +mo17 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16)+mo17 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16] + + +mo18 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17)+mo18 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17] + + +mo19 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18)+mo19 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18] + + +mo20 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19)+mo20 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19] + + +mo21 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19,+ X a20) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20)+mo21 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19, y20)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ y20 = rateMO rs $ labelMO 20 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19, rateOf y20] + + +mo22 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19,+ X a20, X a21) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21)+mo22 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19, y20, y21)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ y20 = rateMO rs $ labelMO 20 x+ y21 = rateMO rs $ labelMO 21 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19, rateOf y20,+ rateOf y21] + + +mo23 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19,+ X a20, X a21, X a22) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22)+mo23 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19, y20, y21, y22)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ y20 = rateMO rs $ labelMO 20 x+ y21 = rateMO rs $ labelMO 21 x+ y22 = rateMO rs $ labelMO 22 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19, rateOf y20,+ rateOf y21, rateOf y22] + + +mo24 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19,+ X a20, X a21, X a22, X a23) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23)+mo24 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19, y20, y21, y22, y23)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ y20 = rateMO rs $ labelMO 20 x+ y21 = rateMO rs $ labelMO 21 x+ y22 = rateMO rs $ labelMO 22 x+ y23 = rateMO rs $ labelMO 23 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19, rateOf y20,+ rateOf y21, rateOf y22, rateOf y23] + + +mo25 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19,+ X a20, X a21, X a22, X a23, X a24) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24)+mo25 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19, y20, y21, y22, y23, y24)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ y20 = rateMO rs $ labelMO 20 x+ y21 = rateMO rs $ labelMO 21 x+ y22 = rateMO rs $ labelMO 22 x+ y23 = rateMO rs $ labelMO 23 x+ y24 = rateMO rs $ labelMO 24 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19, rateOf y20,+ rateOf y21, rateOf y22, rateOf y23, rateOf y24] + + +mo26 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19,+ X a20, X a21, X a22, X a23, X a24, X a25) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25)+mo26 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19, y20, y21, y22, y23, y24, y25)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ y20 = rateMO rs $ labelMO 20 x+ y21 = rateMO rs $ labelMO 21 x+ y22 = rateMO rs $ labelMO 22 x+ y23 = rateMO rs $ labelMO 23 x+ y24 = rateMO rs $ labelMO 24 x+ y25 = rateMO rs $ labelMO 25 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19, rateOf y20,+ rateOf y21, rateOf y22, rateOf y23, rateOf y24, rateOf y25] + + +mo27 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19,+ X a20, X a21, X a22, X a23, X a24, X a25, X a26) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26)+mo27 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19, y20, y21, y22, y23, y24, y25, y26)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ y20 = rateMO rs $ labelMO 20 x+ y21 = rateMO rs $ labelMO 21 x+ y22 = rateMO rs $ labelMO 22 x+ y23 = rateMO rs $ labelMO 23 x+ y24 = rateMO rs $ labelMO 24 x+ y25 = rateMO rs $ labelMO 25 x+ y26 = rateMO rs $ labelMO 26 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19, rateOf y20,+ rateOf y21, rateOf y22, rateOf y23, rateOf y24, rateOf y25,+ rateOf y26] + + +mo28 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19,+ X a20, X a21, X a22, X a23, X a24, X a25, X a26, X a27) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27)+mo28 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19, y20, y21, y22, y23, y24, y25, y26, y27)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ y20 = rateMO rs $ labelMO 20 x+ y21 = rateMO rs $ labelMO 21 x+ y22 = rateMO rs $ labelMO 22 x+ y23 = rateMO rs $ labelMO 23 x+ y24 = rateMO rs $ labelMO 24 x+ y25 = rateMO rs $ labelMO 25 x+ y26 = rateMO rs $ labelMO 26 x+ y27 = rateMO rs $ labelMO 27 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19, rateOf y20,+ rateOf y21, rateOf y22, rateOf y23, rateOf y24, rateOf y25,+ rateOf y26, rateOf y27] + + +mo29 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19,+ X a20, X a21, X a22, X a23, X a24, X a25, X a26, X a27, X a28) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27,+ a28)+mo29 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19, y20, y21, y22, y23, y24, y25, y26, y27,+ y28)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ y20 = rateMO rs $ labelMO 20 x+ y21 = rateMO rs $ labelMO 21 x+ y22 = rateMO rs $ labelMO 22 x+ y23 = rateMO rs $ labelMO 23 x+ y24 = rateMO rs $ labelMO 24 x+ y25 = rateMO rs $ labelMO 25 x+ y26 = rateMO rs $ labelMO 26 x+ y27 = rateMO rs $ labelMO 27 x+ y28 = rateMO rs $ labelMO 28 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19, rateOf y20,+ rateOf y21, rateOf y22, rateOf y23, rateOf y24, rateOf y25,+ rateOf y26, rateOf y27, rateOf y28] + + +mo30 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19,+ X a20, X a21, X a22, X a23, X a24, X a25, X a26, X a27, X a28,+ X a29) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27,+ a28, a29)+mo30 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19, y20, y21, y22, y23, y24, y25, y26, y27,+ y28, y29)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ y20 = rateMO rs $ labelMO 20 x+ y21 = rateMO rs $ labelMO 21 x+ y22 = rateMO rs $ labelMO 22 x+ y23 = rateMO rs $ labelMO 23 x+ y24 = rateMO rs $ labelMO 24 x+ y25 = rateMO rs $ labelMO 25 x+ y26 = rateMO rs $ labelMO 26 x+ y27 = rateMO rs $ labelMO 27 x+ y28 = rateMO rs $ labelMO 28 x+ y29 = rateMO rs $ labelMO 29 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19, rateOf y20,+ rateOf y21, rateOf y22, rateOf y23, rateOf y24, rateOf y25,+ rateOf y26, rateOf y27, rateOf y28, rateOf y29] + + +mo31 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19,+ X a20, X a21, X a22, X a23, X a24, X a25, X a26, X a27, X a28,+ X a29, X a30) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27,+ a28, a29, a30)+mo31 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19, y20, y21, y22, y23, y24, y25, y26, y27,+ y28, y29, y30)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ y20 = rateMO rs $ labelMO 20 x+ y21 = rateMO rs $ labelMO 21 x+ y22 = rateMO rs $ labelMO 22 x+ y23 = rateMO rs $ labelMO 23 x+ y24 = rateMO rs $ labelMO 24 x+ y25 = rateMO rs $ labelMO 25 x+ y26 = rateMO rs $ labelMO 26 x+ y27 = rateMO rs $ labelMO 27 x+ y28 = rateMO rs $ labelMO 28 x+ y29 = rateMO rs $ labelMO 29 x+ y30 = rateMO rs $ labelMO 30 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19, rateOf y20,+ rateOf y21, rateOf y22, rateOf y23, rateOf y24, rateOf y25,+ rateOf y26, rateOf y27, rateOf y28, rateOf y29, rateOf y30] + + +mo32 ::+ (X a0, X a1, X a2, X a3, X a4, X a5, X a6, X a7, X a8, X a9, X a10,+ X a11, X a12, X a13, X a14, X a15, X a16, X a17, X a18, X a19,+ X a20, X a21, X a22, X a23, X a24, X a25, X a26, X a27, X a28,+ X a29, X a30, X a31) =>+ MultiOut ->+ (a0, a1, a2, a3, a4, a5, a6, a7, a8, a9, a10, a11, a12, a13, a14,+ a15, a16, a17, a18, a19, a20, a21, a22, a23, a24, a25, a26, a27,+ a28, a29, a30, a31)+mo32 x+ = (y0, y1, y2, y3, y4, y5, y6, y7, y8, y9, y10, y11, y12, y13, y14,+ y15, y16, y17, y18, y19, y20, y21, y22, y23, y24, y25, y26, y27,+ y28, y29, y30, y31)+ where y0 = rateMO rs $ labelMO 0 x+ y1 = rateMO rs $ labelMO 1 x+ y2 = rateMO rs $ labelMO 2 x+ y3 = rateMO rs $ labelMO 3 x+ y4 = rateMO rs $ labelMO 4 x+ y5 = rateMO rs $ labelMO 5 x+ y6 = rateMO rs $ labelMO 6 x+ y7 = rateMO rs $ labelMO 7 x+ y8 = rateMO rs $ labelMO 8 x+ y9 = rateMO rs $ labelMO 9 x+ y10 = rateMO rs $ labelMO 10 x+ y11 = rateMO rs $ labelMO 11 x+ y12 = rateMO rs $ labelMO 12 x+ y13 = rateMO rs $ labelMO 13 x+ y14 = rateMO rs $ labelMO 14 x+ y15 = rateMO rs $ labelMO 15 x+ y16 = rateMO rs $ labelMO 16 x+ y17 = rateMO rs $ labelMO 17 x+ y18 = rateMO rs $ labelMO 18 x+ y19 = rateMO rs $ labelMO 19 x+ y20 = rateMO rs $ labelMO 20 x+ y21 = rateMO rs $ labelMO 21 x+ y22 = rateMO rs $ labelMO 22 x+ y23 = rateMO rs $ labelMO 23 x+ y24 = rateMO rs $ labelMO 24 x+ y25 = rateMO rs $ labelMO 25 x+ y26 = rateMO rs $ labelMO 26 x+ y27 = rateMO rs $ labelMO 27 x+ y28 = rateMO rs $ labelMO 28 x+ y29 = rateMO rs $ labelMO 29 x+ y30 = rateMO rs $ labelMO 30 x+ y31 = rateMO rs $ labelMO 31 x+ rs+ = [rateOf y0, rateOf y1, rateOf y2, rateOf y3, rateOf y4,+ rateOf y5, rateOf y6, rateOf y7, rateOf y8, rateOf y9, rateOf y10,+ rateOf y11, rateOf y12, rateOf y13, rateOf y14, rateOf y15,+ rateOf y16, rateOf y17, rateOf y18, rateOf y19, rateOf y20,+ rateOf y21, rateOf y22, rateOf y23, rateOf y24, rateOf y25,+ rateOf y26, rateOf y27, rateOf y28, rateOf y29, rateOf y30,+ rateOf y31]
+ src/CsoundExpr/Base/Pitch.hs view
@@ -0,0 +1,80 @@++-- | Csound pitch constants++module CsoundExpr.Base.Pitch + (Pch, Oct,+ c, cs, d, ds, e, es, f, fs, g, gs, a, as, b, bs,+ cb, db, eb, fb, gb, ab, bb, + css, dss, ess, fss, gss, ass, bss,+ cbb, dbb, ebb, fbb, gbb, abb, bbb)+where++import CsoundExpr.Base++type Pch = Irate+type Oct = Int++-- natural, sharps++c, cs, d, ds, e, es, f, fs, g, gs, a, as, b, bs :: Oct -> Pch++c = inDouble (8.00 + ) +cs = inDouble (8.01 + )+d = inDouble (8.02 + )+ds = inDouble (8.03 + )+e = inDouble (8.04 + )+f = inDouble (8.05 + )+fs = inDouble (8.06 + )+g = inDouble (8.07 + )+gs = inDouble (8.08 + )+a = inDouble (8.09 + )+as = inDouble (8.10 + )+b = inDouble (8.11 + )+++inDouble :: (Double -> Double) -> Oct -> Pch+inDouble f = fromDouble . f . toDouble + where toDouble = fromInteger . toInteger+ fromDouble = fromRational . toRational++++es = f+bs = c . (+1)++-- flats++cb, db, eb, fb, gb, ab, bb :: Oct -> Pch++cb = b . (\x -> x - 1)+db = cs+eb = ds+fb = e+gb = fs+ab = gs+bb = as++-- double sharps++css, dss, ess, fss, gss, ass, bss :: Oct -> Pch++css = d+dss = e+ess = fs+fss = g+gss = a+ass = b+bss = cs . (+1)++-- double flats++cbb, dbb, ebb, fbb, gbb, abb, bbb :: Oct -> Pch++cbb = bb . (\x -> x - 1)+dbb = c+ebb = d+fbb = eb+gbb = f+abb = g+bbb = a+
+ src/CsoundExpr/Base/Score.hs view
@@ -0,0 +1,59 @@+{-# LANGUAGE FlexibleContexts #-}+module CsoundExpr.Base.Score (+ Arrangeable(..),+ Time, Dur, Score, toList,+ dur, rest, stretch, note, delay,+ line, chord, loop, cut, tmap)+where++import CsoundExpr.Translator.Types(Time, Dur)+import qualified Temporal.Media as M+import Temporal.Media(Arrangeable(..))++-- | representing score+type Score a = M.MediaUnit Dur () a+++-- | duration+dur :: M.Temporal Dur a => a -> Dur+dur = M.dur++-- | pause+rest :: M.Temporal Dur a => Dur -> a+rest = M.none++-- | stretch in time domain+stretch :: M.Stretchable Dur a => Dur -> a -> a+stretch = M.stretch++-- | constructor of score+note :: Dur -> a -> Score a+note = M.temp++delay :: (M.Temporal Dur a, Arrangeable a) => Dur -> a -> a+delay = M.delay++-- | sequential composition+line :: Arrangeable a => [a] -> a+line = M.sequent++-- | parallel composition+chord :: Arrangeable a => [a] -> a+chord = M.parallel++loop :: Arrangeable a => Int -> a -> a+loop = M.loop++-- | extracting score parts in some time interval.+-- it reverses output if @t1 < t0@.+cut :: Dur -> Dur -> Score a -> Score a+cut = M.cut++-- | temporal functor+tmap :: (Dur -> a -> b) -> Score a -> Score b+tmap = M.tmap++-- | transform 'Score' to 'EventList'+toList :: Score a -> M.EventList Dur a+toList = M.fromMediaUnit (const id)+
+ src/CsoundExpr/Base/SideEffect.hs view
@@ -0,0 +1,95 @@+{-# LANGUAGE MultiParamTypeClasses, TypeSynonymInstances, FlexibleContexts #-}++-- | Side Effects+--+-- 'SideEffect' @a@ means output value @a@ of opcode is not determined +-- completely by arguments and opcode itself. @a@ relies on number of+-- appearences in body of instrument. Way out from 'SideEffect' is+-- provided by selectors. Selector gives value and updated 'SideEffect'+--+-- Example a :+--+-- > q = let (a1, a2) = fst $ se2 $ unirandA (1 :: Irate)+-- > in outs a1 a2+-- +-- generates :+--+-- > a1 unirand 1+-- > a2 unirand 1+-- > outs a1, a2+--+--+-- Example b :+--+-- > q = let a1 = fst $ se1 $ unirandA (1 :: Irate)+-- > a2 = fst $ se1 $ unirandA (1 :: Irate)+-- > in outs a1 a2+-- +-- generates :+--+-- > a1 unirand 1+-- > outs a1, a1+--+-- Example c :+--+-- > q = let v0 = unirandA (1 :: Irate)+-- > (a1, v1) = se1 v0+-- > (a2, _) = se1 v1+-- > in outs a1 a2+-- +-- generates :+--+-- > a1 unirand 1+-- > a2 unirand 1+-- > outs a1, a2+--+--+ +module CsoundExpr.Base.SideEffect + (SideEffect, se,+ se1, se2, se3, se4)+where++import CsoundExpr.Base.Types+import CsoundExpr.Translator.ExprTree.ExprTree+import CsoundExpr.Translator.Cs.CsTree+import CsoundExpr.Translator.Cs.IM+++data SideEffect a = SideEffect Int a++instance IM CsTree a => IM CsTree (SideEffect a) where+ from = SideEffect 0 . from . (mapPurity (const $ Unpure Nothing))+ to (SideEffect _ a) = to a+++labelSE :: IM CsTree a => SideEffect a -> (a, SideEffect a)+labelSE (SideEffect id a) = (from $ f id $ to a, SideEffect (id+1) a)+ where f :: Label -> CsTree -> CsTree+ f = labelUnpure+++se :: IM CsTree a => Int -> SideEffect a -> ([a], SideEffect a)+se n x = foldl f ([], x) [0 .. n]+ where f (vs, x0) _ = let (v, x1) = se1 x0+ in (vs ++ [v], x1)+++se1 :: IM CsTree a => SideEffect a -> (a, SideEffect a)+se1 = labelSE++se2 :: IM CsTree a => SideEffect a -> ((a, a), SideEffect a)+se2 x0 = ((y0, y1), x2)+ where (y0, x1) = se1 x0+ (y1, x2) = se1 x1++se3 :: IM CsTree a => SideEffect a -> ((a, a, a), SideEffect a)+se3 x0 = ((y0, y1, y2), x2)+ where ((y0, y1), x1) = se2 x0+ ( y2 , x2) = se1 x1++se4 :: IM CsTree a => SideEffect a -> ((a, a, a, a), SideEffect a)+se4 x0 = ((y0, y1, y2, y3), x2)+ where ((y0, y1, y2), x1) = se3 x0+ ( y3 , x2) = se1 x1+
+ src/CsoundExpr/Base/Types.hs view
@@ -0,0 +1,232 @@+module CsoundExpr.Base.Types + (X, K,+ Cs.CsoundFile, Cs.Flags,+ Arate, Krate, Irate, + SignalOut, outList,+ ToSignal(..), + itime, idur, num, string,+ csd)+where++import Text.PrettyPrint(Doc, vcat, text, space)++import Temporal.Media(EventList)++import qualified CsoundExpr.Translator.Cs.CsoundFile as Cs+import CsoundExpr.Translator.Cs.CsTree+import CsoundExpr.Translator.Cs.IM++import CsoundExpr.Translator.Types+import CsoundExpr.Translator.Csd++import CsoundExpr.Base.Header++import CsoundExpr.Base.Literal +import CsoundExpr.Base.UserDefined(opcode, prefixOperation)++------------------------------------------+-- Rate conversion++-- | Rate conversion+class ToSignal a where+ arate :: a -> Arate+ krate :: a -> Krate+ irate :: a -> Irate+++instance ToSignal Arate where+ arate = id+ krate = opcode "downsamp" . return . to+ irate = prefixOperation "i" . return . to . krate ++instance ToSignal Krate where+ arate = opcode "upsamp" . return . to+ krate = id+ irate = prefixOperation "i" . return . to+ +instance ToSignal Irate where+ arate = opcode "upsamp" . return . to+ krate = prefixOperation "k" . return . to+ irate = id+ +instance ToSignal Double where+ arate = arate . irate+ krate = krate . irate+ irate = double+++-------------------------------------------+-- constructors++-- | @p2@ p-field+itime :: Irate+itime = param 2++-- | @p3@ p-field+idur :: Irate+idur = param 3++-- | auxiliary function, to write (num n) instead of (n :: Irate)+num :: Irate -> Irate+num = id+++---------------------------------------------+-- show instances++instance Show Arate where+ show x = show $ vcat [title , ppCsTrees $ fromSignalOut (ar "Out" <=> x)]+ where title = text "; Arate expression :"++instance Show Krate where+ show x = show $ vcat [title , ppCsTrees $ fromSignalOut (kr "Out" <=> x)]+ where title = text "; Krate expression :"++instance Show Irate where+ show x = show $ vcat [title , ppCsTrees $ fromSignalOut (ir "Out" <=> x)]+ where title = text "; Irate expression :"++instance Show SignalOut where+ show x = show $ vcat [title , ppCsTrees $ fromSignalOut x]+ where title = text "; SignalOut expression :"+ +---------------------------------------------------+---------------------------------------------------+-- translator++-- | Generate csound code+-- +-- Csound code consists of flags, header section, instruments, +-- ftables and score. Flags are represeted by @String@. See +-- "CsoundExpr.Orchestra.Header" for more details on header +-- section. Instruments, ftables and score are generated from +-- 'EventList' 'Dur' 'SignalOut'. From list of 'SignalOut' notes list +-- of instruments is derived. Expression-tree structures of +-- instruments are different from one another. An instrument +-- can't be transformed into another one only with substitution +-- of values in lists of expression-tree. +--+-- Example (d minor) :+--+-- >import CsoundExpr+-- >import CsoundExpr.Opcodes+-- >import CsoundExpr.Base.Pitch+-- > +-- >flags = "-o dm.wav"+-- >+-- >setup = instr0 [+-- > gSr <=> 44100,+-- > gKr <=> 4410,+-- > gKsmps <=> 10,+-- > gNchnls <=> 1]+-- >+-- >header = [setup]+-- >+-- >sinWave = gen10 4096 [1]+-- >+-- >instr :: Irate -> SignalOut+-- >instr x = out $ oscilA [] (num 1000) (cpspch x) sinWave+-- >+-- >sco = fmap instr $ line $ map (note 1) [d 0, f 0, a 0, d 1]+-- >+-- >main = print $ csd flags header $ toList sco+--+--+-- Example (radiohead - weird fishes, intro) :+--+-- >import CsoundExpr+-- >import CsoundExpr.Opcodes hiding (delay)+-- >import CsoundExpr.Base.Pitch+-- >+-- >+-- >+-- >mapSnd f (a, b) = (a, f b)+-- >+-- >+-- >flags = "-d"+-- >+-- >setupMono = instr0 [+-- > gSr <=> 44100,+-- > gKr <=> 4410,+-- > gKsmps <=> 10,+-- > gNchnls <=> 1 ]+-- > +-- >headerMono = [setupMono]+-- >+-- >-- volume levels+-- >+-- >v1 = 1.3 * v0+-- >v0 = 7000 +--+-- >-- instruments+-- >+-- >pluckInstr :: (Irate, Irate) -> SignalOut +-- >pluckInstr (amp, pch) = outList [+-- > out $ env <*> wgpluck2 0.75 amp (cpspch pch) (num 0.75) (num 0.5), +-- > xtratim 1]+-- > where env = linsegrK [0, idur * 0.05, 1, idur * 0.9, 1] 1 0 +-- >+-- >guitar = pluckInstr . mapSnd (+ (-1))+-- >+-- >+-- >--chords+-- >+-- >guitarChord1, guitarChord2, guitarChord3 :: [Irate] -> Score (Irate, Irate)+-- >+-- >-- volumes 4/4+-- >vs x = map ( * x) $ cycle [v1, v0, v0, v0]+-- >+-- >-- guitar 1+-- >guitarChord1 = line . map return . zip (vs 1) . concat . replicate 10+-- >+-- >ch11 = [d 1, g 0, e 0]+-- >ch12 = map ( + 0.02) ch11+-- >ch13 = [a 1, a 0, cs 1]+-- >ch14 = [fs 1, b 0, g 0]+-- >+-- >chSeq1 = line $ map return $ [ch11, ch12, ch13, ch14]+-- >+-- >-- guitar 2+-- >guitarChord2 = line . map return . zip (vs 0.5) . concat . replicate 6 . arpeggi+-- > where arpeggi x = x ++ take 2 x+-- >+-- >+-- >ch21 = [g 0, d 1, e 1]+-- >ch22 = map (+ 0.02) ch21+-- >ch23 = [cs 1, e 1, a 1]+-- >ch24 = [d 1, g 1, e 1]+-- >+-- >chSeq2 = line $ map return $ [ch21, ch22, ch23, ch24]+-- >+-- >-- guitar 3+-- >guitarChord3 = line . map return . zip (vs 0.2) . concat . replicate 6 . arpeggi+-- > where arpeggi x = take 2 x ++ x+-- >+-- >ch31 = [e 1, g 1, b 1]+-- >ch32 = map (+ 0.02) ch31+-- >ch33 = [fs 1, a 1, cs 2]+-- >ch34 = [d 2, g 1, b 1]+-- >+-- >chSeq3 = line $ map return $ [ch31, ch32, ch33, ch34]+-- >+-- >-- scores+-- >+-- >scoG1 = fmap guitar $ chSeq1 >>= guitarChord1+-- >scoG2 = fmap guitar $ chSeq2 >>= guitarChord2+-- >scoG3 = fmap guitar $ chSeq3 >>= guitarChord3+-- >+-- >scoG2intro = cut (3*30) (4*30) scoG2+-- >+-- >intro = chord [scoG1, scoG3, delay (3*30) scoG2intro]+-- >chords = loop 3 $ chord [scoG1, scoG2, scoG3] +-- >+-- >sco = stretch 0.17 $ intro +:+ chords+-- >+-- >main = print $ csd flags headerMono $ toList sco +--+--+csd :: Cs.Flags -- ^ flags + -> Header -- ^ header section+ -> EventList Dur SignalOut -- ^ score section+ -> Cs.CsoundFile -- ^ csd file+csd = toCsd
+ src/CsoundExpr/Base/UserDefined.hs view
@@ -0,0 +1,118 @@+{-# LANGUAGE + TypeFamilies,+ MultiParamTypeClasses, + TypeSynonymInstances, + FlexibleContexts #-}++-- | Functions to add your own opcodes or operations+--+-- Constructor takes in 'String' and list of CsTree's. 'String' represnts +-- name of opcode\/operation for rendering to csd file. 'CsTree' is an inner +-- type of csound expression. Any type @a@ that belongs to 'IM' 'CsTree' @a@ +-- can be converted to 'CsTree' with 'to' method. ++module CsoundExpr.Base.UserDefined+ (IM(..), Opr2(..), + opcode, outOpcode, + infixOperation, prefixOperation)+where++import CsoundExpr.Translator.Cs.IM+import CsoundExpr.Translator.Cs.CsTree+import CsoundExpr.Translator.ExprTree.ExprTree+import CsoundExpr.Translator.Types+++-- | Opcode constructor+--+-- Example :+-- +-- > ares oscil xamp, xcps, ift, [iphs]+-- > kres oscil kamp, kcps, ift, [iphs]+--+-- > oscilA :: (X a0, X a1) => [Irate] -> a0 -> a1 -> Irate -> Arate+-- > oscilA inits xamp xcps ift = opcode "oscil" args +-- > where args = [to xamp, to xcps, to ift] ++ map to inits+--+-- > oscilK :: (K a0, K a1) => [Irate] -> a0 -> a1 -> Irate -> Krate+-- > oscilK inits kamp kcps ift = opcode "oscil" args +-- > where args = [to kamp, to kcps, to ift] ++ map to inits+--+--+-- > ares noise xamp, kbeta+--+-- > noise :: (X a, K b) => a -> b -> SideEffect Ares+-- > noise xamp kbeta = opcode "noise" args+-- > where args = [to xamp, to kbeta]+--+opcode :: IM CsTree a => String -> [CsTree] -> a +opcode name = from . pure (opc name)++-- | Constructor for opcode that doesn't produce any value +--+-- Example :+--+-- > outs asig1, asig2+-- +-- > outs :: Arate -> Arate -> SignalOut+-- > outs asig1 asig2 = outOpcode "outs" args+-- > where args = [to asig1, to asig2]+--+outOpcode :: String -> [CsTree] -> SignalOut+outOpcode name = SignalOut . return . opcode name++-- | Infix operation constructor+--+-- Example : +--+-- > xres = xsig1 + xsig2+-- +-- > add :: (X a, X b, X (Opr2 a b)) => a -> b -> Opr2 a b+-- > add a b = infixOperation "+" [to a, to b]+--+infixOperation :: IM CsTree a => String -> [CsTree] -> a+infixOperation name = from . pure (oprInfix name)+ +-- | Prefix operation constructor+--+-- Example :+--+-- > xres = sin(xsig)+--+-- > csSin :: X a => a -> a+-- > csSin a = prefixOperation "sin" [to a]+--+prefixOperation :: IM CsTree a => String -> [CsTree] -> a+prefixOperation name = from . pure (oprPrefix name)+++-- | 'Opr2' @a@ @b@ - defines output type of binary arithmetic operator+--+-- > type instance Opr2 Irate Irate = Irate+-- > type instance Opr2 Irate Krate = Krate+-- > type instance Opr2 Irate Arate = Arate+--+-- > type instance Opr2 Krate Irate = Krate+-- > type instance Opr2 Krate Krate = Krate+-- > type instance Opr2 Krate Arate = Arate+--+-- > type instance Opr2 Arate Irate = Arate+-- > type instance Opr2 Arate Krate = Arate+-- > type instance Opr2 Arate Arate = Arate++type family Opr2 a b +-- Is+type instance Opr2 Irate Irate = Irate+type instance Opr2 Irate Krate = Krate+type instance Opr2 Irate Arate = Arate+ +-- Ks+type instance Opr2 Krate Irate = Krate+type instance Opr2 Krate Krate = Krate+type instance Opr2 Krate Arate = Arate+ +-- As+type instance Opr2 Arate Irate = Arate+type instance Opr2 Arate Krate = Arate+type instance Opr2 Arate Arate = Arate+
+ src/CsoundExpr/Opcodes.hs view
@@ -0,0 +1,40 @@+-- | Csound opcodes+module CsoundExpr.Opcodes+ (module CsoundExpr.Opcodes.Siggen,+ module CsoundExpr.Opcodes.Sigio,+ module CsoundExpr.Opcodes.Sigmod,+ module CsoundExpr.Opcodes.Control,+ module CsoundExpr.Opcodes.Table,+ module CsoundExpr.Opcodes.Math,+ module CsoundExpr.Opcodes.Pitch,+ module CsoundExpr.Opcodes.Midi,+ module CsoundExpr.Opcodes.Spectral,+ module CsoundExpr.Opcodes.Vectorial,+ module CsoundExpr.Opcodes.Zak,+ module CsoundExpr.Opcodes.Plugin,+ module CsoundExpr.Opcodes.OSCNetwork,+ module CsoundExpr.Opcodes.MixerOpcodes,+ module CsoundExpr.Opcodes.SignalFlowGraphOpcodes,+ module CsoundExpr.Opcodes.Imageopcodes,+ module CsoundExpr.Opcodes.Miscopcodes)+where++++import CsoundExpr.Opcodes.Siggen+import CsoundExpr.Opcodes.Sigio+import CsoundExpr.Opcodes.Sigmod+import CsoundExpr.Opcodes.Control+import CsoundExpr.Opcodes.Table+import CsoundExpr.Opcodes.Math+import CsoundExpr.Opcodes.Pitch+import CsoundExpr.Opcodes.Midi+import CsoundExpr.Opcodes.Spectral+import CsoundExpr.Opcodes.Vectorial+import CsoundExpr.Opcodes.Zak+import CsoundExpr.Opcodes.Plugin+import CsoundExpr.Opcodes.OSCNetwork+import CsoundExpr.Opcodes.MixerOpcodes+import CsoundExpr.Opcodes.SignalFlowGraphOpcodes+import CsoundExpr.Opcodes.Imageopcodes+import CsoundExpr.Opcodes.Miscopcodes
+ src/CsoundExpr/Opcodes/Control.hs view
@@ -0,0 +1,36 @@+-- | Instrument Control+module CsoundExpr.Opcodes.Control+ (module CsoundExpr.Opcodes.Control.Clockctl,+ module CsoundExpr.Opcodes.Control.Durctl,+ module CsoundExpr.Opcodes.Control.FltkIntro,+ module CsoundExpr.Opcodes.Control.FltkValuators,+ module CsoundExpr.Opcodes.Control.FltkOther,+ module CsoundExpr.Opcodes.Control.FltkAppearance,+ module CsoundExpr.Opcodes.Control.FltkGeneral,+ module CsoundExpr.Opcodes.Control.Invocat,+ module CsoundExpr.Opcodes.Control.Pgmctl,+ module CsoundExpr.Opcodes.Control.Realtime,+ module CsoundExpr.Opcodes.Control.Reinitn,+ module CsoundExpr.Opcodes.Control.Sensing,+ module CsoundExpr.Opcodes.Control.Stacks,+ module CsoundExpr.Opcodes.Control.Subinstrument,+ module CsoundExpr.Opcodes.Control.Timeread)+where++++import CsoundExpr.Opcodes.Control.Clockctl+import CsoundExpr.Opcodes.Control.Durctl+import CsoundExpr.Opcodes.Control.FltkIntro+import CsoundExpr.Opcodes.Control.FltkValuators+import CsoundExpr.Opcodes.Control.FltkOther+import CsoundExpr.Opcodes.Control.FltkAppearance+import CsoundExpr.Opcodes.Control.FltkGeneral+import CsoundExpr.Opcodes.Control.Invocat+import CsoundExpr.Opcodes.Control.Pgmctl+import CsoundExpr.Opcodes.Control.Realtime+import CsoundExpr.Opcodes.Control.Reinitn+import CsoundExpr.Opcodes.Control.Sensing+import CsoundExpr.Opcodes.Control.Stacks+import CsoundExpr.Opcodes.Control.Subinstrument+import CsoundExpr.Opcodes.Control.Timeread
+ src/CsoundExpr/Opcodes/Control/Clockctl.hs view
@@ -0,0 +1,53 @@+-- | Clock Control+module CsoundExpr.Opcodes.Control.Clockctl+ (clockoff,+ clockon)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : clockoff+-- +-- +-- * syntax : +-- +-- > clockoff inum+-- +-- +-- * description : +-- +-- Stops one of a number of internal clocks.+-- +-- +-- * url : <http://www.csounds.com/manual/html/clockoff.html>+ +clockoff :: Irate -> SignalOut+clockoff i0num = outOpcode "clockoff" args+ where args = [to i0num]+++-- | * opcode : clockon+-- +-- +-- * syntax : +-- +-- > clockon inum+-- +-- +-- * description : +-- +-- Starts one of a number of internal clocks.+-- +-- +-- * url : <http://www.csounds.com/manual/html/clockon.html>+ +clockon :: Irate -> SignalOut+clockon i0num = outOpcode "clockon" args+ where args = [to i0num]
+ src/CsoundExpr/Opcodes/Control/Durctl.hs view
@@ -0,0 +1,95 @@+-- | Duration Control Statements+module CsoundExpr.Opcodes.Control.Durctl+ (ihold,+ turnoff,+ turnoff2,+ turnon)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : ihold+-- +-- +-- * syntax : +-- +-- > ihold+-- +-- +-- * description : +-- +-- Causes a finite-duration note to become a held note+-- +-- +-- * url : <http://www.csounds.com/manual/html/ihold.html>+ +ihold :: SignalOut+ihold = outOpcode "ihold" args+ where args = []+++-- | * opcode : turnoff+-- +-- +-- * syntax : +-- +-- > turnoff+-- +-- +-- * description : +-- +-- Enables an instrument to turn itself off.+-- +-- +-- * url : <http://www.csounds.com/manual/html/turnoff.html>+ +turnoff :: SignalOut+turnoff = outOpcode "turnoff" args+ where args = []+++-- | * opcode : turnoff2+-- +-- +-- * syntax : +-- +-- > turnoff2 kinsno, kmode, krelease+-- +-- +-- * description : +-- +-- Turn off instance(s) of other instruments at performance time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/turnoff2.html>+ +turnoff2 :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> SignalOut+turnoff2 k0insno k1mode k2release = outOpcode "turnoff2" args+ where args = [to k0insno, to k1mode, to k2release]+++-- | * opcode : turnon+-- +-- +-- * syntax : +-- +-- > turnon insnum [, itime]+-- +-- +-- * description : +-- +-- Activate an instrument for an indefinite time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/turnon.html>+ +turnon :: [Irate] -> Irate -> SignalOut+turnon i0init i1nsnum = outOpcode "turnon" args+ where args = [to i1nsnum] ++ map to i0init
+ src/CsoundExpr/Opcodes/Control/FltkAppearance.hs view
@@ -0,0 +1,411 @@+-- | Modifying FLTK Widget Appearance+module CsoundExpr.Opcodes.Control.FltkAppearance+ (flColor,+ flColor2,+ flHide,+ flLabel,+ flSetAlign,+ flSetBox,+ flSetColor,+ flSetColor2,+ flSetFont,+ flSetPosition,+ flSetSize,+ flSetText,+ flSetTextColor,+ flSetTextSize,+ flSetTextType,+ flSetVal_i,+ flSetVal,+ flShow)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : FLcolor+-- +-- +-- * syntax : +-- +-- > FLcolor ired, igreen, iblue [, ired2, igreen2, iblue2]+-- +-- +-- * description : +-- +-- Sets the primary colors to RGB values given by the user.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLcolor.html>+ +flColor :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+flColor i0init i1red i2green i3blue = outOpcode "FLcolor" args+ where args = [to i1red, to i2green, to i3blue] ++ map to i0init+++-- | * opcode : FLcolor2+-- +-- +-- * syntax : +-- +-- > FLcolor2 ired, igreen, iblue+-- +-- +-- * description : +-- +-- FLcolor2 is the same of FLcolor except it affects the secondary+-- (selection) color.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLcolor2.html>+ +flColor2 :: Irate -> Irate -> Irate -> SignalOut+flColor2 i0red i1green i2blue = outOpcode "FLcolor2" args+ where args = [to i0red, to i1green, to i2blue]+++-- | * opcode : FLhide+-- +-- +-- * syntax : +-- +-- > FLhide ihandle+-- +-- +-- * description : +-- +-- Hides the target FLTK widget, making it invisible.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLhide.html>+ +flHide :: Irate -> SignalOut+flHide i0handle = outOpcode "FLhide" args+ where args = [to i0handle]+++-- | * opcode : FLlabel+-- +-- +-- * syntax : +-- +-- > FLlabel isize, ifont, ialign, ired, igreen, iblue+-- +-- +-- * description : +-- +-- Modifies a set of parameters related to the text label+-- appearence of a widget (i.e. size, font, alignment and color of+-- corresponding text).+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLlabel.html>+ +flLabel ::+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+flLabel i0size i1font i2align i3red i4green i5blue+ = outOpcode "FLlabel" args+ where args+ = [to i0size, to i1font, to i2align, to i3red, to i4green,+ to i5blue]+++-- | * opcode : FLsetAlign+-- +-- +-- * syntax : +-- +-- > FLsetAlign ialign, ihandle+-- +-- +-- * description : +-- +-- FLsetAlign sets the text alignment of the label of the target+-- widget.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetAlign.html>+ +flSetAlign :: Irate -> Irate -> SignalOut+flSetAlign i0align i1handle = outOpcode "FLsetAlign" args+ where args = [to i0align, to i1handle]+++-- | * opcode : FLsetBox+-- +-- +-- * syntax : +-- +-- > FLsetBox itype, ihandle+-- +-- +-- * description : +-- +-- FLsetBox sets the appearance of a box surrounding the target+-- widget.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetBox.html>+ +flSetBox :: Irate -> Irate -> SignalOut+flSetBox i0type i1handle = outOpcode "FLsetBox" args+ where args = [to i0type, to i1handle]+++-- | * opcode : FLsetColor+-- +-- +-- * syntax : +-- +-- > FLsetColor ired, igreen, iblue, ihandle+-- +-- +-- * description : +-- +-- FLsetColor sets the primary color of the target widget.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetColor.html>+ +flSetColor :: Irate -> Irate -> Irate -> Irate -> SignalOut+flSetColor i0red i1green i2blue i3handle+ = outOpcode "FLsetColor" args+ where args = [to i0red, to i1green, to i2blue, to i3handle]+++-- | * opcode : FLsetColor2+-- +-- +-- * syntax : +-- +-- > FLsetColor2 ired, igreen, iblue, ihandle+-- +-- +-- * description : +-- +-- FLsetColor2 sets the secondary (or selection) color of the+-- target widget.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetColor2.html>+ +flSetColor2 :: Irate -> Irate -> Irate -> Irate -> SignalOut+flSetColor2 i0red i1green i2blue i3handle+ = outOpcode "FLsetColor2" args+ where args = [to i0red, to i1green, to i2blue, to i3handle]+++-- | * opcode : FLsetFont+-- +-- +-- * syntax : +-- +-- > FLsetFont ifont, ihandle+-- +-- +-- * description : +-- +-- FLsetFont sets the font type of the target widget.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetFont.html>+ +flSetFont :: Irate -> Irate -> SignalOut+flSetFont i0font i1handle = outOpcode "FLsetFont" args+ where args = [to i0font, to i1handle]+++-- | * opcode : FLsetPosition+-- +-- +-- * syntax : +-- +-- > FLsetPosition ix, iy, ihandle+-- +-- +-- * description : +-- +-- FLsetPosition sets the position of the target widget according+-- to the ix and iy arguments.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetPosition.html>+ +flSetPosition :: Irate -> Irate -> Irate -> SignalOut+flSetPosition i0x i1y i2handle = outOpcode "FLsetPosition" args+ where args = [to i0x, to i1y, to i2handle]+++-- | * opcode : FLsetSize+-- +-- +-- * syntax : +-- +-- > FLsetSize iwidth, iheight, ihandle+-- +-- +-- * description : +-- +-- FLsetSize resizes the target widget (not the size of its text)+-- according to the iwidth and iheight arguments.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetSize.html>+ +flSetSize :: Irate -> Irate -> Irate -> SignalOut+flSetSize i0width i1height i2handle = outOpcode "FLsetSize" args+ where args = [to i0width, to i1height, to i2handle]+++-- | * opcode : FLsetText+-- +-- +-- * syntax : +-- +-- > FLsetText "itext", ihandle+-- +-- +-- * description : +-- +-- FLsetText sets the label of the target widget to the+-- double-quoted text string provided with the itext argument.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetText.html>+ +flSetText :: String -> Irate -> SignalOut+flSetText s0itext i1handle = outOpcode "FLsetText" args+ where args = [to s0itext, to i1handle]+++-- | * opcode : FLsetTextColor+-- +-- +-- * syntax : +-- +-- > FLsetTextColor ired, iblue, igreen, ihandle+-- +-- +-- * description : +-- +-- FLsetTextColor sets the color of the text label of the target+-- widget.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetTextColor.html>+ +flSetTextColor :: Irate -> Irate -> Irate -> Irate -> SignalOut+flSetTextColor i0red i1blue i2green i3handle+ = outOpcode "FLsetTextColor" args+ where args = [to i0red, to i1blue, to i2green, to i3handle]+++-- | * opcode : FLsetTextSize+-- +-- +-- * syntax : +-- +-- > FLsetTextSize isize, ihandle+-- +-- +-- * description : +-- +-- FLsetTextSize sets the size of the text label of the target+-- widget.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetTextSize.html>+ +flSetTextSize :: Irate -> Irate -> SignalOut+flSetTextSize i0size i1handle = outOpcode "FLsetTextSize" args+ where args = [to i0size, to i1handle]+++-- | * opcode : FLsetTextType+-- +-- +-- * syntax : +-- +-- > FLsetTextType itype, ihandle+-- +-- +-- * description : +-- +-- FLsetTextType sets some attributes related to the fonts of the+-- text label of the target widget.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetTextType.html>+ +flSetTextType :: Irate -> Irate -> SignalOut+flSetTextType i0type i1handle = outOpcode "FLsetTextType" args+ where args = [to i0type, to i1handle]+++-- | * opcode : FLsetVal_i+-- +-- +-- * syntax : +-- +-- > FLsetVal_i ivalue, ihandle+-- +-- +-- * description : +-- +-- FLsetVal_i forces the value of a valuator to a number provided+-- by the user.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetVal_i.html>+ +flSetVal_i :: Irate -> Irate -> SignalOut+flSetVal_i i0value i1handle = outOpcode "FLsetVal_i" args+ where args = [to i0value, to i1handle]+++-- | * opcode : FLsetVal+-- +-- +-- * syntax : +-- +-- > FLsetVal ktrig, kvalue, ihandle+-- +-- +-- * description : +-- +-- FLsetVal is almost identical to FLsetVal_i. Except it operates+-- at k-rate and it affects the target valuator only when ktrig is+-- set to a non-zero value.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetVal.html>+ +flSetVal :: (K k0, K k1) => k0 -> k1 -> Irate -> SignalOut+flSetVal k0trig k1value i2handle = outOpcode "FLsetVal" args+ where args = [to k0trig, to k1value, to i2handle]+++-- | * opcode : FLshow+-- +-- +-- * syntax : +-- +-- > FLshow ihandle+-- +-- +-- * description : +-- +-- FLshow restores the visibility of a previously hidden widget.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLshow.html>+ +flShow :: Irate -> SignalOut+flShow i0handle = outOpcode "FLshow" args+ where args = [to i0handle]
+ src/CsoundExpr/Opcodes/Control/FltkGeneral.hs view
@@ -0,0 +1,32 @@+-- | General FLTK Widget-related Opcodes+module CsoundExpr.Opcodes.Control.FltkGeneral+ (flUpdate)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : FLupdate+-- +-- +-- * syntax : +-- +-- > FLupdate+-- +-- +-- * description : +-- +-- Same as the FLrun opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLupdate.html>+ +flUpdate :: SignalOut+flUpdate = outOpcode "FLupdate" args+ where args = []
+ src/CsoundExpr/Opcodes/Control/FltkIntro.hs view
@@ -0,0 +1,366 @@+-- | FLTK Widgets and GUI controllers+module CsoundExpr.Opcodes.Control.FltkIntro+ (flRun,+ flGetsnap,+ flLoadsnap,+ flSavesnap,+ flSetsnap,+ flSetSnapGroup,+ flGroup,+ flGroupEnd,+ flPack,+ flPackEnd,+ flPanel,+ flPanelEnd,+ flScroll,+ flScrollEnd,+ flTabs,+ flTabsEnd)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : FLrun+-- +-- +-- * syntax : +-- +-- > FLrun+-- +-- +-- * description : +-- +-- Starts the FLTK widget thread.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLrun.html>+ +flRun :: SignalOut+flRun = outOpcode "FLrun" args+ where args = []+++-- | * opcode : FLgetsnap+-- +-- +-- * syntax : +-- +-- > inumsnap FLgetsnap index [, igroup]+-- +-- +-- * description : +-- +-- Retrieves a previously stored snapshot (in memory), i.e. sets+-- all valuator to the corresponding values stored in that snaphot.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLgetsnap.html>+ +flGetsnap :: [Irate] -> Irate -> Irate+flGetsnap i0init i1ndex = opcode "FLgetsnap" args+ where args = [to i1ndex] ++ map to i0init+++-- | * opcode : FLloadsnap+-- +-- +-- * syntax : +-- +-- > FLloadsnap "filename" [, igroup]+-- +-- +-- * description : +-- +-- FLloadsnap loads all the snapshots contained in a file into the+-- memory bank of the current orchestra.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLloadsnap.html>+ +flLoadsnap :: [Irate] -> String -> SignalOut+flLoadsnap i0init s1filename = outOpcode "FLloadsnap" args+ where args = [to s1filename] ++ map to i0init+++-- | * opcode : FLsavesnap+-- +-- +-- * syntax : +-- +-- > FLsavesnap "filename" [, igroup]+-- +-- +-- * description : +-- +-- FLsavesnap saves all snapshots currently created (i.e. the+-- entire memory bank) into a file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsavesnap.html>+ +flSavesnap :: [Irate] -> String -> SignalOut+flSavesnap i0init s1filename = outOpcode "FLsavesnap" args+ where args = [to s1filename] ++ map to i0init+++-- | * opcode : FLsetsnap+-- +-- +-- * syntax : +-- +-- > inumsnap, inumval FLsetsnap index [, ifn, igroup]+-- +-- +-- * description : +-- +-- FLsetsnap stores the current status of all valuators present in+-- the orchestra into a snapshot location (in memory).+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetsnap.html>+ +flSetsnap :: [Irate] -> Irate -> MultiOut+flSetsnap i0init i1ndex = opcode "FLsetsnap" args+ where args = [to i1ndex] ++ map to i0init+++-- | * opcode : FLsetSnapGroup+-- +-- +-- * syntax : +-- +-- > FLsetSnapGroup igroup+-- +-- +-- * description : +-- +-- FLsetSnapGroup determines the snapshot group of valuators+-- declared after it.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLsetSnapGroup.html>+ +flSetSnapGroup :: Irate -> SignalOut+flSetSnapGroup i0group = outOpcode "FLsetSnapGroup" args+ where args = [to i0group]+++-- | * opcode : FLgroup+-- +-- +-- * syntax : +-- +-- > FLgroup "label", iwidth, iheight, ix, iy [, iborder] [, image]+-- +-- +-- * description : +-- +-- A FLTK container opcode that groups child widgets.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLgroup.html>+ +flGroup ::+ [Irate] -> String -> Irate -> Irate -> Irate -> Irate -> SignalOut+flGroup i0init s1label i2width i3height i4x i5y+ = outOpcode "FLgroup" args+ where args+ = [to s1label, to i2width, to i3height, to i4x, to i5y] +++ map to i0init+++-- | * opcode : FLgroupEnd+-- +-- +-- * syntax : +-- +-- > FLgroupEnd+-- +-- +-- * description : +-- +-- Marks the end of a group of FLTK child widgets.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLgroupEnd.html>+ +flGroupEnd :: SignalOut+flGroupEnd = outOpcode "FLgroupEnd" args+ where args = []+++-- | * opcode : FLpack+-- +-- +-- * syntax : +-- +-- > FLpack iwidth, iheight, ix, iy, itype, ispace, iborder+-- +-- +-- * description : +-- +-- FLpack provides the functionality of compressing and aligning+-- widgets.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLpack.html>+ +flPack ::+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+flPack i0width i1height i2x i3y i4type i5space i6border+ = outOpcode "FLpack" args+ where args+ = [to i0width, to i1height, to i2x, to i3y, to i4type, to i5space,+ to i6border]+++-- | * opcode : FLpackEnd+-- +-- +-- * syntax : +-- +-- > FLpackEnd+-- +-- +-- * description : +-- +-- Marks the end of a group of compressed or aligned FLTK widgets.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLpackEnd.html>+ +flPackEnd :: SignalOut+flPackEnd = outOpcode "FLpackEnd" args+ where args = []+++-- | * opcode : FLpanel+-- +-- +-- * syntax : +-- +-- > FLpanel "label", iwidth, iheight [, ix] [, iy] [, iborder] [, ikbdcapture] [, iclose]+-- +-- +-- * description : +-- +-- Creates a window that contains FLTK widgets.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLpanel.html>+ +flPanel :: [Irate] -> String -> Irate -> Irate -> SignalOut+flPanel i0init s1label i2width i3height = outOpcode "FLpanel" args+ where args = [to s1label, to i2width, to i3height] ++ map to i0init+++-- | * opcode : FLpanelEnd+-- +-- +-- * syntax : +-- +-- > FLpanelEnd+-- +-- +-- * description : +-- +-- Marks the end of a group of FLTK widgets contained inside of a+-- window (panel).+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLpanelEnd.html>+ +flPanelEnd :: SignalOut+flPanelEnd = outOpcode "FLpanelEnd" args+ where args = []+++-- | * opcode : FLscroll+-- +-- +-- * syntax : +-- +-- > FLscroll iwidth, iheight [, ix] [, iy]+-- +-- +-- * description : +-- +-- FLscroll adds scroll bars to an area.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLscroll.html>+ +flScroll :: [Irate] -> Irate -> Irate -> SignalOut+flScroll i0init i1width i2height = outOpcode "FLscroll" args+ where args = [to i1width, to i2height] ++ map to i0init+++-- | * opcode : FLscrollEnd+-- +-- +-- * syntax : +-- +-- > FLscrollEnd+-- +-- +-- * description : +-- +-- A FLTK opcode that marks the end of an area with scrollbars.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLscrollEnd.html>+ +flScrollEnd :: SignalOut+flScrollEnd = outOpcode "FLscrollEnd" args+ where args = []+++-- | * opcode : FLtabs+-- +-- +-- * syntax : +-- +-- > FLtabs iwidth, iheight, ix, iy+-- +-- +-- * description : +-- +-- FLtabs is a file card tabs interface that is useful to display+-- several areas containing widgets in the same windows,+-- alternatively. It must be used together with FLgroup, another+-- container that groups child widgets.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLtabs.html>+ +flTabs :: Irate -> Irate -> Irate -> Irate -> SignalOut+flTabs i0width i1height i2x i3y = outOpcode "FLtabs" args+ where args = [to i0width, to i1height, to i2x, to i3y]+++-- | * opcode : FLtabsEnd+-- +-- +-- * syntax : +-- +-- > FLtabsEnd+-- +-- +-- * description : +-- +-- Marks the end of a tabbed FLTK interface.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLtabsEnd.html>+ +flTabsEnd :: SignalOut+flTabsEnd = outOpcode "FLtabsEnd" args+ where args = []
+ src/CsoundExpr/Opcodes/Control/FltkOther.hs view
@@ -0,0 +1,456 @@+-- | Other FLTK Widgets+module CsoundExpr.Opcodes.Control.FltkOther+ (flBox,+ flButBank,+ flButton,+ flKeyIn,+ flHvsBox,+ flMouse,+ flPrintk,+ flPrintk2,+ flSlidBnk,+ flSlidBnk2,+ flSlidBnkGetHandle,+ flSlidBnkSet,+ flSlidBnk2Set,+ flSlidBnk2Setk,+ flValue,+ flVslidBnk,+ flVslidBnk2,+ flXyin)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : FLbox+-- +-- +-- * syntax : +-- +-- > ihandle FLbox "label", itype, ifont, isize, iwidth, iheight, ix, iy [, image]+-- +-- +-- * description : +-- +-- A FLTK widget that displays text inside of a box.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLbox.html>+ +flBox ::+ [Irate] ->+ String ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> Irate+flBox i0init s1label i2type i3font i4size i5width i6height i7x i8y+ = opcode "FLbox" args+ where args+ = [to s1label, to i2type, to i3font, to i4size, to i5width,+ to i6height, to i7x, to i8y]+ ++ map to i0init+++-- | * opcode : FLbutBank+-- +-- +-- * syntax : +-- +-- > kout, ihandle FLbutBank itype, inumx, inumy, iwidth, iheight, ix, iy, +-- > iopcode [, kp1] [, kp2] [, kp3] [, kp4] [, kp5] [....] [, kpN]+-- +-- +-- * description : +-- +-- A FLTK widget opcode that creates a bank of buttons.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLbutBank.html>+ +flButBank ::+ (K k0) =>+ Irate ->+ Irate ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> [k0] -> (Krate, Irate)+flButBank i0type i1numx i2numy i3width i4height i5x i6y i7opcode+ k8vals = mo2 $ opcode "FLbutBank" args+ where args+ = [to i0type, to i1numx, to i2numy, to i3width, to i4height,+ to i5x, to i6y, to i7opcode]+ ++ map to k8vals+++-- | * opcode : FLbutton+-- +-- +-- * syntax : +-- +-- > kout, ihandle FLbutton "label", ion, ioff, itype, iwidth, iheight, ix, +-- > iy, iopcode [, kp1] [, kp2] [, kp3] [, kp4] [, kp5] [....] [, kpN]+-- +-- +-- * description : +-- +-- A FLTK widget opcode that creates a button.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLbutton.html>+ +flButton ::+ (K k0) =>+ String ->+ Irate ->+ Irate ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> [k0] -> (Krate, Irate)+flButton s0label i1on i2off i3type i4width i5height i6x i7y+ i8opcode k9vals = mo2 $ opcode "FLbutton" args+ where args+ = [to s0label, to i1on, to i2off, to i3type, to i4width,+ to i5height, to i6x, to i7y, to i8opcode]+ ++ map to k9vals+++-- | * opcode : FLkeyIn+-- +-- +-- * syntax : +-- +-- > kascii FLkeyIn [ifn]+-- +-- +-- * description : +-- +-- FLkeyIn informs about the status of a key pressed by the user on+-- the alphanumeric keyboard when an FLTK panel has got the focus.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLkeyIn.html>+ +flKeyIn :: [Irate] -> Krate+flKeyIn i0init = opcode "FLkeyIn" args+ where args = map to i0init+++-- | * opcode : FLhvsBox+-- +-- +-- * syntax : +-- +-- > ihandle FLhvsBox inumlinesX, inumlinesY, iwidth, iheight, ix, iy [, image]+-- +-- +-- * description : +-- +-- FLhvsBox displays a box with a grid useful for visualizing+-- two-dimensional Hyper Vectorial Synthesis.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLhvsBox.html>+ +flHvsBox ::+ [Irate] ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> Irate+flHvsBox i0init i1numlinesX i2numlinesY i3width i4height i5x i6y+ = opcode "FLhvsBox" args+ where args+ = [to i1numlinesX, to i2numlinesY, to i3width, to i4height, to i5x,+ to i6y]+ ++ map to i0init+++-- | * opcode : FLmouse+-- +-- +-- * syntax : +-- +-- > kx, ky, kb1, kb2, kb3 FLmouse [imode]+-- +-- +-- * description : +-- +-- FLmouse returns the coordinates of the mouse position within an+-- FLTK panel and the state of the three mouse buttons.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLmouse.html>+ +flMouse :: [Irate] -> MultiOut+flMouse i0init = opcode "FLmouse" args+ where args = map to i0init+++-- | * opcode : FLprintk+-- +-- +-- * syntax : +-- +-- > FLprintk itime, kval, idisp+-- +-- +-- * description : +-- +-- FLprintk is similar to printk but shows values of a k-rate+-- signal in a text field instead of on the console.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLprintk.html>+ +flPrintk :: (K k0) => Irate -> k0 -> Irate -> SignalOut+flPrintk i0time k1val i2disp = outOpcode "FLprintk" args+ where args = [to i0time, to k1val, to i2disp]+++-- | * opcode : FLprintk2+-- +-- +-- * syntax : +-- +-- > FLprintk2 kval, idisp+-- +-- +-- * description : +-- +-- FLprintk2 is similar to FLprintk but shows a k-rate variable's+-- value only when it changes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLprintk2.html>+ +flPrintk2 :: (K k0) => k0 -> Irate -> SignalOut+flPrintk2 k0val i1disp = outOpcode "FLprintk2" args+ where args = [to k0val, to i1disp]+++-- | * opcode : FLslidBnk+-- +-- +-- * syntax : +-- +-- > FLslidBnk "names", inumsliders [, ioutable] [, iwidth] [, iheight] [, ix] +-- > [, iy] [, itypetable] [, iexptable] [, istart_index] [, iminmaxtable]+-- +-- +-- * description : +-- +-- FLslidBnk is a widget containing a bank of horizontal sliders.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLslidBnk.html>+ +flSlidBnk :: [Irate] -> String -> Irate -> SignalOut+flSlidBnk i0init s1names i2numsliders = outOpcode "FLslidBnk" args+ where args = [to s1names, to i2numsliders] ++ map to i0init+++-- | * opcode : FLslidBnk2+-- +-- +-- * syntax : +-- +-- > FLslidBnk2 "names", inumsliders, ioutable, iconfigtable [,iwidth, iheight, ix, iy, istart_index]+-- +-- +-- * description : +-- +-- FLslidBnk2 is a widget containing a bank of horizontal sliders.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLslidBnk2.html>+ +flSlidBnk2 ::+ [Irate] -> String -> Irate -> Irate -> Irate -> SignalOut+flSlidBnk2 i0init s1names i2numsliders i3outable i4configtable+ = outOpcode "FLslidBnk2" args+ where args+ = [to s1names, to i2numsliders, to i3outable, to i4configtable] +++ map to i0init+++-- | * opcode : FLslidBnkGetHandle+-- +-- +-- * syntax : +-- +-- > ihandle FLslidBnkGetHandle+-- +-- +-- * description : +-- +-- FLslidBnkGetHandle gets the handle of last slider bank created.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLslidBnkGetHandle.html>+ +flSlidBnkGetHandle :: Irate+flSlidBnkGetHandle = opcode "FLslidBnkGetHandle" args+ where args = []+++-- | * opcode : FLslidBnkSet+-- +-- +-- * syntax : +-- +-- > FLslidBnkSet ihandle, ifn [, istartIndex, istartSlid, inumSlid]+-- +-- +-- * description : +-- +-- FLslidBnkSet modifies the values of a slider bank according to+-- an array of values stored in a table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLslidBnkSet.html>+ +flSlidBnkSet :: [Irate] -> Irate -> Irate -> SignalOut+flSlidBnkSet i0init i1handle i2fn = outOpcode "FLslidBnkSet" args+ where args = [to i1handle, to i2fn] ++ map to i0init+++-- | * opcode : FLslidBnk2Set+-- +-- +-- * syntax : +-- +-- > FLslidBnk2Set ihandle, ifn [, istartIndex, istartSlid, inumSlid]+-- +-- +-- * description : +-- +-- FLslidBnk2Set modifies the values of a slider bank according to+-- an array of values stored in a table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLslidBnk2Set.html>+ +flSlidBnk2Set :: [Irate] -> Irate -> Irate -> SignalOut+flSlidBnk2Set i0init i1handle i2fn = outOpcode "FLslidBnk2Set" args+ where args = [to i1handle, to i2fn] ++ map to i0init+++-- | * opcode : FLslidBnk2Setk+-- +-- +-- * syntax : +-- +-- > FLslidBnk2Setk ktrig, ihandle, ifn [, istartIndex, istartSlid, inumSlid]+-- +-- +-- * description : +-- +-- FLslidBnk2Setk modifies the values of a slider bank according to+-- an array of values stored in a table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLslidBnk2Setk.html>+ +flSlidBnk2Setk ::+ (K k0) => [Irate] -> k0 -> Irate -> Irate -> SignalOut+flSlidBnk2Setk i0init k1trig i2handle i3fn+ = outOpcode "FLslidBnk2Setk" args+ where args = [to k1trig, to i2handle, to i3fn] ++ map to i0init+++-- | * opcode : FLvalue+-- +-- +-- * syntax : +-- +-- > ihandle FLvalue "label", iwidth, iheight, ix, iy+-- +-- +-- * description : +-- +-- FLvalue shows current the value of a valuator in a text field.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLvalue.html>+ +flValue :: String -> Irate -> Irate -> Irate -> Irate -> Irate+flValue s0label i1width i2height i3x i4y = opcode "FLvalue" args+ where args = [to s0label, to i1width, to i2height, to i3x, to i4y]+++-- | * opcode : FLvslidBnk+-- +-- +-- * syntax : +-- +-- > FLvslidBnk "names", inumsliders [, ioutable] [, iwidth] [, iheight] [, ix] +-- > [, iy] [, itypetable] [, iexptable] [, istart_index] [, iminmaxtable]+-- +-- +-- * description : +-- +-- FLvslidBnk is a widget containing a bank of vertical sliders.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLvslidBnk.html>+ +flVslidBnk :: [Irate] -> String -> Irate -> SignalOut+flVslidBnk i0init s1names i2numsliders+ = outOpcode "FLvslidBnk" args+ where args = [to s1names, to i2numsliders] ++ map to i0init+++-- | * opcode : FLvslidBnk2+-- +-- +-- * syntax : +-- +-- > FLvslidBnk2 "names", inumsliders, ioutable, iconfigtable [,iwidth, iheight, ix, iy, istart_index]+-- +-- +-- * description : +-- +-- FLvslidBnk2 is a widget containing a bank of vertical sliders.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLvslidBnk2.html>+ +flVslidBnk2 ::+ [Irate] -> String -> Irate -> Irate -> Irate -> SignalOut+flVslidBnk2 i0init s1names i2numsliders i3outable i4configtable+ = outOpcode "FLvslidBnk2" args+ where args+ = [to s1names, to i2numsliders, to i3outable, to i4configtable] +++ map to i0init+++-- | * opcode : FLxyin+-- +-- +-- * syntax : +-- +-- > koutx, kouty, kinside FLxyin ioutx_min, ioutx_max, iouty_min, iouty_max, +-- > iwindx_min, iwindx_max, iwindy_min, iwindy_max [, iexpx, iexpy, ioutx, iouty]+-- +-- +-- * description : +-- +-- Similar to xyin, sense the mouse cursor position in a+-- user-defined area inside an FLpanel.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLxyin.html>+ +flXyin ::+ [Irate] ->+ Irate ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> MultiOut+flXyin i0init i1outx_min i2outx_max i3outy_min i4outy_max+ i5windx_min i6windx_max i7windy_min i8windy_max+ = opcode "FLxyin" args+ where args+ = [to i1outx_min, to i2outx_max, to i3outy_min, to i4outy_max,+ to i5windx_min, to i6windx_max, to i7windy_min, to i8windy_max]+ ++ map to i0init
+ src/CsoundExpr/Opcodes/Control/FltkValuators.hs view
@@ -0,0 +1,207 @@+-- | FLTK Valuators+module CsoundExpr.Opcodes.Control.FltkValuators+ (flCount,+ flJoy,+ flKnob,+ flRoller,+ flSlider,+ flText)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : FLcount+-- +-- +-- * syntax : +-- +-- > kout, ihandle FLcount "label", imin, imax, istep1, istep2, itype, +-- > iwidth, iheight, ix, iy, iopcode [, kp1] [, kp2] [, kp3] [...] [, kpN]+-- +-- +-- * description : +-- +-- Allows the user to increase/decrease a value with mouse clicks+-- on a corresponding arrow button.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLcount.html>+ +flCount ::+ (K k0) =>+ String ->+ Irate ->+ Irate ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> [k0] -> (Krate, Irate)+flCount s0label i1min i2max i3step1 i4step2 i5type i6width i7height+ i8opcode k9vals = mo2 $ opcode "FLcount" args+ where args+ = [to s0label, to i1min, to i2max, to i3step1, to i4step2,+ to i5type, to i6width, to i7height, to i8opcode]+ ++ map to k9vals+++-- | * opcode : FLjoy+-- +-- +-- * syntax : +-- +-- > koutx, kouty, ihandlex, ihandley FLjoy "label", iminx, imaxx, iminy, +-- > imaxy, iexpx, iexpy, idispx, idispy, iwidth, iheight, ix, iy+-- +-- +-- * description : +-- +-- FLjoy is a squared area that allows the user to modify two+-- output values at the same time. It acts like a joystick.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLjoy.html>+ +flJoy ::+ String ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> (Krate, Krate, Irate, Irate)+flJoy s0label i1minx i2maxx i3miny i4maxy i5expx i6expy i7dispx+ i8dispy i9width i10height i11x i12y = mo4 $ opcode "FLjoy" args+ where args+ = [to s0label, to i1minx, to i2maxx, to i3miny, to i4maxy,+ to i5expx, to i6expy, to i7dispx, to i8dispy, to i9width,+ to i10height, to i11x, to i12y]+++-- | * opcode : FLknob+-- +-- +-- * syntax : +-- +-- > kout, ihandle FLknob "label", imin, imax, iexp, itype, idisp, iwidth, +-- > ix, iy [, icursorsize]+-- +-- +-- * description : +-- +-- A FLTK widget opcode that creates a knob.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLknob.html>+ +flKnob ::+ [Irate] ->+ String ->+ Irate ->+ Irate ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> (Krate, Irate)+flKnob i0init s1label i2min i3max i4exp i5type i6disp i7width i8x+ i9y = mo2 $ opcode "FLknob" args+ where args+ = [to s1label, to i2min, to i3max, to i4exp, to i5type, to i6disp,+ to i7width, to i8x, to i9y]+ ++ map to i0init+++-- | * opcode : FLroller+-- +-- +-- * syntax : +-- +-- > kout, ihandle FLroller "label", imin, imax, istep, iexp, itype, idisp, +-- > iwidth, iheight, ix, iy+-- +-- +-- * description : +-- +-- FLroller is a sort of knob, but put transversally.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLroller.html>+ +flRoller ::+ String ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> (Krate, Irate)+flRoller s0label i1min i2max i3step i4exp i5type i6disp i7width+ i8height i9x i10y = mo2 $ opcode "FLroller" args+ where args+ = [to s0label, to i1min, to i2max, to i3step, to i4exp, to i5type,+ to i6disp, to i7width, to i8height, to i9x, to i10y]+++-- | * opcode : FLslider+-- +-- +-- * syntax : +-- +-- > kout, ihandle FLslider "label", imin, imax, iexp, itype, idisp, iwidth, +-- > iheight, ix, iy+-- +-- +-- * description : +-- +-- FLslider puts a slider into the corresponding container.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLslider.html>+ +flSlider ::+ String ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> (Krate, Irate)+flSlider s0label i1min i2max i3exp i4type i5disp i6width i7height+ i8x i9y = mo2 $ opcode "FLslider" args+ where args+ = [to s0label, to i1min, to i2max, to i3exp, to i4type, to i5disp,+ to i6width, to i7height, to i8x, to i9y]+++-- | * opcode : FLtext+-- +-- +-- * syntax : +-- +-- > kout, ihandle FLtext "label", imin, imax, istep, itype, iwidth, +-- > iheight, ix, iy+-- +-- +-- * description : +-- +-- FLtext allows the user to modify a parameter value by directly+-- typing it into a text field.+-- +-- +-- * url : <http://www.csounds.com/manual/html/FLtext.html>+ +flText ::+ String ->+ Irate ->+ Irate ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> (Krate, Irate)+flText s0label i1min i2max i3step i4type i5width i6height i7x i8y+ = mo2 $ opcode "FLtext" args+ where args+ = [to s0label, to i1min, to i2max, to i3step, to i4type,+ to i5width, to i6height, to i7x, to i8y]
+ src/CsoundExpr/Opcodes/Control/Invocat.hs view
@@ -0,0 +1,58 @@+-- | Instrument Invocation+module CsoundExpr.Opcodes.Control.Invocat+ (scoreline_i,+ scoreline)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : scoreline_i+-- +-- +-- * syntax : +-- +-- > scoreline_i Sin+-- +-- +-- * description : +-- +-- scoreline_i will issue score events at i-time. It can handle+-- strings in the same conditions as the standard score. Multi-line+-- strings are accepted, using {{ }} to enclose the string.+-- +-- +-- * url : <http://www.csounds.com/manual/html/scoreline_i.html>+ +scoreline_i :: String -> SignalOut+scoreline_i s0in = outOpcode "scoreline_i" args+ where args = [to s0in]+++-- | * opcode : scoreline+-- +-- +-- * syntax : +-- +-- > scoreline Sin, ktrig+-- +-- +-- * description : +-- +-- Scoreline will issue one or more score events, if ktrig is 1+-- every k-period. It can handle strings in the same conditions as+-- the standard score. Multi-line strings are accepted, using {{ }}+-- to enclose the string.+-- +-- +-- * url : <http://www.csounds.com/manual/html/scoreline.html>+ +scoreline :: (K k0) => String -> k0 -> SignalOut+scoreline s0in k1trig = outOpcode "scoreline" args+ where args = [to s0in, to k1trig]
+ src/CsoundExpr/Opcodes/Control/Pgmctl.hs view
@@ -0,0 +1,54 @@+-- | Program Flow Control+module CsoundExpr.Opcodes.Control.Pgmctl+ (else',+ endif)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : else+-- +-- +-- * syntax : +-- +-- > else+-- +-- +-- * description : +-- +-- Executes a block of code when an "if...then" condition is false.+-- +-- +-- * url : <http://www.csounds.com/manual/html/else.html>+ +else' :: SignalOut+else' = outOpcode "else" args+ where args = []+++-- | * opcode : endif+-- +-- +-- * syntax : +-- +-- > endif+-- +-- +-- * description : +-- +-- Closes a block of code that begins with an "if...then"+-- statement.+-- +-- +-- * url : <http://www.csounds.com/manual/html/endif.html>+ +endif :: SignalOut+endif = outOpcode "endif" args+ where args = []
+ src/CsoundExpr/Opcodes/Control/Realtime.hs view
@@ -0,0 +1,164 @@+-- | Real-time Performance Control+module CsoundExpr.Opcodes.Control.Realtime+ (activeI,+ activeK,+ cpuprc,+ maxalloc,+ preallocI,+ preallocS,+ jacktransport)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : active+-- +-- +-- * syntax : +-- +-- > ir active insnum+-- > kres active kinsnum+-- +-- +-- * description : +-- +-- Returns the number of active instances of an instrument.+-- +-- +-- * url : <http://www.csounds.com/manual/html/active.html>+ +activeI :: Irate -> Irate+activeI i0nsnum = opcode "active" args+ where args = [to i0nsnum]+++-- | * opcode : active+-- +-- +-- * syntax : +-- +-- > ir active insnum+-- > kres active kinsnum+-- +-- +-- * description : +-- +-- Returns the number of active instances of an instrument.+-- +-- +-- * url : <http://www.csounds.com/manual/html/active.html>+ +activeK :: (K k0) => k0 -> Krate+activeK k0insnum = opcode "active" args+ where args = [to k0insnum]+++-- | * opcode : cpuprc+-- +-- +-- * syntax : +-- +-- > cpuprc insnum, ipercent+-- +-- +-- * description : +-- +-- Control allocation of cpu resources on a per-instrument basis,+-- to optimize realtime output.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cpuprc.html>+ +cpuprc :: Irate -> Irate -> SignalOut+cpuprc i0nsnum i1percent = outOpcode "cpuprc" args+ where args = [to i0nsnum, to i1percent]+++-- | * opcode : maxalloc+-- +-- +-- * syntax : +-- +-- > maxalloc insnum, icount+-- +-- +-- * description : +-- +-- Limits the number of allocations of an instrument.+-- +-- +-- * url : <http://www.csounds.com/manual/html/maxalloc.html>+ +maxalloc :: Irate -> Irate -> SignalOut+maxalloc i0nsnum i1count = outOpcode "maxalloc" args+ where args = [to i0nsnum, to i1count]+++-- | * opcode : prealloc+-- +-- +-- * syntax : +-- +-- > prealloc insnum, icount+-- > prealloc "insname", icount+-- +-- +-- * description : +-- +-- Creates space for instruments but does not run them.+-- +-- +-- * url : <http://www.csounds.com/manual/html/prealloc.html>+ +preallocI :: Irate -> Irate -> SignalOut+preallocI i0nsnum i1count = outOpcode "prealloc" args+ where args = [to i0nsnum, to i1count]+++-- | * opcode : prealloc+-- +-- +-- * syntax : +-- +-- > prealloc insnum, icount+-- > prealloc "insname", icount+-- +-- +-- * description : +-- +-- Creates space for instruments but does not run them.+-- +-- +-- * url : <http://www.csounds.com/manual/html/prealloc.html>+ +preallocS :: String -> Irate -> SignalOut+preallocS s0insname i1count = outOpcode "prealloc" args+ where args = [to s0insname, to i1count]+++-- | * opcode : jacktransport+-- +-- +-- * syntax : +-- +-- > jacktransport icommand [, ilocation]+-- +-- +-- * description : +-- +-- Start/stop jack_transport and can optionally relocate the+-- playback head.+-- +-- +-- * url : <http://www.csounds.com/manual/html/jacktransport.html>+ +jacktransport :: [Irate] -> Irate -> SignalOut+jacktransport i0init i1command = outOpcode "jacktransport" args+ where args = [to i1command] ++ map to i0init
+ src/CsoundExpr/Opcodes/Control/Reinitn.hs view
@@ -0,0 +1,98 @@+-- | Initialization and Reinitialization+module CsoundExpr.Opcodes.Control.Reinitn+ (tival,+ passign,+ pset,+ rireturn)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : tival+-- +-- +-- * syntax : +-- +-- > ir tival+-- +-- +-- * description : +-- +-- Puts the value of the instrument's internal tie-in flag into the+-- named i-rate variable.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tival.html>+ +tival :: Irate+tival = opcode "tival" args+ where args = []+++-- | * opcode : passign+-- +-- +-- * syntax : +-- +-- > ivar1,... passign [istart]+-- +-- +-- * description : +-- +-- Assigns a range of p-fields to ivariables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/passign.html>+ +passign :: [Irate] -> Irate+passign i0init = opcode "passign" args+ where args = map to i0init+++-- | * opcode : pset+-- +-- +-- * syntax : +-- +-- > pset icon1 [, icon2] [...]+-- +-- +-- * description : +-- +-- Defines and initializes numeric arrays at orchestra load time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pset.html>+ +pset :: Irate -> SignalOut+pset i0vals = outOpcode "pset" args+ where args = [to i0vals]+++-- | * opcode : rireturn+-- +-- +-- * syntax : +-- +-- > rireturn+-- +-- +-- * description : +-- +-- Terminates a reinit pass (i.e., no-op at standard i-time). This+-- statement, or an endin, will cause normal performance to be+-- resumed.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rireturn.html>+ +rireturn :: SignalOut+rireturn = outOpcode "rireturn" args+ where args = []
+ src/CsoundExpr/Opcodes/Control/Sensing.hs view
@@ -0,0 +1,604 @@+-- | Sensing and Control+module CsoundExpr.Opcodes.Control.Sensing+ (button,+ checkbox,+ control,+ setctrl,+ sensekey,+ xyin,+ follow,+ follow2,+ peakA,+ peakK,+ rms,+ ptrack,+ pitch,+ pitchamdf,+ tempest,+ tempo,+ miditempo,+ tempoval,+ seqtime,+ seqtime2,+ trigger,+ timedseq,+ changed,+ getcfg,+ rewindscore)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : button+-- +-- +-- * syntax : +-- +-- > kres button knum+-- +-- +-- * description : +-- +-- Sense on-screen controls. Requires Winsound or TCL/TK.+-- +-- +-- * url : <http://www.csounds.com/manual/html/button.html>+ +button :: (K k0) => k0 -> Krate+button k0num = opcode "button" args+ where args = [to k0num]+++-- | * opcode : checkbox+-- +-- +-- * syntax : +-- +-- > kres checkbox knum+-- +-- +-- * description : +-- +-- Sense on-screen controls. Requires Winsound or TCL/TK.+-- +-- +-- * url : <http://www.csounds.com/manual/html/checkbox.html>+ +checkbox :: (K k0) => k0 -> Krate+checkbox k0num = opcode "checkbox" args+ where args = [to k0num]+++-- | * opcode : control+-- +-- +-- * syntax : +-- +-- > kres control knum+-- +-- +-- * description : +-- +-- Configurable slider controls for realtime user input. Requires+-- Winsound or TCL/TK. control reads a slider's value.+-- +-- +-- * url : <http://www.csounds.com/manual/html/control.html>+ +control :: (K k0) => k0 -> Krate+control k0num = opcode "control" args+ where args = [to k0num]+++-- | * opcode : setctrl+-- +-- +-- * syntax : +-- +-- > setctrl inum, ival, itype+-- +-- +-- * description : +-- +-- Configurable slider controls for realtime user input. Requires+-- Winsound or TCL/TK. setctrl sets a slider to a specific value, or+-- sets a minimum or maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/setctrl.html>+ +setctrl :: Irate -> Irate -> Irate -> SignalOut+setctrl i0num i1val i2type = outOpcode "setctrl" args+ where args = [to i0num, to i1val, to i2type]+++-- | * opcode : sensekey+-- +-- +-- * syntax : +-- +-- > kres[, kkeydown] sensekey+-- +-- +-- * description : +-- +-- Returns the ASCII code of a key that has been pressed, or -1 if+-- no key has been pressed.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sensekey.html>+ +sensekey :: MultiOut+sensekey = opcode "sensekey" args+ where args = []+++-- | * opcode : xyin+-- +-- +-- * syntax : +-- +-- > kx, ky xyin iprd, ixmin, ixmax, iymin, iymax [, ixinit] [, iyinit]+-- +-- +-- * description : +-- +-- Sense the cursor position in an output window. When xyin is+-- called the position of the mouse within the output window is used+-- to reply to the request. This simple mechanism does mean that+-- only one xyin can be used accurately at once. The position of the+-- mouse is reported in the output window.+-- +-- +-- * url : <http://www.csounds.com/manual/html/xyin.html>+ +xyin ::+ [Irate] -> Irate -> Irate -> Irate -> Irate -> Irate -> MultiOut+xyin i0init i1prd i2xmin i3xmax i4ymin i5ymax = opcode "xyin" args+ where args+ = [to i1prd, to i2xmin, to i3xmax, to i4ymin, to i5ymax] +++ map to i0init+++-- | * opcode : follow+-- +-- +-- * syntax : +-- +-- > ares follow asig, idt+-- +-- +-- * description : +-- +-- Envelope follower unit generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/follow.html>+ +follow :: Arate -> Irate -> Arate+follow a0sig i1dt = opcode "follow" args+ where args = [to a0sig, to i1dt]+++-- | * opcode : follow2+-- +-- +-- * syntax : +-- +-- > ares follow2 asig, katt, krel+-- +-- +-- * description : +-- +-- A controllable envelope extractor using the algorithm attributed+-- to Jean-Marc Jot.+-- +-- +-- * url : <http://www.csounds.com/manual/html/follow2.html>+ +follow2 :: (K k0, K k1) => Arate -> k0 -> k1 -> Arate+follow2 a0sig k1att k2rel = opcode "follow2" args+ where args = [to a0sig, to k1att, to k2rel]+++-- | * opcode : peak+-- +-- +-- * syntax : +-- +-- > kres peak asig+-- > kres peak ksig+-- +-- +-- * description : +-- +-- These opcodes maintain the output k-rate variable as the peak+-- absolute level so far received.+-- +-- +-- * url : <http://www.csounds.com/manual/html/peak.html>+ +peakA :: Arate -> Krate+peakA a0sig = opcode "peak" args+ where args = [to a0sig]+++-- | * opcode : peak+-- +-- +-- * syntax : +-- +-- > kres peak asig+-- > kres peak ksig+-- +-- +-- * description : +-- +-- These opcodes maintain the output k-rate variable as the peak+-- absolute level so far received.+-- +-- +-- * url : <http://www.csounds.com/manual/html/peak.html>+ +peakK :: (K k0) => k0 -> Krate+peakK k0sig = opcode "peak" args+ where args = [to k0sig]+++-- | * opcode : rms+-- +-- +-- * syntax : +-- +-- > kres rms asig [, ihp] [, iskip]+-- +-- +-- * description : +-- +-- Determines the root-mean-square amplitude of an audio signal. It+-- low-pass filters the actual value, to average in the manner of a+-- VU meter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rms.html>+ +rms :: [Irate] -> Arate -> Krate+rms i0init a1sig = opcode "rms" args+ where args = [to a1sig] ++ map to i0init+++-- | * opcode : ptrack+-- +-- +-- * syntax : +-- +-- > kcps, kamp ptrack asig, ihopsize[,ipeaks]+-- +-- +-- * description : +-- +-- ptrack takes an input signal, splits it into ihopsize blocks and+-- using a STFT method, extracts an estimated pitch for its+-- fundamental frequency as well as estimating the total amplitude+-- of the signal in dB, relative to full-scale (0dB). The method+-- implies an analysis window size of 2*ihopsize samples (overlaping+-- by 1/2 window), which has to be a power-of-two, between 128 and+-- 8192 (hopsizes between 64 and 4096). Smaller windows will give+-- better time precision, but worse frequency accuracy (esp. in low+-- fundamentals).This opcode is based on an original algorithm by M.+-- Puckette.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ptrack.html>+ +ptrack :: [Irate] -> Arate -> Irate -> MultiOut+ptrack i0init a1sig i2hopsize = opcode "ptrack" args+ where args = [to a1sig, to i2hopsize] ++ map to i0init+++-- | * opcode : pitch+-- +-- +-- * syntax : +-- +-- > koct, kamp pitch asig, iupdte, ilo, ihi, idbthresh [, ifrqs] [, iconf] +-- > [, istrt] [, iocts] [, iq] [, inptls] [, irolloff] [, iskip]+-- +-- +-- * description : +-- +-- Using the same techniques as spectrum and specptrk, pitch tracks+-- the pitch of the signal in octave point decimal form, and+-- amplitude in dB.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pitch.html>+ +pitch ::+ [Irate] -> Arate -> Irate -> Irate -> Irate -> Irate -> MultiOut+pitch i0init a1sig i2updte i3lo i4hi i5dbthresh+ = opcode "pitch" args+ where args+ = [to a1sig, to i2updte, to i3lo, to i4hi, to i5dbthresh] +++ map to i0init+++-- | * opcode : pitchamdf+-- +-- +-- * syntax : +-- +-- > kcps, krms pitchamdf asig, imincps, imaxcps [, icps] [, imedi] +-- > [, idowns] [, iexcps] [, irmsmedi]+-- +-- +-- * description : +-- +-- Follows the pitch of a signal based on the AMDF method (Average+-- Magnitude Difference Function). Outputs pitch and amplitude+-- tracking signals. The method is quite fast and should run in+-- realtime. This technique usually works best for monophonic+-- signals.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pitchamdf.html>+ +pitchamdf :: [Irate] -> Arate -> Irate -> Irate -> MultiOut+pitchamdf i0init a1sig i2mincps i3maxcps = opcode "pitchamdf" args+ where args = [to a1sig, to i2mincps, to i3maxcps] ++ map to i0init+++-- | * opcode : tempest+-- +-- +-- * syntax : +-- +-- > ktemp tempest kin, iprd, imindur, imemdur, ihp, ithresh, ihtim, ixfdbak, +-- > istartempo, ifn [, idisprd] [, itweek]+-- +-- +-- * description : +-- +-- Estimate the tempo of beat patterns in a control signal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tempest.html>+ +tempest ::+ (K k0) =>+ [Irate] ->+ k0 ->+ Irate ->+ Irate ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> Krate+tempest i0init k1in i2prd i3mindur i4memdur i5hp i6thresh i7htim+ i8xfdbak i9startempo i10fn = opcode "tempest" args+ where args+ = [to k1in, to i2prd, to i3mindur, to i4memdur, to i5hp,+ to i6thresh, to i7htim, to i8xfdbak, to i9startempo, to i10fn]+ ++ map to i0init+++-- | * opcode : tempo+-- +-- +-- * syntax : +-- +-- > tempo ktempo, istartempo+-- +-- +-- * description : +-- +-- Apply tempo control to an uninterpreted score.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tempo.html>+ +tempo :: (K k0) => k0 -> Irate -> SignalOut+tempo k0tempo i1startempo = outOpcode "tempo" args+ where args = [to k0tempo, to i1startempo]+++-- | * opcode : miditempo+-- +-- +-- * syntax : +-- +-- > ksig miditempo+-- +-- +-- * description : +-- +-- Returns the current tempo at k-rate, of either the MIDI file (if+-- available) or the score+-- +-- +-- * url : <http://www.csounds.com/manual/html/miditempo.html>+ +miditempo :: Krate+miditempo = opcode "miditempo" args+ where args = []+++-- | * opcode : tempoval+-- +-- +-- * syntax : +-- +-- > kres tempoval+-- +-- +-- * description : +-- +-- Reads the current value of the tempo.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tempoval.html>+ +tempoval :: Krate+tempoval = opcode "tempoval" args+ where args = []+++-- | * opcode : seqtime+-- +-- +-- * syntax : +-- +-- > ktrig_out seqtime ktime_unit, kstart, kloop, kinitndx, kfn_times+-- +-- +-- * description : +-- +-- Generates a trigger signal according to the values stored in a+-- table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/seqtime.html>+ +seqtime ::+ (K k0, K k1, K k2, K k3, K k4) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> Krate+seqtime k0time_unit k1start k2loop k3initndx k4fn_times+ = opcode "seqtime" args+ where args+ = [to k0time_unit, to k1start, to k2loop, to k3initndx,+ to k4fn_times]+++-- | * opcode : seqtime2+-- +-- +-- * syntax : +-- +-- > ktrig_out seqtime2 ktrig_in, ktime_unit, kstart, kloop, kinitndx, kfn_times+-- +-- +-- * description : +-- +-- Generates a trigger signal according to the values stored in a+-- table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/seqtime2.html>+ +seqtime2 ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> Krate+seqtime2 k0trig_in k1time_unit k2start k3loop k4initndx k5fn_times+ = opcode "seqtime2" args+ where args+ = [to k0trig_in, to k1time_unit, to k2start, to k3loop,+ to k4initndx, to k5fn_times]+++-- | * opcode : trigger+-- +-- +-- * syntax : +-- +-- > kout trigger ksig, kthreshold, kmode+-- +-- +-- * description : +-- +-- Informs when a krate signal crosses a threshold.+-- +-- +-- * url : <http://www.csounds.com/manual/html/trigger.html>+ +trigger :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+trigger k0sig k1threshold k2mode = opcode "trigger" args+ where args = [to k0sig, to k1threshold, to k2mode]+++-- | * opcode : timedseq+-- +-- +-- * syntax : +-- +-- > ktrig timedseq ktimpnt, ifn, kp1 [,kp2, kp3,...,kpN]+-- +-- +-- * description : +-- +-- An event-sequencer in which time can be controlled by a+-- time-pointer. Sequence data are stored into a table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/timedseq.html>+ +timedseq :: (K k0, K k1) => k0 -> Irate -> [k1] -> Krate+timedseq k0timpnt i1fn k2pN = opcode "timedseq" args+ where args = [to k0timpnt, to i1fn] ++ map to k2pN+++-- | * opcode : changed+-- +-- +-- * syntax : +-- +-- > ktrig changed kvar1 [, kvar2,..., kvarN]+-- +-- +-- * description : +-- +-- This opcode outputs a trigger signal that informs when any one+-- of its k-rate arguments has changed. Useful with valuator widgets+-- or MIDI controllers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/changed.html>+ +changed :: (K k0) => [k0] -> Krate+changed k0varN = opcode "changed" args+ where args = map to k0varN+++-- | * opcode : getcfg+-- +-- +-- * syntax : +-- +-- > Svalue getcfg iopt+-- +-- +-- * description : +-- +-- Return various configuration settings in Svalue as a string at+-- init time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/getcfg.html>+ +getcfg :: Irate -> String+getcfg i0opt = opcode "getcfg" args+ where args = [to i0opt]+++-- | * opcode : rewindscore+-- +-- +-- * syntax : +-- +-- > rewindscore+-- +-- +-- * description : +-- +-- Rewinds the playback position of the current score performance..+-- +-- +-- * url : <http://www.csounds.com/manual/html/rewindscore.html>+ +rewindscore :: SignalOut+rewindscore = outOpcode "rewindscore" args+ where args = []
+ src/CsoundExpr/Opcodes/Control/Stacks.hs view
@@ -0,0 +1,76 @@+-- | Stacks+module CsoundExpr.Opcodes.Control.Stacks+ (stack,+ pop,+ push)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : stack+-- +-- +-- * syntax : +-- +-- > stack iStackSize+-- +-- +-- * description : +-- +-- Initializes and sets the size of the global stack.+-- +-- +-- * url : <http://www.csounds.com/manual/html/stack.html>+ +stack :: Irate -> SignalOut+stack i0StackSize = outOpcode "stack" args+ where args = [to i0StackSize]+++-- | * opcode : pop+-- +-- +-- * syntax : +-- +-- > xval1, [xval2,..., xval31] pop+-- > ival1, [ival2,..., ival31] pop+-- +-- +-- * description : +-- +-- Pops values from the global stack.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pop.html>+ +pop :: MultiOut+pop = opcode "pop" args+ where args = []+++-- | * opcode : push+-- +-- +-- * syntax : +-- +-- > push xval1, [xval2,..., xval31]+-- > push ival1, [ival2,..., ival31]+-- +-- +-- * description : +-- +-- Pushes a value into the global stack.+-- +-- +-- * url : <http://www.csounds.com/manual/html/push.html>+ +push :: (X x0) => [x0] -> SignalOut+push x0valN = outOpcode "push" args+ where args = map to x0valN
+ src/CsoundExpr/Opcodes/Control/Subinstrument.hs view
@@ -0,0 +1,13 @@+-- | Sub-instrument Control+module CsoundExpr.Opcodes.Control.Subinstrument+ ()+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++
+ src/CsoundExpr/Opcodes/Control/Timeread.hs view
@@ -0,0 +1,256 @@+-- | Time Reading+module CsoundExpr.Opcodes.Control.Timeread+ (readclock,+ rtclockI,+ rtclockK,+ timeinstk,+ timeinsts,+ timesI,+ timesK,+ timekI,+ timekK,+ date,+ dates)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : readclock+-- +-- +-- * syntax : +-- +-- > ir readclock inum+-- +-- +-- * description : +-- +-- Reads the value of an internal clock.+-- +-- +-- * url : <http://www.csounds.com/manual/html/readclock.html>+ +readclock :: Irate -> Irate+readclock i0num = opcode "readclock" args+ where args = [to i0num]+++-- | * opcode : rtclock+-- +-- +-- * syntax : +-- +-- > ires rtclock+-- > kres rtclock+-- +-- +-- * description : +-- +-- Read the real-time clock from the operating system.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rtclock.html>+ +rtclockI :: Irate+rtclockI = opcode "rtclock" args+ where args = []+++-- | * opcode : rtclock+-- +-- +-- * syntax : +-- +-- > ires rtclock+-- > kres rtclock+-- +-- +-- * description : +-- +-- Read the real-time clock from the operating system.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rtclock.html>+ +rtclockK :: Krate+rtclockK = opcode "rtclock" args+ where args = []+++-- | * opcode : timeinstk+-- +-- +-- * syntax : +-- +-- > kres timeinstk+-- +-- +-- * description : +-- +-- Read absolute time, in k-rate cycles, since the start of an+-- instance of an instrument. Called at both i-time as well as+-- k-time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/timeinstk.html>+ +timeinstk :: Krate+timeinstk = opcode "timeinstk" args+ where args = []+++-- | * opcode : timeinsts+-- +-- +-- * syntax : +-- +-- > kres timeinsts+-- +-- +-- * description : +-- +-- Read absolute time, in seconds, since the start of an instance+-- of an instrument.+-- +-- +-- * url : <http://www.csounds.com/manual/html/timeinsts.html>+ +timeinsts :: Krate+timeinsts = opcode "timeinsts" args+ where args = []+++-- | * opcode : times+-- +-- +-- * syntax : +-- +-- > ires times+-- > kres times+-- +-- +-- * description : +-- +-- Read absolute time, in seconds, since the start of the+-- performance.+-- +-- +-- * url : <http://www.csounds.com/manual/html/times.html>+ +timesI :: Irate+timesI = opcode "times" args+ where args = []+++-- | * opcode : times+-- +-- +-- * syntax : +-- +-- > ires times+-- > kres times+-- +-- +-- * description : +-- +-- Read absolute time, in seconds, since the start of the+-- performance.+-- +-- +-- * url : <http://www.csounds.com/manual/html/times.html>+ +timesK :: Krate+timesK = opcode "times" args+ where args = []+++-- | * opcode : timek+-- +-- +-- * syntax : +-- +-- > ires timek+-- > kres timek+-- +-- +-- * description : +-- +-- Read absolute time, in k-rate cycles, since the start of the+-- performance.+-- +-- +-- * url : <http://www.csounds.com/manual/html/timek.html>+ +timekI :: Irate+timekI = opcode "timek" args+ where args = []+++-- | * opcode : timek+-- +-- +-- * syntax : +-- +-- > ires timek+-- > kres timek+-- +-- +-- * description : +-- +-- Read absolute time, in k-rate cycles, since the start of the+-- performance.+-- +-- +-- * url : <http://www.csounds.com/manual/html/timek.html>+ +timekK :: Krate+timekK = opcode "timek" args+ where args = []+++-- | * opcode : date+-- +-- +-- * syntax : +-- +-- > ir date+-- +-- +-- * description : +-- +-- Returns the number seconds since 1 January 1970, using the+-- operating system's clock.+-- +-- +-- * url : <http://www.csounds.com/manual/html/date.html>+ +date :: Irate+date = opcode "date" args+ where args = []+++-- | * opcode : dates+-- +-- +-- * syntax : +-- +-- > Sir dates [ itime]+-- +-- +-- * description : +-- +-- Returns as a string the date and time specified.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dates.html>+ +dates :: [Irate] -> String+dates i0init = opcode "dates" args+ where args = map to i0init
+ src/CsoundExpr/Opcodes/Imageopcodes.hs view
@@ -0,0 +1,8 @@+-- | Image processing opcodes+module CsoundExpr.Opcodes.Imageopcodes+ (module CsoundExpr.Opcodes.Imageopcodes.Top)+where++++import CsoundExpr.Opcodes.Imageopcodes.Top
+ src/CsoundExpr/Opcodes/Imageopcodes/Top.hs view
@@ -0,0 +1,125 @@+-- | Image processing opcodes+module CsoundExpr.Opcodes.Imageopcodes.Top+ (imagecreate,+ imagesize,+ imagegetpixelA,+ imagegetpixelK,+ imagefree)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : imagecreate+-- +-- +-- * syntax : +-- +-- > iimagenum imagecreate iwidth, iheight+-- +-- +-- * description : +-- +-- Create an empty image of a given size. Individual pixel values+-- can then be set with. imagegetpixel.+-- +-- +-- * url : <http://www.csounds.com/manual/html/imagecreate.html>+ +imagecreate :: Irate -> Irate -> Irate+imagecreate i0width i1height = opcode "imagecreate" args+ where args = [to i0width, to i1height]+++-- | * opcode : imagesize+-- +-- +-- * syntax : +-- +-- > iwidth iheight imagesize iimagenum+-- +-- +-- * description : +-- +-- Return the width and height of a previously opened or created+-- image. An image can be loaded with imageload. An empty image can+-- be created with imagecreate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/imagesize.html>+ +imagesize :: Irate -> MultiOut+imagesize i0imagenum = opcode "imagesize" args+ where args = [to i0imagenum]+++-- | * opcode : imagegetpixel+-- +-- +-- * syntax : +-- +-- > ared agreen ablue imagegetpixel iimagenum, ax, ay+-- > kred kgreen kblue imagegetpixel iimagenum, kx, ky+-- +-- +-- * description : +-- +-- Return the RGB pixel values of a previously opened or created+-- image. An image can be loaded with imageload. An empty image can+-- be created with imagecreate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/imagegetpixel.html>+ +imagegetpixelA :: Irate -> Arate -> Arate -> MultiOut+imagegetpixelA i0imagenum a1x a2y = opcode "imagegetpixel" args+ where args = [to i0imagenum, to a1x, to a2y]+++-- | * opcode : imagegetpixel+-- +-- +-- * syntax : +-- +-- > ared agreen ablue imagegetpixel iimagenum, ax, ay+-- > kred kgreen kblue imagegetpixel iimagenum, kx, ky+-- +-- +-- * description : +-- +-- Return the RGB pixel values of a previously opened or created+-- image. An image can be loaded with imageload. An empty image can+-- be created with imagecreate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/imagegetpixel.html>+ +imagegetpixelK :: (K k0, K k1) => Irate -> k0 -> k1 -> MultiOut+imagegetpixelK i0imagenum k1x k2y = opcode "imagegetpixel" args+ where args = [to i0imagenum, to k1x, to k2y]+++-- | * opcode : imagefree+-- +-- +-- * syntax : +-- +-- > imagefree iimagenum+-- +-- +-- * description : +-- +-- Frees memory allocated for a previously loaded or created image.+-- +-- +-- * url : <http://www.csounds.com/manual/html/imagefree.html>+ +imagefree :: Irate -> SignalOut+imagefree i0imagenum = outOpcode "imagefree" args+ where args = [to i0imagenum]
+ src/CsoundExpr/Opcodes/Math.hs view
@@ -0,0 +1,18 @@+-- | Mathematical Operations+module CsoundExpr.Opcodes.Math+ (module CsoundExpr.Opcodes.Math.Amp,+ module CsoundExpr.Opcodes.Math.SigmodCompaccum,+ module CsoundExpr.Opcodes.Math.Matfunc,+ module CsoundExpr.Opcodes.Math.Opeqfunc,+ module CsoundExpr.Opcodes.Math.Rndfunc,+ module CsoundExpr.Opcodes.Math.Trig)+where++++import CsoundExpr.Opcodes.Math.Amp+import CsoundExpr.Opcodes.Math.SigmodCompaccum+import CsoundExpr.Opcodes.Math.Matfunc+import CsoundExpr.Opcodes.Math.Opeqfunc+import CsoundExpr.Opcodes.Math.Rndfunc+import CsoundExpr.Opcodes.Math.Trig
+ src/CsoundExpr/Opcodes/Math/Amp.hs view
@@ -0,0 +1,122 @@+-- | Amplitude Converters+module CsoundExpr.Opcodes.Math.Amp+ (ampdb,+ ampdbfs,+ db,+ dbamp,+ dbfsamp)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : ampdb+-- +-- +-- * syntax : +-- +-- > ampdb(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the amplitude equivalent of the decibel value x. Thus:+-- +-- +-- * url : <http://www.csounds.com/manual/html/ampdb.html>+ +ampdb :: (X x0) => x0 -> x0+ampdb x0sig = prefixOperation "ampdb" args+ where args = [to x0sig]+++-- | * opcode : ampdbfs+-- +-- +-- * syntax : +-- +-- > ampdbfs(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the amplitude equivalent of the full scale decibel (dB+-- FS) value x. The logarithmic full scale decibel values will be+-- converted to linear 16-bit signed integer values from 32,768 to+-- +32,767.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ampdbfs.html>+ +ampdbfs :: (X x0) => x0 -> x0+ampdbfs x0sig = prefixOperation "ampdbfs" args+ where args = [to x0sig]+++-- | * opcode : db+-- +-- +-- * syntax : +-- +-- > db(x)+-- +-- +-- * description : +-- +-- Returns the amplitude equivalent for a given decibel amount.+-- This opcode is the same as ampdb.+-- +-- +-- * url : <http://www.csounds.com/manual/html/db.html>+ +db :: (X x0) => x0 -> x0+db x0sig = prefixOperation "db" args+ where args = [to x0sig]+++-- | * opcode : dbamp+-- +-- +-- * syntax : +-- +-- > dbamp(x) (init-rate or control-rate args only)+-- +-- +-- * description : +-- +-- Returns the decibel equivalent of the raw amplitude x.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dbamp.html>+ +dbamp :: (K k0) => k0 -> k0+dbamp k0sig = prefixOperation "dbamp" args+ where args = [to k0sig]+++-- | * opcode : dbfsamp+-- +-- +-- * syntax : +-- +-- > dbfsamp(x) (init-rate or control-rate args only)+-- +-- +-- * description : +-- +-- Returns the decibel equivalent of the raw amplitude x, relative+-- to full scale amplitude. Full scale is assumed to be 16 bit. New+-- is Csound version 4.10.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dbfsamp.html>+ +dbfsamp :: (K k0) => k0 -> k0+dbfsamp k0sig = prefixOperation "dbfsamp" args+ where args = [to k0sig]
+ src/CsoundExpr/Opcodes/Math/Matfunc.hs view
@@ -0,0 +1,336 @@+-- | Mathematical Functions+module CsoundExpr.Opcodes.Math.Matfunc+ (abs',+ ceil,+ exp',+ floor',+ frac,+ int,+ log',+ log10,+ logbtwo,+ powA,+ powI,+ powK,+ powoftwo,+ round',+ sqrt')+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : abs+-- +-- +-- * syntax : +-- +-- > abs(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the absolute value of x.+-- +-- +-- * url : <http://www.csounds.com/manual/html/abs.html>+ +abs' :: (X x0) => x0 -> x0+abs' x0sig = prefixOperation "abs" args+ where args = [to x0sig]+++-- | * opcode : ceil+-- +-- +-- * syntax : +-- +-- > ceil(x) (init-, control-, or audio-rate arg allowed)+-- +-- +-- * description : +-- +-- Returns the smallest integer not less than x+-- +-- +-- * url : <http://www.csounds.com/manual/html/ceil.html>+ +ceil :: (X x0) => x0 -> x0+ceil x0sig = prefixOperation "ceil" args+ where args = [to x0sig]+++-- | * opcode : exp+-- +-- +-- * syntax : +-- +-- > exp(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns e raised to the xth power.+-- +-- +-- * url : <http://www.csounds.com/manual/html/exp.html>+ +exp' :: (X x0) => x0 -> x0+exp' x0sig = prefixOperation "exp" args+ where args = [to x0sig]+++-- | * opcode : floor+-- +-- +-- * syntax : +-- +-- > floor(x) (init-, control-, or audio-rate arg allowed)+-- +-- +-- * description : +-- +-- Returns the largest integer not greater than x+-- +-- +-- * url : <http://www.csounds.com/manual/html/floor.html>+ +floor' :: (X x0) => x0 -> x0+floor' x0sig = prefixOperation "floor" args+ where args = [to x0sig]+++-- | * opcode : frac+-- +-- +-- * syntax : +-- +-- > frac(x) (init-rate or control-rate args; also works at audio rate in Csound5)+-- +-- +-- * description : +-- +-- Returns the fractional part of x.+-- +-- +-- * url : <http://www.csounds.com/manual/html/frac.html>+ +frac :: (K k0) => k0 -> k0+frac k0sig = prefixOperation "frac" args+ where args = [to k0sig]+++-- | * opcode : int+-- +-- +-- * syntax : +-- +-- > int(x) (init-rate or control-rate; also works at audio rate in Csound5)+-- +-- +-- * description : +-- +-- Returns the integer part of x.+-- +-- +-- * url : <http://www.csounds.com/manual/html/int.html>+ +int :: (K k0) => k0 -> k0+int k0sig = prefixOperation "int" args+ where args = [to k0sig]+++-- | * opcode : log+-- +-- +-- * syntax : +-- +-- > log(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the natural log of x (x positive only).+-- +-- +-- * url : <http://www.csounds.com/manual/html/log.html>+ +log' :: (X x0) => x0 -> x0+log' x0sig = prefixOperation "log" args+ where args = [to x0sig]+++-- | * opcode : log10+-- +-- +-- * syntax : +-- +-- > log10(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the base 10 log of x (x positive only).+-- +-- +-- * url : <http://www.csounds.com/manual/html/log10.html>+ +log10 :: (X x0) => x0 -> x0+log10 x0sig = prefixOperation "log10" args+ where args = [to x0sig]+++-- | * opcode : logbtwo+-- +-- +-- * syntax : +-- +-- > logbtwo(x) (init-rate or control-rate args only)+-- +-- +-- * description : +-- +-- Performs a logarithmic base two calculation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/logbtwo.html>+ +logbtwo :: (K k0) => k0 -> k0+logbtwo k0sig = prefixOperation "logbtwo" args+ where args = [to k0sig]+++-- | * opcode : pow+-- +-- +-- * syntax : +-- +-- > ares pow aarg, kpow [, inorm]+-- > ires pow iarg, ipow [, inorm]+-- > kres pow karg, kpow [, inorm]+-- +-- +-- * description : +-- +-- Computes xarg to the power of kpow (or ipow) and scales the+-- result by inorm.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pow.html>+ +powA :: (K k0) => [Irate] -> Arate -> k0 -> Arate+powA i0init a1arg k2pow = opcode "pow" args+ where args = [to a1arg, to k2pow] ++ map to i0init+++-- | * opcode : pow+-- +-- +-- * syntax : +-- +-- > ares pow aarg, kpow [, inorm]+-- > ires pow iarg, ipow [, inorm]+-- > kres pow karg, kpow [, inorm]+-- +-- +-- * description : +-- +-- Computes xarg to the power of kpow (or ipow) and scales the+-- result by inorm.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pow.html>+ +powI :: [Irate] -> Irate -> Irate -> Irate+powI i0init i1arg i2pow = opcode "pow" args+ where args = [to i1arg, to i2pow] ++ map to i0init+++-- | * opcode : pow+-- +-- +-- * syntax : +-- +-- > ares pow aarg, kpow [, inorm]+-- > ires pow iarg, ipow [, inorm]+-- > kres pow karg, kpow [, inorm]+-- +-- +-- * description : +-- +-- Computes xarg to the power of kpow (or ipow) and scales the+-- result by inorm.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pow.html>+ +powK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Krate+powK i0init k1arg k2pow = opcode "pow" args+ where args = [to k1arg, to k2pow] ++ map to i0init+++-- | * opcode : powoftwo+-- +-- +-- * syntax : +-- +-- > powoftwo(x) (init-rate or control-rate args only)+-- +-- +-- * description : +-- +-- Performs a power-of-two calculation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/powoftwo.html>+ +powoftwo :: (K k0) => k0 -> k0+powoftwo k0sig = prefixOperation "powoftwo" args+ where args = [to k0sig]+++-- | * opcode : round+-- +-- +-- * syntax : +-- +-- > round(x) (init-, control-, or audio-rate arg allowed)+-- +-- +-- * description : +-- +-- The integer value nearest to x ; if the fractional part of x is+-- exactly 0.5, the direction of rounding is undefined.+-- +-- +-- * url : <http://www.csounds.com/manual/html/round.html>+ +round' :: (X x0) => x0 -> x0+round' x0sig = prefixOperation "round" args+ where args = [to x0sig]+++-- | * opcode : sqrt+-- +-- +-- * syntax : +-- +-- > sqrt(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the square root of x (x non-negative).+-- +-- +-- * url : <http://www.csounds.com/manual/html/sqrt.html>+ +sqrt' :: (X x0) => x0 -> x0+sqrt' x0sig = prefixOperation "sqrt" args+ where args = [to x0sig]
+ src/CsoundExpr/Opcodes/Math/Opeqfunc.hs view
@@ -0,0 +1,191 @@+-- | Opcode Equivalents of Functions+module CsoundExpr.Opcodes.Math.Opeqfunc+ (divzA,+ divzI,+ divzK,+ product',+ sum',+ taninv2A,+ taninv2I,+ taninv2K)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : divz+-- +-- +-- * syntax : +-- +-- > ares divz xa, xb, ksubst+-- > ires divz ia, ib, isubst+-- > kres divz ka, kb, ksubst+-- +-- +-- * description : +-- +-- Safely divides two numbers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/divz.html>+ +divzA :: (X x0, X x1, K k0) => x0 -> x1 -> k0 -> Arate+divzA x0a x1b k2subst = opcode "divz" args+ where args = [to x0a, to x1b, to k2subst]+++-- | * opcode : divz+-- +-- +-- * syntax : +-- +-- > ares divz xa, xb, ksubst+-- > ires divz ia, ib, isubst+-- > kres divz ka, kb, ksubst+-- +-- +-- * description : +-- +-- Safely divides two numbers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/divz.html>+ +divzI :: Irate -> Irate -> Irate -> Irate+divzI i0a i1b i2subst = opcode "divz" args+ where args = [to i0a, to i1b, to i2subst]+++-- | * opcode : divz+-- +-- +-- * syntax : +-- +-- > ares divz xa, xb, ksubst+-- > ires divz ia, ib, isubst+-- > kres divz ka, kb, ksubst+-- +-- +-- * description : +-- +-- Safely divides two numbers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/divz.html>+ +divzK :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+divzK k0a k1b k2subst = opcode "divz" args+ where args = [to k0a, to k1b, to k2subst]+++-- | * opcode : product+-- +-- +-- * syntax : +-- +-- > ares product asig1, asig2 [, asig3] [...]+-- +-- +-- * description : +-- +-- Multiplies any number of a-rate signals.+-- +-- +-- * url : <http://www.csounds.com/manual/html/product.html>+ +product' :: [Arate] -> Arate+product' a0sig = opcode "product" args+ where args = map to a0sig+++-- | * opcode : sum+-- +-- +-- * syntax : +-- +-- > ares sum asig1 [, asig2] [, asig3] [...]+-- +-- +-- * description : +-- +-- Sums any number of a-rate signals.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sum.html>+ +sum' :: [Arate] -> Arate+sum' a0sig = opcode "sum" args+ where args = map to a0sig+++-- | * opcode : taninv2+-- +-- +-- * syntax : +-- +-- > ares taninv2 ay, ax+-- > ires taninv2 iy, ix+-- > kres taninv2 ky, kx+-- +-- +-- * description : +-- +-- Returns the arctangent of iy/ix, ky/kx, or ay/ax.+-- +-- +-- * url : <http://www.csounds.com/manual/html/taninv2.html>+ +taninv2A :: Arate -> Arate -> Arate+taninv2A a0y a1x = opcode "taninv2" args+ where args = [to a0y, to a1x]+++-- | * opcode : taninv2+-- +-- +-- * syntax : +-- +-- > ares taninv2 ay, ax+-- > ires taninv2 iy, ix+-- > kres taninv2 ky, kx+-- +-- +-- * description : +-- +-- Returns the arctangent of iy/ix, ky/kx, or ay/ax.+-- +-- +-- * url : <http://www.csounds.com/manual/html/taninv2.html>+ +taninv2I :: Irate -> Irate -> Irate+taninv2I i0y i1x = opcode "taninv2" args+ where args = [to i0y, to i1x]+++-- | * opcode : taninv2+-- +-- +-- * syntax : +-- +-- > ares taninv2 ay, ax+-- > ires taninv2 iy, ix+-- > kres taninv2 ky, kx+-- +-- +-- * description : +-- +-- Returns the arctangent of iy/ix, ky/kx, or ay/ax.+-- +-- +-- * url : <http://www.csounds.com/manual/html/taninv2.html>+ +taninv2K :: (K k0, K k1) => k0 -> k1 -> Krate+taninv2K k0y k1x = opcode "taninv2" args+ where args = [to k0y, to k1x]
+ src/CsoundExpr/Opcodes/Math/Rndfunc.hs view
@@ -0,0 +1,54 @@+-- | Random Functions+module CsoundExpr.Opcodes.Math.Rndfunc+ (birnd,+ rnd)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : birnd+-- +-- +-- * syntax : +-- +-- > birnd(x) (init- or control-rate only)+-- +-- +-- * description : +-- +-- Returns a random number in a bi-polar range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/birnd.html>+ +birnd :: (K k0) => k0 -> k0+birnd k0sig = prefixOperation "birnd" args+ where args = [to k0sig]+++-- | * opcode : rnd+-- +-- +-- * syntax : +-- +-- > rnd(x) (init- or control-rate only)+-- +-- +-- * description : +-- +-- Returns a random number in a unipolar range at the rate given by+-- the input argument.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rnd.html>+ +rnd :: (K k0) => k0 -> k0+rnd k0sig = prefixOperation "rnd" args+ where args = [to k0sig]
+ src/CsoundExpr/Opcodes/Math/SigmodCompaccum.hs view
@@ -0,0 +1,350 @@+-- | Comparators and Accumulators+module CsoundExpr.Opcodes.Math.SigmodCompaccum+ (maxA,+ maxK,+ max_k,+ maxabsA,+ maxabsK,+ maxabsaccum,+ maxaccum,+ minA,+ minK,+ minabsA,+ minabsK,+ minabsaccum,+ minaccum)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : max+-- +-- +-- * syntax : +-- +-- > amax max ain1 [, ain2] [, ain3] [, ain4] [...]+-- > kmax max kin1 [, kin2] [, kin3] [, kin4] [...]+-- +-- +-- * description : +-- +-- The max opcode takes any number of a-rate or k-rate signals as+-- input (all of the same rate), and outputs a signal at the same+-- rate that is the maximum of all of the inputs. For a-rate+-- signals, the inputs are compared one sample at a time (i.e. max+-- does not scan an entire ksmps period of a signal for its local+-- maximum as the max_k opcode does).+-- +-- +-- * url : <http://www.csounds.com/manual/html/max.html>+ +maxA :: [Arate] -> Arate+maxA a0inN = opcode "max" args+ where args = map to a0inN+++-- | * opcode : max+-- +-- +-- * syntax : +-- +-- > amax max ain1 [, ain2] [, ain3] [, ain4] [...]+-- > kmax max kin1 [, kin2] [, kin3] [, kin4] [...]+-- +-- +-- * description : +-- +-- The max opcode takes any number of a-rate or k-rate signals as+-- input (all of the same rate), and outputs a signal at the same+-- rate that is the maximum of all of the inputs. For a-rate+-- signals, the inputs are compared one sample at a time (i.e. max+-- does not scan an entire ksmps period of a signal for its local+-- maximum as the max_k opcode does).+-- +-- +-- * url : <http://www.csounds.com/manual/html/max.html>+ +maxK :: (K k0) => [k0] -> Krate+maxK k0inN = opcode "max" args+ where args = map to k0inN+++-- | * opcode : max_k+-- +-- +-- * syntax : +-- +-- > knumkout max_k asig, ktrig, itype+-- +-- +-- * description : +-- +-- max_k outputs the local maximum (or minimum) value of the+-- incoming asig signal, checked in the time interval between ktrig+-- has become true twice.+-- +-- +-- * url : <http://www.csounds.com/manual/html/max_k.html>+ +max_k :: (K k0) => Arate -> k0 -> Irate -> Krate+max_k a0sig k1trig i2type = opcode "max_k" args+ where args = [to a0sig, to k1trig, to i2type]+++-- | * opcode : maxabs+-- +-- +-- * syntax : +-- +-- > amax maxabs ain1 [, ain2] [, ain3] [, ain4] [...]+-- > kmax maxabs kin1 [, kin2] [, kin3] [, kin4] [...]+-- +-- +-- * description : +-- +-- The maxabs opcode takes any number of a-rate or k-rate signals+-- as input (all of the same rate), and outputs a signal at the same+-- rate that is the maximum of all of the inputs. It is identical to+-- the max opcode except that it takes the absolute value of each+-- input before comparing them. Therefore, the output is always+-- non-negative. For a-rate signals, the inputs are compared one+-- sample at a time (i.e. maxabs does not scan an entire ksmps+-- period of a signal for its local maximum as the max_k opcode+-- does).+-- +-- +-- * url : <http://www.csounds.com/manual/html/maxabs.html>+ +maxabsA :: [Arate] -> Arate+maxabsA a0inN = opcode "maxabs" args+ where args = map to a0inN+++-- | * opcode : maxabs+-- +-- +-- * syntax : +-- +-- > amax maxabs ain1 [, ain2] [, ain3] [, ain4] [...]+-- > kmax maxabs kin1 [, kin2] [, kin3] [, kin4] [...]+-- +-- +-- * description : +-- +-- The maxabs opcode takes any number of a-rate or k-rate signals+-- as input (all of the same rate), and outputs a signal at the same+-- rate that is the maximum of all of the inputs. It is identical to+-- the max opcode except that it takes the absolute value of each+-- input before comparing them. Therefore, the output is always+-- non-negative. For a-rate signals, the inputs are compared one+-- sample at a time (i.e. maxabs does not scan an entire ksmps+-- period of a signal for its local maximum as the max_k opcode+-- does).+-- +-- +-- * url : <http://www.csounds.com/manual/html/maxabs.html>+ +maxabsK :: (K k0) => [k0] -> Krate+maxabsK k0inN = opcode "maxabs" args+ where args = map to k0inN+++-- | * opcode : maxabsaccum+-- +-- +-- * syntax : +-- +-- > maxabsaccum aAccumulator, aInput+-- +-- +-- * description : +-- +-- maxabsaccum compares two audio-rate variables and stores the+-- maximum of their absolute values into the first.+-- +-- +-- * url : <http://www.csounds.com/manual/html/maxabsaccum.html>+ +maxabsaccum :: Arate -> Arate -> SignalOut+maxabsaccum a0Accumulator a1Input = outOpcode "maxabsaccum" args+ where args = [to a0Accumulator, to a1Input]+++-- | * opcode : maxaccum+-- +-- +-- * syntax : +-- +-- > maxaccum aAccumulator, aInput+-- +-- +-- * description : +-- +-- maxaccum compares two audio-rate variables and stores the+-- maximum value between them into the first.+-- +-- +-- * url : <http://www.csounds.com/manual/html/maxaccum.html>+ +maxaccum :: Arate -> Arate -> SignalOut+maxaccum a0Accumulator a1Input = outOpcode "maxaccum" args+ where args = [to a0Accumulator, to a1Input]+++-- | * opcode : min+-- +-- +-- * syntax : +-- +-- > amin min ain1 [, ain2] [, ain3] [, ain4] [...]+-- > kmin min kin1 [, kin2] [, kin3] [, kin4] [...]+-- +-- +-- * description : +-- +-- The min opcode takes any number of a-rate or k-rate signals as+-- input (all of the same rate), and outputs a signal at the same+-- rate that is the minimum of all of the inputs. For a-rate+-- signals, the inputs are compared one sample at a time (i.e. min+-- does not scan an entire ksmps period of a signal for its local+-- minimum as the max_k opcode does).+-- +-- +-- * url : <http://www.csounds.com/manual/html/min.html>+ +minA :: [Arate] -> Arate+minA a0inN = opcode "min" args+ where args = map to a0inN+++-- | * opcode : min+-- +-- +-- * syntax : +-- +-- > amin min ain1 [, ain2] [, ain3] [, ain4] [...]+-- > kmin min kin1 [, kin2] [, kin3] [, kin4] [...]+-- +-- +-- * description : +-- +-- The min opcode takes any number of a-rate or k-rate signals as+-- input (all of the same rate), and outputs a signal at the same+-- rate that is the minimum of all of the inputs. For a-rate+-- signals, the inputs are compared one sample at a time (i.e. min+-- does not scan an entire ksmps period of a signal for its local+-- minimum as the max_k opcode does).+-- +-- +-- * url : <http://www.csounds.com/manual/html/min.html>+ +minK :: (K k0) => [k0] -> Krate+minK k0inN = opcode "min" args+ where args = map to k0inN+++-- | * opcode : minabs+-- +-- +-- * syntax : +-- +-- > amin minabs ain1 [, ain2] [, ain3] [, ain4] [...]+-- > kmin minabs kin1 [, kin2] [, kin3] [, kin4] [...]+-- +-- +-- * description : +-- +-- The minabs opcode takes any number of a-rate or k-rate signals+-- as input (all of the same rate), and outputs a signal at the same+-- rate that is the minimum of all of the inputs. It is identical to+-- the min opcode except that it takes the absolute value of each+-- input before comparing them. Therefore, the output is always+-- non-negative. For a-rate signals, the inputs are compared one+-- sample at a time (i.e. minabs does not scan an entire ksmps+-- period of a signal for its local minimum as the max_k opcode+-- does).+-- +-- +-- * url : <http://www.csounds.com/manual/html/minabs.html>+ +minabsA :: [Arate] -> Arate+minabsA a0inN = opcode "minabs" args+ where args = map to a0inN+++-- | * opcode : minabs+-- +-- +-- * syntax : +-- +-- > amin minabs ain1 [, ain2] [, ain3] [, ain4] [...]+-- > kmin minabs kin1 [, kin2] [, kin3] [, kin4] [...]+-- +-- +-- * description : +-- +-- The minabs opcode takes any number of a-rate or k-rate signals+-- as input (all of the same rate), and outputs a signal at the same+-- rate that is the minimum of all of the inputs. It is identical to+-- the min opcode except that it takes the absolute value of each+-- input before comparing them. Therefore, the output is always+-- non-negative. For a-rate signals, the inputs are compared one+-- sample at a time (i.e. minabs does not scan an entire ksmps+-- period of a signal for its local minimum as the max_k opcode+-- does).+-- +-- +-- * url : <http://www.csounds.com/manual/html/minabs.html>+ +minabsK :: (K k0) => [k0] -> Krate+minabsK k0inN = opcode "minabs" args+ where args = map to k0inN+++-- | * opcode : minabsaccum+-- +-- +-- * syntax : +-- +-- > minabsaccum aAccumulator, aInput+-- +-- +-- * description : +-- +-- minabsaccum compares two audio-rate variables and stores the+-- minimum of their absolute values into the first.+-- +-- +-- * url : <http://www.csounds.com/manual/html/minabsaccum.html>+ +minabsaccum :: Arate -> Arate -> SignalOut+minabsaccum a0Accumulator a1Input = outOpcode "minabsaccum" args+ where args = [to a0Accumulator, to a1Input]+++-- | * opcode : minaccum+-- +-- +-- * syntax : +-- +-- > minaccum aAccumulator, aInput+-- +-- +-- * description : +-- +-- minaccum compares two audio-rate variables and stores the+-- minimum value between them into the first.+-- +-- +-- * url : <http://www.csounds.com/manual/html/minaccum.html>+ +minaccum :: Arate -> Arate -> SignalOut+minaccum a0Accumulator a1Input = outOpcode "minaccum" args+ where args = [to a0Accumulator, to a1Input]
+ src/CsoundExpr/Opcodes/Math/Trig.hs view
@@ -0,0 +1,200 @@+-- | Trigonometric Functions+module CsoundExpr.Opcodes.Math.Trig+ (cos',+ cosh',+ cosinv,+ sin',+ sinh',+ sininv,+ tan',+ tanh',+ taninv)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : cos+-- +-- +-- * syntax : +-- +-- > cos(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the cosine of x (x in radians).+-- +-- +-- * url : <http://www.csounds.com/manual/html/cos.html>+ +cos' :: (X x0) => x0 -> x0+cos' x0sig = prefixOperation "cos" args+ where args = [to x0sig]+++-- | * opcode : cosh+-- +-- +-- * syntax : +-- +-- > cosh(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the hyperbolic cosine of x (x in radians).+-- +-- +-- * url : <http://www.csounds.com/manual/html/cosh.html>+ +cosh' :: (X x0) => x0 -> x0+cosh' x0sig = prefixOperation "cosh" args+ where args = [to x0sig]+++-- | * opcode : cosinv+-- +-- +-- * syntax : +-- +-- > cosinv(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the arccosine of x (x in radians).+-- +-- +-- * url : <http://www.csounds.com/manual/html/cosinv.html>+ +cosinv :: (X x0) => x0 -> x0+cosinv x0sig = prefixOperation "cosinv" args+ where args = [to x0sig]+++-- | * opcode : sin+-- +-- +-- * syntax : +-- +-- > sin(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the sine of x (x in radians).+-- +-- +-- * url : <http://www.csounds.com/manual/html/sin.html>+ +sin' :: (X x0) => x0 -> x0+sin' x0sig = prefixOperation "sin" args+ where args = [to x0sig]+++-- | * opcode : sinh+-- +-- +-- * syntax : +-- +-- > sinh(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the hyperbolic sine of x (x in radians).+-- +-- +-- * url : <http://www.csounds.com/manual/html/sinh.html>+ +sinh' :: (X x0) => x0 -> x0+sinh' x0sig = prefixOperation "sinh" args+ where args = [to x0sig]+++-- | * opcode : sininv+-- +-- +-- * syntax : +-- +-- > sininv(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the arcsine of x (x in radians).+-- +-- +-- * url : <http://www.csounds.com/manual/html/sininv.html>+ +sininv :: (X x0) => x0 -> x0+sininv x0sig = prefixOperation "sininv" args+ where args = [to x0sig]+++-- | * opcode : tan+-- +-- +-- * syntax : +-- +-- > tan(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the tangent of x (x in radians).+-- +-- +-- * url : <http://www.csounds.com/manual/html/tan.html>+ +tan' :: (X x0) => x0 -> x0+tan' x0sig = prefixOperation "tan" args+ where args = [to x0sig]+++-- | * opcode : tanh+-- +-- +-- * syntax : +-- +-- > tanh(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the hyperbolic tangent of x (x in radians).+-- +-- +-- * url : <http://www.csounds.com/manual/html/tanh.html>+ +tanh' :: (X x0) => x0 -> x0+tanh' x0sig = prefixOperation "tanh" args+ where args = [to x0sig]+++-- | * opcode : taninv+-- +-- +-- * syntax : +-- +-- > taninv(x) (no rate restriction)+-- +-- +-- * description : +-- +-- Returns the arctangent of x (x in radians).+-- +-- +-- * url : <http://www.csounds.com/manual/html/taninv.html>+ +taninv :: (X x0) => x0 -> x0+taninv x0sig = prefixOperation "taninv" args+ where args = [to x0sig]
+ src/CsoundExpr/Opcodes/Midi.hs view
@@ -0,0 +1,24 @@+-- | Real-time MIDI Support+module CsoundExpr.Opcodes.Midi+ (module CsoundExpr.Opcodes.Midi.Input,+ module CsoundExpr.Opcodes.Midi.Output,+ module CsoundExpr.Opcodes.Midi.Generic,+ module CsoundExpr.Opcodes.Midi.Convert,+ module CsoundExpr.Opcodes.Midi.Extender,+ module CsoundExpr.Opcodes.Midi.Onoff,+ module CsoundExpr.Opcodes.Midi.Interop,+ module CsoundExpr.Opcodes.Midi.Realtime,+ module CsoundExpr.Opcodes.Midi.Slidrbk)+where++++import CsoundExpr.Opcodes.Midi.Input+import CsoundExpr.Opcodes.Midi.Output+import CsoundExpr.Opcodes.Midi.Generic+import CsoundExpr.Opcodes.Midi.Convert+import CsoundExpr.Opcodes.Midi.Extender+import CsoundExpr.Opcodes.Midi.Onoff+import CsoundExpr.Opcodes.Midi.Interop+import CsoundExpr.Opcodes.Midi.Realtime+import CsoundExpr.Opcodes.Midi.Slidrbk
+ src/CsoundExpr/Opcodes/Midi/Convert.hs view
@@ -0,0 +1,258 @@+-- | Converters+module CsoundExpr.Opcodes.Midi.Convert+ (cpsmidi,+ cpsmidibI,+ cpsmidibK,+ cpstmid,+ octmidi,+ octmidibI,+ octmidibK,+ pchmidi,+ pchmidibI,+ pchmidibK,+ ampmidi)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : cpsmidi+-- +-- +-- * syntax : +-- +-- > icps cpsmidi+-- +-- +-- * description : +-- +-- Get the note number of the current MIDI event, expressed in+-- cycles-per-second.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cpsmidi.html>+ +cpsmidi :: Irate+cpsmidi = opcode "cpsmidi" args+ where args = []+++-- | * opcode : cpsmidib+-- +-- +-- * syntax : +-- +-- > icps cpsmidib [irange]+-- > kcps cpsmidib [irange]+-- +-- +-- * description : +-- +-- Get the note number of the current MIDI event and modify it by+-- the current pitch-bend value, express it in cycles-per-second.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cpsmidib.html>+ +cpsmidibI :: [Irate] -> Irate+cpsmidibI i0init = opcode "cpsmidib" args+ where args = map to i0init+++-- | * opcode : cpsmidib+-- +-- +-- * syntax : +-- +-- > icps cpsmidib [irange]+-- > kcps cpsmidib [irange]+-- +-- +-- * description : +-- +-- Get the note number of the current MIDI event and modify it by+-- the current pitch-bend value, express it in cycles-per-second.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cpsmidib.html>+ +cpsmidibK :: [Irate] -> Krate+cpsmidibK i0init = opcode "cpsmidib" args+ where args = map to i0init+++-- | * opcode : cpstmid+-- +-- +-- * syntax : +-- +-- > icps cpstmid ifn+-- +-- +-- * description : +-- +-- This unit is similar to cpsmidi, but allows fully customized+-- micro-tuning scales.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cpstmid.html>+ +cpstmid :: Irate -> Irate+cpstmid i0fn = opcode "cpstmid" args+ where args = [to i0fn]+++-- | * opcode : octmidi+-- +-- +-- * syntax : +-- +-- > ioct octmidi+-- +-- +-- * description : +-- +-- Get the note number, in octave-point-decimal units, of the+-- current MIDI event.+-- +-- +-- * url : <http://www.csounds.com/manual/html/octmidi.html>+ +octmidi :: Irate+octmidi = opcode "octmidi" args+ where args = []+++-- | * opcode : octmidib+-- +-- +-- * syntax : +-- +-- > ioct octmidib [irange]+-- > koct octmidib [irange]+-- +-- +-- * description : +-- +-- Get the note number of the current MIDI event and modify it by+-- the current pitch-bend value, express it in octave-point-decimal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/octmidib.html>+ +octmidibI :: [Irate] -> Irate+octmidibI i0init = opcode "octmidib" args+ where args = map to i0init+++-- | * opcode : octmidib+-- +-- +-- * syntax : +-- +-- > ioct octmidib [irange]+-- > koct octmidib [irange]+-- +-- +-- * description : +-- +-- Get the note number of the current MIDI event and modify it by+-- the current pitch-bend value, express it in octave-point-decimal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/octmidib.html>+ +octmidibK :: [Irate] -> Krate+octmidibK i0init = opcode "octmidib" args+ where args = map to i0init+++-- | * opcode : pchmidi+-- +-- +-- * syntax : +-- +-- > ipch pchmidi+-- +-- +-- * description : +-- +-- Get the note number of the current MIDI event, expressed in+-- pitch-class units.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pchmidi.html>+ +pchmidi :: Irate+pchmidi = opcode "pchmidi" args+ where args = []+++-- | * opcode : pchmidib+-- +-- +-- * syntax : +-- +-- > ipch pchmidib [irange]+-- > kpch pchmidib [irange]+-- +-- +-- * description : +-- +-- Get the note number of the current MIDI event and modify it by+-- the current pitch-bend value, express it in pitch-class units.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pchmidib.html>+ +pchmidibI :: [Irate] -> Irate+pchmidibI i0init = opcode "pchmidib" args+ where args = map to i0init+++-- | * opcode : pchmidib+-- +-- +-- * syntax : +-- +-- > ipch pchmidib [irange]+-- > kpch pchmidib [irange]+-- +-- +-- * description : +-- +-- Get the note number of the current MIDI event and modify it by+-- the current pitch-bend value, express it in pitch-class units.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pchmidib.html>+ +pchmidibK :: [Irate] -> Krate+pchmidibK i0init = opcode "pchmidib" args+ where args = map to i0init+++-- | * opcode : ampmidi+-- +-- +-- * syntax : +-- +-- > iamp ampmidi iscal [, ifn]+-- +-- +-- * description : +-- +-- Get the velocity of the current MIDI event.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ampmidi.html>+ +ampmidi :: [Irate] -> Irate -> Irate+ampmidi i0init i1scal = opcode "ampmidi" args+ where args = [to i1scal] ++ map to i0init
+ src/CsoundExpr/Opcodes/Midi/Extender.hs view
@@ -0,0 +1,58 @@+-- | Event Extenders+module CsoundExpr.Opcodes.Midi.Extender+ (release,+ xtratim)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : release+-- +-- +-- * syntax : +-- +-- > kflag release+-- +-- +-- * description : +-- +-- 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.+-- +-- +-- * url : <http://www.csounds.com/manual/html/release.html>+ +release :: Krate+release = opcode "release" args+ where args = []+++-- | * opcode : xtratim+-- +-- +-- * syntax : +-- +-- > xtratim iextradur+-- +-- +-- * description : +-- +-- Extend the duration of real-time generated events and handle+-- their extra life (Usually for usage along with release instead of+-- linenr, linsegr, etc).+-- +-- +-- * url : <http://www.csounds.com/manual/html/xtratim.html>+ +xtratim :: Irate -> SignalOut+xtratim i0extradur = outOpcode "xtratim" args+ where args = [to i0extradur]
+ src/CsoundExpr/Opcodes/Midi/Generic.hs view
@@ -0,0 +1,54 @@+-- | Generic Input and Output+module CsoundExpr.Opcodes.Midi.Generic+ (midiin,+ midiout)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : midiin+-- +-- +-- * syntax : +-- +-- > kstatus, kchan, kdata1, kdata2 midiin+-- +-- +-- * description : +-- +-- Returns a generic MIDI message received by the MIDI IN port+-- +-- +-- * url : <http://www.csounds.com/manual/html/midiin.html>+ +midiin :: MultiOut+midiin = opcode "midiin" args+ where args = []+++-- | * opcode : midiout+-- +-- +-- * syntax : +-- +-- > midiout kstatus, kchan, kdata1, kdata2+-- +-- +-- * description : +-- +-- Sends a generic MIDI message to the MIDI OUT port.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midiout.html>+ +midiout ::+ (K k0, K k1, K k2, K k3) => k0 -> k1 -> k2 -> k3 -> SignalOut+midiout k0status k1chan k2data1 k3data2 = outOpcode "midiout" args+ where args = [to k0status, to k1chan, to k2data1, to k3data2]
+ src/CsoundExpr/Opcodes/Midi/Input.hs view
@@ -0,0 +1,661 @@+-- | MIDI input+module CsoundExpr.Opcodes.Midi.Input+ (aftouch,+ chanctrlI,+ chanctrlK,+ polyaftI,+ polyaftK,+ pchbendI,+ pchbendK,+ veloc,+ midictrlI,+ midictrlK,+ notnum,+ ctrl7A,+ ctrl7I,+ ctrl7K,+ ctrl14I,+ ctrl14K,+ ctrl21I,+ ctrl21K,+ midic7I,+ midic7K,+ midic14I,+ midic14K,+ midic21I,+ midic21K,+ initc7,+ initc14,+ initc21)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : aftouch+-- +-- +-- * syntax : +-- +-- > kaft aftouch [imin] [, imax]+-- +-- +-- * description : +-- +-- Get the current after-touch value for this channel.+-- +-- +-- * url : <http://www.csounds.com/manual/html/aftouch.html>+ +aftouch :: [Irate] -> Krate+aftouch i0init = opcode "aftouch" args+ where args = map to i0init+++-- | * opcode : chanctrl+-- +-- +-- * syntax : +-- +-- > ival chanctrl ichnl, ictlno [, ilow] [, ihigh]+-- > kval chanctrl ichnl, ictlno [, ilow] [, ihigh]+-- +-- +-- * description : +-- +-- Get the current value of a controller and optionally map it onto+-- specified range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/chanctrl.html>+ +chanctrlI :: [Irate] -> Irate -> Irate -> Irate+chanctrlI i0init i1chnl i2ctlno = opcode "chanctrl" args+ where args = [to i1chnl, to i2ctlno] ++ map to i0init+++-- | * opcode : chanctrl+-- +-- +-- * syntax : +-- +-- > ival chanctrl ichnl, ictlno [, ilow] [, ihigh]+-- > kval chanctrl ichnl, ictlno [, ilow] [, ihigh]+-- +-- +-- * description : +-- +-- Get the current value of a controller and optionally map it onto+-- specified range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/chanctrl.html>+ +chanctrlK :: [Irate] -> Irate -> Irate -> Krate+chanctrlK i0init i1chnl i2ctlno = opcode "chanctrl" args+ where args = [to i1chnl, to i2ctlno] ++ map to i0init+++-- | * opcode : polyaft+-- +-- +-- * syntax : +-- +-- > ires polyaft inote [, ilow] [, ihigh]+-- > kres polyaft inote [, ilow] [, ihigh]+-- +-- +-- * description : +-- +-- polyaft returns the polyphonic pressure of the selected note+-- number, optionally mapped to an user-specified range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/polyaft.html>+ +polyaftI :: [Irate] -> Irate -> Irate+polyaftI i0init i1note = opcode "polyaft" args+ where args = [to i1note] ++ map to i0init+++-- | * opcode : polyaft+-- +-- +-- * syntax : +-- +-- > ires polyaft inote [, ilow] [, ihigh]+-- > kres polyaft inote [, ilow] [, ihigh]+-- +-- +-- * description : +-- +-- polyaft returns the polyphonic pressure of the selected note+-- number, optionally mapped to an user-specified range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/polyaft.html>+ +polyaftK :: [Irate] -> Irate -> Krate+polyaftK i0init i1note = opcode "polyaft" args+ where args = [to i1note] ++ map to i0init+++-- | * opcode : pchbend+-- +-- +-- * syntax : +-- +-- > ibend pchbend [imin] [, imax]+-- > kbend pchbend [imin] [, imax]+-- +-- +-- * description : +-- +-- Get the current pitch-bend value for this channel.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pchbend.html>+ +pchbendI :: [Irate] -> Irate+pchbendI i0init = opcode "pchbend" args+ where args = map to i0init+++-- | * opcode : pchbend+-- +-- +-- * syntax : +-- +-- > ibend pchbend [imin] [, imax]+-- > kbend pchbend [imin] [, imax]+-- +-- +-- * description : +-- +-- Get the current pitch-bend value for this channel.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pchbend.html>+ +pchbendK :: [Irate] -> Krate+pchbendK i0init = opcode "pchbend" args+ where args = map to i0init+++-- | * opcode : veloc+-- +-- +-- * syntax : +-- +-- > ival veloc [ilow] [, ihigh]+-- +-- +-- * description : +-- +-- Get the velocity from a MIDI event.+-- +-- +-- * url : <http://www.csounds.com/manual/html/veloc.html>+ +veloc :: [Irate] -> Irate+veloc i0init = opcode "veloc" args+ where args = map to i0init+++-- | * opcode : midictrl+-- +-- +-- * syntax : +-- +-- > ival midictrl inum [, imin] [, imax]+-- > kval midictrl inum [, imin] [, imax]+-- +-- +-- * description : +-- +-- Get the current value (0-127) of a specified MIDI controller.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midictrl.html>+ +midictrlI :: [Irate] -> Irate -> Irate+midictrlI i0init i1num = opcode "midictrl" args+ where args = [to i1num] ++ map to i0init+++-- | * opcode : midictrl+-- +-- +-- * syntax : +-- +-- > ival midictrl inum [, imin] [, imax]+-- > kval midictrl inum [, imin] [, imax]+-- +-- +-- * description : +-- +-- Get the current value (0-127) of a specified MIDI controller.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midictrl.html>+ +midictrlK :: [Irate] -> Irate -> Krate+midictrlK i0init i1num = opcode "midictrl" args+ where args = [to i1num] ++ map to i0init+++-- | * opcode : notnum+-- +-- +-- * syntax : +-- +-- > ival notnum+-- +-- +-- * description : +-- +-- Get a note number from a MIDI event.+-- +-- +-- * url : <http://www.csounds.com/manual/html/notnum.html>+ +notnum :: Irate+notnum = opcode "notnum" args+ where args = []+++-- | * opcode : ctrl7+-- +-- +-- * syntax : +-- +-- > idest ctrl7 ichan, ictlno, imin, imax [, ifn]+-- > kdest ctrl7 ichan, ictlno, kmin, kmax [, ifn]+-- > adest ctrl7 ichan, ictlno, kmin, kmax [, ifn] [, icutoff]+-- +-- +-- * description : +-- +-- Allows a floating-point 7-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ctrl7.html>+ +ctrl7A ::+ (K k0, K k1) => [Irate] -> Irate -> Irate -> k0 -> k1 -> Arate+ctrl7A i0init i1chan i2ctlno k3min k4max = opcode "ctrl7" args+ where args+ = [to i1chan, to i2ctlno, to k3min, to k4max] ++ map to i0init+++-- | * opcode : ctrl7+-- +-- +-- * syntax : +-- +-- > idest ctrl7 ichan, ictlno, imin, imax [, ifn]+-- > kdest ctrl7 ichan, ictlno, kmin, kmax [, ifn]+-- > adest ctrl7 ichan, ictlno, kmin, kmax [, ifn] [, icutoff]+-- +-- +-- * description : +-- +-- Allows a floating-point 7-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ctrl7.html>+ +ctrl7I :: [Irate] -> Irate -> Irate -> Irate -> Irate -> Irate+ctrl7I i0init i1chan i2ctlno i3min i4max = opcode "ctrl7" args+ where args+ = [to i1chan, to i2ctlno, to i3min, to i4max] ++ map to i0init+++-- | * opcode : ctrl7+-- +-- +-- * syntax : +-- +-- > idest ctrl7 ichan, ictlno, imin, imax [, ifn]+-- > kdest ctrl7 ichan, ictlno, kmin, kmax [, ifn]+-- > adest ctrl7 ichan, ictlno, kmin, kmax [, ifn] [, icutoff]+-- +-- +-- * description : +-- +-- Allows a floating-point 7-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ctrl7.html>+ +ctrl7K ::+ (K k0, K k1) => [Irate] -> Irate -> Irate -> k0 -> k1 -> Krate+ctrl7K i0init i1chan i2ctlno k3min k4max = opcode "ctrl7" args+ where args+ = [to i1chan, to i2ctlno, to k3min, to k4max] ++ map to i0init+++-- | * opcode : ctrl14+-- +-- +-- * syntax : +-- +-- > idest ctrl14 ichan, ictlno1, ictlno2, imin, imax [, ifn]+-- > kdest ctrl14 ichan, ictlno1, ictlno2, kmin, kmax [, ifn]+-- +-- +-- * description : +-- +-- Allows a floating-point 14-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ctrl14.html>+ +ctrl14I ::+ [Irate] -> Irate -> Irate -> Irate -> Irate -> Irate -> Irate+ctrl14I i0init i1chan i2ctlno1 i3ctlno2 i4min i5max+ = opcode "ctrl14" args+ where args+ = [to i1chan, to i2ctlno1, to i3ctlno2, to i4min, to i5max] +++ map to i0init+++-- | * opcode : ctrl14+-- +-- +-- * syntax : +-- +-- > idest ctrl14 ichan, ictlno1, ictlno2, imin, imax [, ifn]+-- > kdest ctrl14 ichan, ictlno1, ictlno2, kmin, kmax [, ifn]+-- +-- +-- * description : +-- +-- Allows a floating-point 14-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ctrl14.html>+ +ctrl14K ::+ (K k0, K k1) =>+ [Irate] -> Irate -> Irate -> Irate -> k0 -> k1 -> Krate+ctrl14K i0init i1chan i2ctlno1 i3ctlno2 k4min k5max+ = opcode "ctrl14" args+ where args+ = [to i1chan, to i2ctlno1, to i3ctlno2, to k4min, to k5max] +++ map to i0init+++-- | * opcode : ctrl21+-- +-- +-- * syntax : +-- +-- > idest ctrl21 ichan, ictlno1, ictlno2, ictlno3, imin, imax [, ifn]+-- > kdest ctrl21 ichan, ictlno1, ictlno2, ictlno3, kmin, kmax [, ifn]+-- +-- +-- * description : +-- +-- Allows a floating-point 21-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ctrl21.html>+ +ctrl21I ::+ [Irate] ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> Irate+ctrl21I i0init i1chan i2ctlno1 i3ctlno2 i4ctlno3 i5min i6max+ = opcode "ctrl21" args+ where args+ = [to i1chan, to i2ctlno1, to i3ctlno2, to i4ctlno3, to i5min,+ to i6max]+ ++ map to i0init+++-- | * opcode : ctrl21+-- +-- +-- * syntax : +-- +-- > idest ctrl21 ichan, ictlno1, ictlno2, ictlno3, imin, imax [, ifn]+-- > kdest ctrl21 ichan, ictlno1, ictlno2, ictlno3, kmin, kmax [, ifn]+-- +-- +-- * description : +-- +-- Allows a floating-point 21-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ctrl21.html>+ +ctrl21K ::+ (K k0, K k1) =>+ [Irate] -> Irate -> Irate -> Irate -> Irate -> k0 -> k1 -> Krate+ctrl21K i0init i1chan i2ctlno1 i3ctlno2 i4ctlno3 k5min k6max+ = opcode "ctrl21" args+ where args+ = [to i1chan, to i2ctlno1, to i3ctlno2, to i4ctlno3, to k5min,+ to k6max]+ ++ map to i0init+++-- | * opcode : midic7+-- +-- +-- * syntax : +-- +-- > idest midic7 ictlno, imin, imax [, ifn]+-- > kdest midic7 ictlno, kmin, kmax [, ifn]+-- +-- +-- * description : +-- +-- Allows a floating-point 7-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midic7.html>+ +midic7I :: [Irate] -> Irate -> Irate -> Irate -> Irate+midic7I i0init i1ctlno i2min i3max = opcode "midic7" args+ where args = [to i1ctlno, to i2min, to i3max] ++ map to i0init+++-- | * opcode : midic7+-- +-- +-- * syntax : +-- +-- > idest midic7 ictlno, imin, imax [, ifn]+-- > kdest midic7 ictlno, kmin, kmax [, ifn]+-- +-- +-- * description : +-- +-- Allows a floating-point 7-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midic7.html>+ +midic7K :: (K k0, K k1) => [Irate] -> Irate -> k0 -> k1 -> Krate+midic7K i0init i1ctlno k2min k3max = opcode "midic7" args+ where args = [to i1ctlno, to k2min, to k3max] ++ map to i0init+++-- | * opcode : midic14+-- +-- +-- * syntax : +-- +-- > idest midic14 ictlno1, ictlno2, imin, imax [, ifn]+-- > kdest midic14 ictlno1, ictlno2, kmin, kmax [, ifn]+-- +-- +-- * description : +-- +-- Allows a floating-point 14-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midic14.html>+ +midic14I :: [Irate] -> Irate -> Irate -> Irate -> Irate -> Irate+midic14I i0init i1ctlno1 i2ctlno2 i3min i4max+ = opcode "midic14" args+ where args+ = [to i1ctlno1, to i2ctlno2, to i3min, to i4max] ++ map to i0init+++-- | * opcode : midic14+-- +-- +-- * syntax : +-- +-- > idest midic14 ictlno1, ictlno2, imin, imax [, ifn]+-- > kdest midic14 ictlno1, ictlno2, kmin, kmax [, ifn]+-- +-- +-- * description : +-- +-- Allows a floating-point 14-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midic14.html>+ +midic14K ::+ (K k0, K k1) => [Irate] -> Irate -> Irate -> k0 -> k1 -> Krate+midic14K i0init i1ctlno1 i2ctlno2 k3min k4max+ = opcode "midic14" args+ where args+ = [to i1ctlno1, to i2ctlno2, to k3min, to k4max] ++ map to i0init+++-- | * opcode : midic21+-- +-- +-- * syntax : +-- +-- > idest midic21 ictlno1, ictlno2, ictlno3, imin, imax [, ifn]+-- > kdest midic21 ictlno1, ictlno2, ictlno3, kmin, kmax [, ifn]+-- +-- +-- * description : +-- +-- Allows a floating-point 21-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midic21.html>+ +midic21I ::+ [Irate] -> Irate -> Irate -> Irate -> Irate -> Irate -> Irate+midic21I i0init i1ctlno1 i2ctlno2 i3ctlno3 i4min i5max+ = opcode "midic21" args+ where args+ = [to i1ctlno1, to i2ctlno2, to i3ctlno3, to i4min, to i5max] +++ map to i0init+++-- | * opcode : midic21+-- +-- +-- * syntax : +-- +-- > idest midic21 ictlno1, ictlno2, ictlno3, imin, imax [, ifn]+-- > kdest midic21 ictlno1, ictlno2, ictlno3, kmin, kmax [, ifn]+-- +-- +-- * description : +-- +-- Allows a floating-point 21-bit MIDI signal scaled with a minimum+-- and a maximum range.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midic21.html>+ +midic21K ::+ (K k0, K k1) =>+ [Irate] -> Irate -> Irate -> Irate -> k0 -> k1 -> Krate+midic21K i0init i1ctlno1 i2ctlno2 i3ctlno3 k4min k5max+ = opcode "midic21" args+ where args+ = [to i1ctlno1, to i2ctlno2, to i3ctlno3, to k4min, to k5max] +++ map to i0init+++-- | * opcode : initc7+-- +-- +-- * syntax : +-- +-- > initc7 ichan, ictlno, ivalue+-- +-- +-- * description : +-- +-- Initializes MIDI controller ictlno with ivalue+-- +-- +-- * url : <http://www.csounds.com/manual/html/initc7.html>+ +initc7 :: Irate -> Irate -> Irate -> SignalOut+initc7 i0chan i1ctlno i2value = outOpcode "initc7" args+ where args = [to i0chan, to i1ctlno, to i2value]+++-- | * opcode : initc14+-- +-- +-- * syntax : +-- +-- > initc14 ichan, ictlno1, ictlno2, ivalue+-- +-- +-- * description : +-- +-- Initializes the controllers used to create a 14-bit MIDI value.+-- +-- +-- * url : <http://www.csounds.com/manual/html/initc14.html>+ +initc14 :: Irate -> Irate -> Irate -> Irate -> SignalOut+initc14 i0chan i1ctlno1 i2ctlno2 i3value = outOpcode "initc14" args+ where args = [to i0chan, to i1ctlno1, to i2ctlno2, to i3value]+++-- | * opcode : initc21+-- +-- +-- * syntax : +-- +-- > initc21 ichan, ictlno1, ictlno2, ictlno3, ivalue+-- +-- +-- * description : +-- +-- Initializes the controllers used to create a 21-bit MIDI value.+-- +-- +-- * url : <http://www.csounds.com/manual/html/initc21.html>+ +initc21 :: Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+initc21 i0chan i1ctlno1 i2ctlno2 i3ctlno3 i4value+ = outOpcode "initc21" args+ where args+ = [to i0chan, to i1ctlno1, to i2ctlno2, to i3ctlno3, to i4value]
+ src/CsoundExpr/Opcodes/Midi/Interop.hs view
@@ -0,0 +1,304 @@+-- | MIDI/Score Interoperability opcodes+module CsoundExpr.Opcodes.Midi.Interop+ (midichannelaftertouch,+ midichn,+ midicontrolchange,+ mididefault,+ midinoteoff,+ midinoteoncps,+ midinoteonkey,+ midinoteonoct,+ midinoteonpch,+ midipitchbend,+ midipolyaftertouch,+ midiprogramchange)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : midichannelaftertouch+-- +-- +-- * syntax : +-- +-- > midichannelaftertouch xchannelaftertouch [, ilow] [, ihigh]+-- +-- +-- * description : +-- +-- 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.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midichannelaftertouch.html>+ +midichannelaftertouch :: (X x0) => [Irate] -> x0 -> SignalOut+midichannelaftertouch i0init x1channelaftertouch+ = outOpcode "midichannelaftertouch" args+ where args = [to x1channelaftertouch] ++ map to i0init+++-- | * opcode : midichn+-- +-- +-- * syntax : +-- +-- > ichn midichn+-- +-- +-- * description : +-- +-- midichn returns the MIDI channel number (1 - 16) from which the+-- note was activated. In the case of score notes, it returns 0.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midichn.html>+ +midichn :: Irate+midichn = opcode "midichn" args+ where args = []+++-- | * opcode : midicontrolchange+-- +-- +-- * syntax : +-- +-- > midicontrolchange xcontroller, xcontrollervalue [, ilow] [, ihigh]+-- +-- +-- * description : +-- +-- 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.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midicontrolchange.html>+ +midicontrolchange ::+ (X x0, X x1) => [Irate] -> x0 -> x1 -> SignalOut+midicontrolchange i0init x1controller x2controllervalue+ = outOpcode "midicontrolchange" args+ where args+ = [to x1controller, to x2controllervalue] ++ map to i0init+++-- | * opcode : mididefault+-- +-- +-- * syntax : +-- +-- > mididefault xdefault, xvalue+-- +-- +-- * description : +-- +-- 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.+-- +-- +-- * url : <http://www.csounds.com/manual/html/mididefault.html>+ +mididefault :: (X x0, X x1) => x0 -> x1 -> SignalOut+mididefault x0default x1value = outOpcode "mididefault" args+ where args = [to x0default, to x1value]+++-- | * opcode : midinoteoff+-- +-- +-- * syntax : +-- +-- > midinoteoff xkey, xvelocity+-- +-- +-- * description : +-- +-- 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.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midinoteoff.html>+ +midinoteoff :: (X x0, X x1) => x0 -> x1 -> SignalOut+midinoteoff x0key x1velocity = outOpcode "midinoteoff" args+ where args = [to x0key, to x1velocity]+++-- | * opcode : midinoteoncps+-- +-- +-- * syntax : +-- +-- > midinoteoncps xcps, xvelocity+-- +-- +-- * description : +-- +-- 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.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midinoteoncps.html>+ +midinoteoncps :: (X x0, X x1) => x0 -> x1 -> SignalOut+midinoteoncps x0cps x1velocity = outOpcode "midinoteoncps" args+ where args = [to x0cps, to x1velocity]+++-- | * opcode : midinoteonkey+-- +-- +-- * syntax : +-- +-- > midinoteonkey xkey, xvelocity+-- +-- +-- * description : +-- +-- 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.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midinoteonkey.html>+ +midinoteonkey :: (X x0, X x1) => x0 -> x1 -> SignalOut+midinoteonkey x0key x1velocity = outOpcode "midinoteonkey" args+ where args = [to x0key, to x1velocity]+++-- | * opcode : midinoteonoct+-- +-- +-- * syntax : +-- +-- > midinoteonoct xoct, xvelocity+-- +-- +-- * description : +-- +-- 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.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midinoteonoct.html>+ +midinoteonoct :: (X x0, X x1) => x0 -> x1 -> SignalOut+midinoteonoct x0oct x1velocity = outOpcode "midinoteonoct" args+ where args = [to x0oct, to x1velocity]+++-- | * opcode : midinoteonpch+-- +-- +-- * syntax : +-- +-- > midinoteonpch xpch, xvelocity+-- +-- +-- * description : +-- +-- 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.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midinoteonpch.html>+ +midinoteonpch :: (X x0, X x1) => x0 -> x1 -> SignalOut+midinoteonpch x0pch x1velocity = outOpcode "midinoteonpch" args+ where args = [to x0pch, to x1velocity]+++-- | * opcode : midipitchbend+-- +-- +-- * syntax : +-- +-- > midipitchbend xpitchbend [, ilow] [, ihigh]+-- +-- +-- * description : +-- +-- 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.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midipitchbend.html>+ +midipitchbend :: (X x0) => [Irate] -> x0 -> SignalOut+midipitchbend i0init x1pitchbend = outOpcode "midipitchbend" args+ where args = [to x1pitchbend] ++ map to i0init+++-- | * opcode : midipolyaftertouch+-- +-- +-- * syntax : +-- +-- > midipolyaftertouch xpolyaftertouch, xcontrollervalue [, ilow] [, ihigh]+-- +-- +-- * description : +-- +-- 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.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midipolyaftertouch.html>+ +midipolyaftertouch ::+ (X x0, X x1) => [Irate] -> x0 -> x1 -> SignalOut+midipolyaftertouch i0init x1polyaftertouch x2controllervalue+ = outOpcode "midipolyaftertouch" args+ where args+ = [to x1polyaftertouch, to x2controllervalue] ++ map to i0init+++-- | * opcode : midiprogramchange+-- +-- +-- * syntax : +-- +-- > midiprogramchange xprogram+-- +-- +-- * description : +-- +-- 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.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midiprogramchange.html>+ +midiprogramchange :: (X x0) => x0 -> SignalOut+midiprogramchange x0program = outOpcode "midiprogramchange" args+ where args = [to x0program]
+ src/CsoundExpr/Opcodes/Midi/Onoff.hs view
@@ -0,0 +1,164 @@+-- | Note-on/Note-off Output+module CsoundExpr.Opcodes.Midi.Onoff+ (midion,+ midion2,+ moscil,+ noteoff,+ noteon,+ noteondur,+ noteondur2)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : midion+-- +-- +-- * syntax : +-- +-- > midion kchn, knum, kvel+-- +-- +-- * description : +-- +-- Generates MIDI note messages at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midion.html>+ +midion :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> SignalOut+midion k0chn k1num k2vel = outOpcode "midion" args+ where args = [to k0chn, to k1num, to k2vel]+++-- | * opcode : midion2+-- +-- +-- * syntax : +-- +-- > midion2 kchn, knum, kvel, ktrig+-- +-- +-- * description : +-- +-- Sends noteon and noteoff messages to the MIDI OUT port when+-- triggered by a value different than zero.+-- +-- +-- * url : <http://www.csounds.com/manual/html/midion2.html>+ +midion2 ::+ (K k0, K k1, K k2, K k3) => k0 -> k1 -> k2 -> k3 -> SignalOut+midion2 k0chn k1num k2vel k3trig = outOpcode "midion2" args+ where args = [to k0chn, to k1num, to k2vel, to k3trig]+++-- | * opcode : moscil+-- +-- +-- * syntax : +-- +-- > moscil kchn, knum, kvel, kdur, kpause+-- +-- +-- * description : +-- +-- Sends a stream of the MIDI notes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/moscil.html>+ +moscil ::+ (K k0, K k1, K k2, K k3, K k4) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> SignalOut+moscil k0chn k1num k2vel k3dur k4pause = outOpcode "moscil" args+ where args = [to k0chn, to k1num, to k2vel, to k3dur, to k4pause]+++-- | * opcode : noteoff+-- +-- +-- * syntax : +-- +-- > noteoff ichn, inum, ivel+-- +-- +-- * description : +-- +-- Send a noteoff message to the MIDI OUT port.+-- +-- +-- * url : <http://www.csounds.com/manual/html/noteoff.html>+ +noteoff :: Irate -> Irate -> Irate -> SignalOut+noteoff i0chn i1num i2vel = outOpcode "noteoff" args+ where args = [to i0chn, to i1num, to i2vel]+++-- | * opcode : noteon+-- +-- +-- * syntax : +-- +-- > noteon ichn, inum, ivel+-- +-- +-- * description : +-- +-- Send a noteon message to the MIDI OUT port.+-- +-- +-- * url : <http://www.csounds.com/manual/html/noteon.html>+ +noteon :: Irate -> Irate -> Irate -> SignalOut+noteon i0chn i1num i2vel = outOpcode "noteon" args+ where args = [to i0chn, to i1num, to i2vel]+++-- | * opcode : noteondur+-- +-- +-- * syntax : +-- +-- > noteondur ichn, inum, ivel, idur+-- +-- +-- * description : +-- +-- Sends a noteon and a noteoff MIDI message both with the same+-- channel, number and velocity.+-- +-- +-- * url : <http://www.csounds.com/manual/html/noteondur.html>+ +noteondur :: Irate -> Irate -> Irate -> Irate -> SignalOut+noteondur i0chn i1num i2vel i3dur = outOpcode "noteondur" args+ where args = [to i0chn, to i1num, to i2vel, to i3dur]+++-- | * opcode : noteondur2+-- +-- +-- * syntax : +-- +-- > noteondur2 ichn, inum, ivel, idur+-- +-- +-- * description : +-- +-- Sends a noteon and a noteoff MIDI message both with the same+-- channel, number and velocity.+-- +-- +-- * url : <http://www.csounds.com/manual/html/noteondur2.html>+ +noteondur2 :: Irate -> Irate -> Irate -> Irate -> SignalOut+noteondur2 i0chn i1num i2vel i3dur = outOpcode "noteondur2" args+ where args = [to i0chn, to i1num, to i2vel, to i3dur]
+ src/CsoundExpr/Opcodes/Midi/Output.hs view
@@ -0,0 +1,326 @@+-- | MIDI Message Output+module CsoundExpr.Opcodes.Midi.Output+ (mdelay,+ nrpn,+ outiat,+ outic,+ outic14,+ outipat,+ outipb,+ outipc,+ outkat,+ outkc,+ outkc14,+ outkpat,+ outkpb,+ outkpc)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : mdelay+-- +-- +-- * syntax : +-- +-- > mdelay kstatus, kchan, kd1, kd2, kdelay+-- +-- +-- * description : +-- +-- A MIDI delay opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/mdelay.html>+ +mdelay ::+ (K k0, K k1, K k2, K k3, K k4) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> SignalOut+mdelay k0status k1chan k2d1 k3d2 k4delay = outOpcode "mdelay" args+ where args = [to k0status, to k1chan, to k2d1, to k3d2, to k4delay]+++-- | * opcode : nrpn+-- +-- +-- * syntax : +-- +-- > nrpn kchan, kparmnum, kparmvalue+-- +-- +-- * description : +-- +-- Sends a NPRN (Non-Registered Parameter Number) message to the+-- MIDI OUT port each time one of the input arguments changes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/nrpn.html>+ +nrpn :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> SignalOut+nrpn k0chan k1parmnum k2parmvalue = outOpcode "nrpn" args+ where args = [to k0chan, to k1parmnum, to k2parmvalue]+++-- | * opcode : outiat+-- +-- +-- * syntax : +-- +-- > outiat ichn, ivalue, imin, imax+-- +-- +-- * description : +-- +-- Sends MIDI aftertouch messages at i-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outiat.html>+ +outiat :: Irate -> Irate -> Irate -> Irate -> SignalOut+outiat i0chn i1value i2min i3max = outOpcode "outiat" args+ where args = [to i0chn, to i1value, to i2min, to i3max]+++-- | * opcode : outic+-- +-- +-- * syntax : +-- +-- > outic ichn, inum, ivalue, imin, imax+-- +-- +-- * description : +-- +-- Sends MIDI controller output at i-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outic.html>+ +outic :: Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+outic i0chn i1num i2value i3min i4max = outOpcode "outic" args+ where args = [to i0chn, to i1num, to i2value, to i3min, to i4max]+++-- | * opcode : outic14+-- +-- +-- * syntax : +-- +-- > outic14 ichn, imsb, ilsb, ivalue, imin, imax+-- +-- +-- * description : +-- +-- Sends 14-bit MIDI controller output at i-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outic14.html>+ +outic14 ::+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+outic14 i0chn i1msb i2lsb i3value i4min i5max+ = outOpcode "outic14" args+ where args+ = [to i0chn, to i1msb, to i2lsb, to i3value, to i4min, to i5max]+++-- | * opcode : outipat+-- +-- +-- * syntax : +-- +-- > outipat ichn, inotenum, ivalue, imin, imax+-- +-- +-- * description : +-- +-- Sends polyphonic MIDI aftertouch messages at i-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outipat.html>+ +outipat :: Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+outipat i0chn i1notenum i2value i3min i4max+ = outOpcode "outipat" args+ where args+ = [to i0chn, to i1notenum, to i2value, to i3min, to i4max]+++-- | * opcode : outipb+-- +-- +-- * syntax : +-- +-- > outipb ichn, ivalue, imin, imax+-- +-- +-- * description : +-- +-- Sends MIDI pitch-bend messages at i-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outipb.html>+ +outipb :: Irate -> Irate -> Irate -> Irate -> SignalOut+outipb i0chn i1value i2min i3max = outOpcode "outipb" args+ where args = [to i0chn, to i1value, to i2min, to i3max]+++-- | * opcode : outipc+-- +-- +-- * syntax : +-- +-- > outipc ichn, iprog, imin, imax+-- +-- +-- * description : +-- +-- Sends MIDI program change messages at i-rate+-- +-- +-- * url : <http://www.csounds.com/manual/html/outipc.html>+ +outipc :: Irate -> Irate -> Irate -> Irate -> SignalOut+outipc i0chn i1prog i2min i3max = outOpcode "outipc" args+ where args = [to i0chn, to i1prog, to i2min, to i3max]+++-- | * opcode : outkat+-- +-- +-- * syntax : +-- +-- > outkat kchn, kvalue, kmin, kmax+-- +-- +-- * description : +-- +-- Sends MIDI aftertouch messages at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outkat.html>+ +outkat ::+ (K k0, K k1, K k2, K k3) => k0 -> k1 -> k2 -> k3 -> SignalOut+outkat k0chn k1value k2min k3max = outOpcode "outkat" args+ where args = [to k0chn, to k1value, to k2min, to k3max]+++-- | * opcode : outkc+-- +-- +-- * syntax : +-- +-- > outkc kchn, knum, kvalue, kmin, kmax+-- +-- +-- * description : +-- +-- Sends MIDI controller messages at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outkc.html>+ +outkc ::+ (K k0, K k1, K k2, K k3, K k4) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> SignalOut+outkc k0chn k1num k2value k3min k4max = outOpcode "outkc" args+ where args = [to k0chn, to k1num, to k2value, to k3min, to k4max]+++-- | * opcode : outkc14+-- +-- +-- * syntax : +-- +-- > outkc14 kchn, kmsb, klsb, kvalue, kmin, kmax+-- +-- +-- * description : +-- +-- Sends 14-bit MIDI controller output at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outkc14.html>+ +outkc14 ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> SignalOut+outkc14 k0chn k1msb k2lsb k3value k4min k5max+ = outOpcode "outkc14" args+ where args+ = [to k0chn, to k1msb, to k2lsb, to k3value, to k4min, to k5max]+++-- | * opcode : outkpat+-- +-- +-- * syntax : +-- +-- > outkpat kchn, knotenum, kvalue, kmin, kmax+-- +-- +-- * description : +-- +-- Sends polyphonic MIDI aftertouch messages at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outkpat.html>+ +outkpat ::+ (K k0, K k1, K k2, K k3, K k4) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> SignalOut+outkpat k0chn k1notenum k2value k3min k4max+ = outOpcode "outkpat" args+ where args+ = [to k0chn, to k1notenum, to k2value, to k3min, to k4max]+++-- | * opcode : outkpb+-- +-- +-- * syntax : +-- +-- > outkpb kchn, kvalue, kmin, kmax+-- +-- +-- * description : +-- +-- Sends MIDI pitch-bend messages at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outkpb.html>+ +outkpb ::+ (K k0, K k1, K k2, K k3) => k0 -> k1 -> k2 -> k3 -> SignalOut+outkpb k0chn k1value k2min k3max = outOpcode "outkpb" args+ where args = [to k0chn, to k1value, to k2min, to k3max]+++-- | * opcode : outkpc+-- +-- +-- * syntax : +-- +-- > outkpc kchn, kprog, kmin, kmax+-- +-- +-- * description : +-- +-- Sends MIDI program change messages at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outkpc.html>+ +outkpc ::+ (K k0, K k1, K k2, K k3) => k0 -> k1 -> k2 -> k3 -> SignalOut+outkpc k0chn k1prog k2min k3max = outOpcode "outkpc" args+ where args = [to k0chn, to k1prog, to k2min, to k3max]
+ src/CsoundExpr/Opcodes/Midi/Realtime.hs view
@@ -0,0 +1,53 @@+-- | System Realtime Messages+module CsoundExpr.Opcodes.Midi.Realtime+ (mclock,+ mrtmsg)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : mclock+-- +-- +-- * syntax : +-- +-- > mclock ifreq+-- +-- +-- * description : +-- +-- Sends a MIDI CLOCK message.+-- +-- +-- * url : <http://www.csounds.com/manual/html/mclock.html>+ +mclock :: Irate -> SignalOut+mclock i0freq = outOpcode "mclock" args+ where args = [to i0freq]+++-- | * opcode : mrtmsg+-- +-- +-- * syntax : +-- +-- > mrtmsg imsgtype+-- +-- +-- * description : +-- +-- Send system real-time messages to the MIDI OUT port.+-- +-- +-- * url : <http://www.csounds.com/manual/html/mrtmsg.html>+ +mrtmsg :: Irate -> SignalOut+mrtmsg i0msgtype = outOpcode "mrtmsg" args+ where args = [to i0msgtype]
+ src/CsoundExpr/Opcodes/Midi/Slidrbk.hs view
@@ -0,0 +1,421 @@+-- | Slider Banks+module CsoundExpr.Opcodes.Midi.Slidrbk+ (slider16,+ slider16f,+ slider32,+ slider32f,+ slider64,+ slider64f,+ s16b14,+ s32b14,+ sliderKawai,+ slider8table,+ slider8tablef,+ slider16table,+ slider16tablef,+ slider32table,+ slider32tablef,+ slider64table,+ slider64tablef)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : slider16+-- +-- +-- * syntax : +-- +-- > i1,...,i16 slider16 ichan, ictlnum1, imin1, imax1, init1, ifn1,..., +-- > ictlnum16, imin16, imax16, init16, ifn16+-- > k1,...,k16 slider16 ichan, ictlnum1, imin1, imax1, init1, ifn1,..., +-- > ictlnum16, imin16, imax16, init16, ifn16+-- +-- +-- * description : +-- +-- Creates a bank of 16 different MIDI control message numbers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider16.html>+ +slider16 :: Irate -> [Irate] -> MultiOut+slider16 i0chan i1vals = opcode "slider16" args+ where args = [to i0chan] ++ map to i1vals+++-- | * opcode : slider16f+-- +-- +-- * syntax : +-- +-- > k1,...,k16 slider16f ichan, ictlnum1, imin1, imax1, init1, ifn1, +-- > icutoff1,..., ictlnum16, imin16, imax16, init16, ifn16, icutoff16+-- +-- +-- * description : +-- +-- Creates a bank of 16 different MIDI control message numbers,+-- filtered before output.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider16f.html>+ +slider16f :: Irate -> [Irate] -> MultiOut+slider16f i0chan i1vals = opcode "slider16f" args+ where args = [to i0chan] ++ map to i1vals+++-- | * opcode : slider32+-- +-- +-- * syntax : +-- +-- > i1,...,i32 slider32 ichan, ictlnum1, imin1, imax1, init1, ifn1,..., +-- > ictlnum32, imin32, imax32, init32, ifn32+-- > k1,...,k32 slider32 ichan, ictlnum1, imin1, imax1, init1, ifn1,..., +-- > ictlnum32, imin32, imax32, init32, ifn32+-- +-- +-- * description : +-- +-- Creates a bank of 32 different MIDI control message numbers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider32.html>+ +slider32 :: Irate -> [Irate] -> MultiOut+slider32 i0chan i1vals = opcode "slider32" args+ where args = [to i0chan] ++ map to i1vals+++-- | * opcode : slider32f+-- +-- +-- * syntax : +-- +-- > k1,...,k32 slider32f ichan, ictlnum1, imin1, imax1, init1, ifn1, icutoff1, +-- > ..., ictlnum32, imin32, imax32, init32, ifn32, icutoff32+-- +-- +-- * description : +-- +-- Creates a bank of 32 different MIDI control message numbers,+-- filtered before output.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider32f.html>+ +slider32f :: Irate -> [Irate] -> MultiOut+slider32f i0chan i1vals = opcode "slider32f" args+ where args = [to i0chan] ++ map to i1vals+++-- | * opcode : slider64+-- +-- +-- * syntax : +-- +-- > i1,...,i64 slider64 ichan, ictlnum1, imin1, imax1, init1, ifn1,..., +-- > ictlnum64, imin64, imax64, init64, ifn64+-- > k1,...,k64 slider64 ichan, ictlnum1, imin1, imax1, init1, ifn1,..., +-- > ictlnum64, imin64, imax64, init64, ifn64+-- +-- +-- * description : +-- +-- Creates a bank of 64 different MIDI control message numbers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider64.html>+ +slider64 :: Irate -> [Irate] -> MultiOut+slider64 i0chan i1vals = opcode "slider64" args+ where args = [to i0chan] ++ map to i1vals+++-- | * opcode : slider64f+-- +-- +-- * syntax : +-- +-- > k1,...,k64 slider64f ichan, ictlnum1, imin1, imax1, init1, ifn1, +-- > icutoff1,..., ictlnum64, imin64, imax64, init64, ifn64, icutoff64+-- +-- +-- * description : +-- +-- Creates a bank of 64 different MIDI control message numbers,+-- filtered before output.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider64f.html>+ +slider64f :: Irate -> [Irate] -> MultiOut+slider64f i0chan i1vals = opcode "slider64f" args+ where args = [to i0chan] ++ map to i1vals+++-- | * opcode : s16b14+-- +-- +-- * syntax : +-- +-- > i1,...,i16 s16b14 ichan, ictlno_msb1, ictlno_lsb1, imin1, imax1, +-- > initvalue1, ifn1,..., ictlno_msb16, ictlno_lsb16, imin16, imax16, initvalue16, ifn16+-- > k1,...,k16 s16b14 ichan, ictlno_msb1, ictlno_lsb1, imin1, imax1, +-- > initvalue1, ifn1,..., ictlno_msb16, ictlno_lsb16, imin16, imax16, initvalue16, ifn16+-- +-- +-- * description : +-- +-- Creates a bank of 16 different 14-bit MIDI control message+-- numbers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/s16b14.html>+ +s16b14 :: Irate -> [Irate] -> MultiOut+s16b14 i0chan i1vals = opcode "s16b14" args+ where args = [to i0chan] ++ map to i1vals+++-- | * opcode : s32b14+-- +-- +-- * syntax : +-- +-- > i1,...,i32 s32b14 ichan, ictlno_msb1, ictlno_lsb1, imin1, imax1, +-- > initvalue1, ifn1,..., ictlno_msb32, ictlno_lsb32, imin32, imax32, initvalue32, ifn32+-- > k1,...,k32 s32b14 ichan, ictlno_msb1, ictlno_lsb1, imin1, imax1, +-- > initvalue1, ifn1,..., ictlno_msb32, ictlno_lsb32, imin32, imax32, initvalue32, ifn32+-- +-- +-- * description : +-- +-- Creates a bank of 32 different 14-bit MIDI control message+-- numbers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/s32b14.html>+ +s32b14 :: Irate -> [Irate] -> MultiOut+s32b14 i0chan i1vals = opcode "s32b14" args+ where args = [to i0chan] ++ map to i1vals+++-- | * opcode : sliderKawai+-- +-- +-- * syntax : +-- +-- > k1, k2,...., k16 sliderKawai imin1, imax1, init1, ifn1, +-- > imin2, imax2, init2, ifn2,..., imin16, imax16, init16, ifn16+-- +-- +-- * description : +-- +-- Creates a bank of 16 different MIDI control message numbers from+-- a KAWAI MM-16 midi mixer.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sliderKawai.html>+ +sliderKawai :: [Irate] -> MultiOut+sliderKawai i0vals = opcode "sliderKawai" args+ where args = map to i0vals+++-- | * opcode : slider8table+-- +-- +-- * syntax : +-- +-- > kflag slider8table ichan, ioutTable, ioffset, ictlnum1, imin1, imax1, +-- > init1, ifn1,..., ictlnum8, imin8, imax8, init8, ifn8+-- +-- +-- * description : +-- +-- Stores a bank of 8 different MIDI control messages to a table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider8table.html>+ +slider8table :: Irate -> Irate -> Irate -> [Irate] -> Krate+slider8table i0chan i1outTable i2offset i3vals+ = opcode "slider8table" args+ where args+ = [to i0chan, to i1outTable, to i2offset] ++ map to i3vals+++-- | * opcode : slider8tablef+-- +-- +-- * syntax : +-- +-- > kflag slider8tablef ichan, ioutTable, ioffset, ictlnum1, imin1, imax1, +-- > init1, ifn1, icutoff1,...., ictlnum8, imin8, imax8, init8, ifn8, icutoff8+-- +-- +-- * description : +-- +-- Stores a bank of 8 different MIDI control messages to a table,+-- filtered before output.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider8tablef.html>+ +slider8tablef :: Irate -> Irate -> Irate -> [Irate] -> Krate+slider8tablef i0chan i1outTable i2offset i3vals+ = opcode "slider8tablef" args+ where args+ = [to i0chan, to i1outTable, to i2offset] ++ map to i3vals+++-- | * opcode : slider16table+-- +-- +-- * syntax : +-- +-- > kflag slider16table ichan, ioutTable, ioffset, ictlnum1, imin1, imax1, +-- > init1, ifn1,...., ictlnum16, imin16, imax16, init16, ifn16+-- +-- +-- * description : +-- +-- Stores a bank of 16 different MIDI control messages to a table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider16table.html>+ +slider16table :: Irate -> Irate -> Irate -> [Irate] -> Krate+slider16table i0chan i1outTable i2offset i3vals+ = opcode "slider16table" args+ where args+ = [to i0chan, to i1outTable, to i2offset] ++ map to i3vals+++-- | * opcode : slider16tablef+-- +-- +-- * syntax : +-- +-- > kflag slider16tablef ichan, ioutTable, ioffset, ictlnum1, imin1, imax1, +-- > init1, ifn1, icutoff1,...., ictlnum16, imin16, imax16, init16, ifn16, icutoff16+-- +-- +-- * description : +-- +-- Stores a bank of 16 different MIDI control messages to a table,+-- filtered before output.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider16tablef.html>+ +slider16tablef :: Irate -> Irate -> Irate -> [Irate] -> Krate+slider16tablef i0chan i1outTable i2offset i3vals+ = opcode "slider16tablef" args+ where args+ = [to i0chan, to i1outTable, to i2offset] ++ map to i3vals+++-- | * opcode : slider32table+-- +-- +-- * syntax : +-- +-- > kflag slider32table ichan, ioutTable, ioffset, ictlnum1, imin1, +-- > imax1, init1, ifn1,...., ictlnum32, imin32, imax32, init32, ifn32+-- +-- +-- * description : +-- +-- Creates a bank of 32 different MIDI control messages to a table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider32table.html>+ +slider32table :: Irate -> Irate -> Irate -> [Irate] -> Krate+slider32table i0chan i1outTable i2offset i3vals+ = opcode "slider32table" args+ where args+ = [to i0chan, to i1outTable, to i2offset] ++ map to i3vals+++-- | * opcode : slider32tablef+-- +-- +-- * syntax : +-- +-- > kflag slider32tablef ichan, ioutTable, ioffset, ictlnum1, imin1, imax1, +-- > init1, ifn1, icutoff1,...., ictlnum32, imin32, imax32, init32, ifn32, icutoff32+-- +-- +-- * description : +-- +-- Creates a bank of 32 different MIDI control message numbers,+-- filtered before output.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider32tablef.html>+ +slider32tablef :: Irate -> Irate -> Irate -> [Irate] -> Krate+slider32tablef i0chan i1outTable i2offset i3vals+ = opcode "slider32tablef" args+ where args+ = [to i0chan, to i1outTable, to i2offset] ++ map to i3vals+++-- | * opcode : slider64table+-- +-- +-- * syntax : +-- +-- > kflag slider64table ichan, ioutTable, ioffset, ictlnum1, imin1, +-- > imax1, init1, ifn1,...., ictlnum64, imin64, imax64, init64, ifn64+-- +-- +-- * description : +-- +-- Creates a bank of 64 different MIDI control messages to a table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider64table.html>+ +slider64table :: Irate -> Irate -> Irate -> [Irate] -> Krate+slider64table i0chan i1outTable i2offset i3vals+ = opcode "slider64table" args+ where args+ = [to i0chan, to i1outTable, to i2offset] ++ map to i3vals+++-- | * opcode : slider64tablef+-- +-- +-- * syntax : +-- +-- > kflag slider64tablef ichan, ioutTable, ioffset, ictlnum1, imin1, imax1, +-- > init1, ifn1, icutoff1,...., ictlnum64, imin64, imax64, init64, ifn64, icutoff64+-- +-- +-- * description : +-- +-- Stores a bank of 64 different MIDI MIDI control messages to a+-- table, filtered before output.+-- +-- +-- * url : <http://www.csounds.com/manual/html/slider64tablef.html>+ +slider64tablef :: Irate -> Irate -> Irate -> [Irate] -> Krate+slider64tablef i0chan i1outTable i2offset i3vals+ = opcode "slider64tablef" args+ where args+ = [to i0chan, to i1outTable, to i2offset] ++ map to i3vals
+ src/CsoundExpr/Opcodes/Miscopcodes.hs view
@@ -0,0 +1,8 @@+-- | Miscellaneous opcodes+module CsoundExpr.Opcodes.Miscopcodes+ (module CsoundExpr.Opcodes.Miscopcodes.Top)+where++++import CsoundExpr.Opcodes.Miscopcodes.Top
+ src/CsoundExpr/Opcodes/Miscopcodes/Top.hs view
@@ -0,0 +1,69 @@+-- | Miscellaneous opcodes+module CsoundExpr.Opcodes.Miscopcodes.Top+ (system,+ modmatrix)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : system+-- +-- +-- * syntax : +-- +-- > ires system_i itrig, Scmd, [inowait]+-- > kres system ktrig, Scmd, [knowait]+-- +-- +-- * description : +-- +-- system and system_i call any external command understood by the+-- operating system, similarly to the C function system(). system_i+-- runs at i-time only, while system runs both at initialization and+-- performance time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/system.html>+ +system :: (K k0, K k1) => [k0] -> k1 -> String -> Krate+system k0init k1trig s2cmd = opcode "system" args+ where args = [to k1trig, to s2cmd] ++ map to k0init+++-- | * opcode : modmatrix+-- +-- +-- * syntax : +-- +-- > modmatrix iresfn, isrcmodfn, isrcparmfn, imodscale, inum_mod, +-- > inum_parm, kupdate+-- +-- +-- * description : +-- +-- The opcode can be used to let a large number of k-rate modulator+-- variables modulate a large number of k-rate parameter variables,+-- with arbitrary scaling of each modulator-to-parameter connection.+-- Csound ftables are used to hold both the input (parameter)+-- variables, the modulator variables, and the scaling coefficients.+-- Output variables are written to another Csound ftable.+-- +-- +-- * url : <http://www.csounds.com/manual/html/modmatrix.html>+ +modmatrix ::+ (K k0) =>+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> k0 -> SignalOut+modmatrix i0resfn i1srcmodfn i2srcparmfn i3modscale i4num_mod+ i5num_parm k6update = outOpcode "modmatrix" args+ where args+ = [to i0resfn, to i1srcmodfn, to i2srcparmfn, to i3modscale,+ to i4num_mod, to i5num_parm, to k6update]
+ src/CsoundExpr/Opcodes/MixerOpcodes.hs view
@@ -0,0 +1,8 @@+-- | Mixer Opcodes+module CsoundExpr.Opcodes.MixerOpcodes+ (module CsoundExpr.Opcodes.MixerOpcodes.MixerOpcodes)+where++++import CsoundExpr.Opcodes.MixerOpcodes.MixerOpcodes
+ src/CsoundExpr/Opcodes/MixerOpcodes/MixerOpcodes.hs view
@@ -0,0 +1,147 @@+-- | Mixer Opcodes+module CsoundExpr.Opcodes.MixerOpcodes.MixerOpcodes+ (mixerSend,+ mixerReceive,+ mixerSetLevel,+ mixerSetLevel_i,+ mixerGetLevel,+ mixerClear)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : MixerSend+-- +-- +-- * syntax : +-- +-- > MixerSend asignal, isend, ibuss, ichannel+-- +-- +-- * description : +-- +-- Mixes an arate signal into a channel of a buss.+-- +-- +-- * url : <http://www.csounds.com/manual/html/MixerSend.html>+ +mixerSend :: Arate -> Irate -> Irate -> Irate -> SignalOut+mixerSend a0signal i1send i2buss i3channel+ = outOpcode "MixerSend" args+ where args = [to a0signal, to i1send, to i2buss, to i3channel]+++-- | * opcode : MixerReceive+-- +-- +-- * syntax : +-- +-- > asignal MixerReceive ibuss, ichannel+-- +-- +-- * description : +-- +-- Receives an arate signal that has been mixed onto a channel of a+-- buss.+-- +-- +-- * url : <http://www.csounds.com/manual/html/MixerReceive.html>+ +mixerReceive :: Irate -> Irate -> Arate+mixerReceive i0buss i1channel = opcode "MixerReceive" args+ where args = [to i0buss, to i1channel]+++-- | * opcode : MixerSetLevel+-- +-- +-- * syntax : +-- +-- > MixerSetLevel isend, ibuss, kgain+-- +-- +-- * description : +-- +-- Sets the level at which signals from the send are added to the+-- buss. The actual sending of the signal to the buss is performed+-- by the MixerSend opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/MixerSetLevel.html>+ +mixerSetLevel :: (K k0) => Irate -> Irate -> k0 -> SignalOut+mixerSetLevel i0send i1buss k2gain = outOpcode "MixerSetLevel" args+ where args = [to i0send, to i1buss, to k2gain]+++-- | * opcode : MixerSetLevel_i+-- +-- +-- * syntax : +-- +-- > MixerSetLevel_i isend, ibuss, igain+-- +-- +-- * description : +-- +-- Sets the level at which signals from the send are added to the+-- buss. This opcode, because all parameters are irate, may be used+-- in the orchestra header. The actual sending of the signal to the+-- buss is performed by the MixerSend opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/MixerSetLevel_i.html>+ +mixerSetLevel_i :: Irate -> Irate -> Irate -> SignalOut+mixerSetLevel_i i0send i1buss i2gain+ = outOpcode "MixerSetLevel_i" args+ where args = [to i0send, to i1buss, to i2gain]+++-- | * opcode : MixerGetLevel+-- +-- +-- * syntax : +-- +-- > kgain MixerGetLevel isend, ibuss+-- +-- +-- * description : +-- +-- Gets the level at which signals from the send are being added to+-- the buss. The actual sending of the signal to the buss is+-- performed by the MixerSend opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/MixerGetLevel.html>+ +mixerGetLevel :: Irate -> Irate -> Krate+mixerGetLevel i0send i1buss = opcode "MixerGetLevel" args+ where args = [to i0send, to i1buss]+++-- | * opcode : MixerClear+-- +-- +-- * syntax : +-- +-- > MixerClear+-- +-- +-- * description : +-- +-- Resets all channels of a buss to 0.+-- +-- +-- * url : <http://www.csounds.com/manual/html/MixerClear.html>+ +mixerClear :: SignalOut+mixerClear = outOpcode "MixerClear" args+ where args = []
+ src/CsoundExpr/Opcodes/OSCNetwork.hs view
@@ -0,0 +1,12 @@+-- | OSC and Network+module CsoundExpr.Opcodes.OSCNetwork+ (module CsoundExpr.Opcodes.OSCNetwork.OSC,+ module CsoundExpr.Opcodes.OSCNetwork.Network,+ module CsoundExpr.Opcodes.OSCNetwork.Remote)+where++++import CsoundExpr.Opcodes.OSCNetwork.OSC+import CsoundExpr.Opcodes.OSCNetwork.Network+import CsoundExpr.Opcodes.OSCNetwork.Remote
+ src/CsoundExpr/Opcodes/OSCNetwork/Network.hs view
@@ -0,0 +1,63 @@+-- | Network+module CsoundExpr.Opcodes.OSCNetwork.Network+ (sockrecv,+ socksend)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : sockrecv+-- +-- +-- * syntax : +-- +-- > asig sockrecv iport, ilength+-- > asigl, asigr sockrecvs iport, ilength+-- > asig strecv Sipaddr, iport+-- +-- +-- * description : +-- +-- Receives directly using the UDP (sockrecv and sockrecvs) or TCP+-- (strecv) protocol onto a network. The data is not subject to any+-- encoding or special routing. The sockrecvs opcode receives a+-- stereo signal interleaved.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sockrecv.html>+ +sockrecv :: Irate -> Irate -> Arate+sockrecv i0port i1length = opcode "sockrecv" args+ where args = [to i0port, to i1length]+++-- | * opcode : socksend+-- +-- +-- * syntax : +-- +-- > socksend asig, Sipaddr, iport, ilength+-- > socksends asigl, asigr, Sipaddr, iport, ilength+-- > stsend asig, Sipaddr, iport+-- +-- +-- * description : +-- +-- Transmits data directly using the UDP (socksend and socksends)+-- or TCP (stsend) protocol onto a network. The data is not subject+-- to any encoding or special routing. The socksends opcode send a+-- stereo signal interleaved.+-- +-- +-- * url : <http://www.csounds.com/manual/html/socksend.html>+ +socksend :: Arate -> String -> Irate -> Irate -> SignalOut+socksend a0sig s1ipaddr i2port i3length = outOpcode "socksend" args+ where args = [to a0sig, to s1ipaddr, to i2port, to i3length]
+ src/CsoundExpr/Opcodes/OSCNetwork/OSC.hs view
@@ -0,0 +1,81 @@+-- | OSC+module CsoundExpr.Opcodes.OSCNetwork.OSC+ (oscInit,+ oscListen,+ oscSend)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : OSCinit+-- +-- +-- * syntax : +-- +-- > ihandle OSCinit iport+-- +-- +-- * description : +-- +-- Starts a listening process, which can be used by OSClisten.+-- +-- +-- * url : <http://www.csounds.com/manual/html/OSCinit.html>+ +oscInit :: Irate -> Irate+oscInit i0port = opcode "OSCinit" args+ where args = [to i0port]+++-- | * opcode : OSClisten+-- +-- +-- * syntax : +-- +-- > kans OSClisten ihandle, idest, itype [, xdata1, xdata2,...]+-- +-- +-- * description : +-- +-- On each k-cycle looks to see if an OSC message has been send to+-- a given path of a given type.+-- +-- +-- * url : <http://www.csounds.com/manual/html/OSClisten.html>+ +oscListen :: (X x0) => Irate -> Irate -> Irate -> [x0] -> Krate+oscListen i0handle i1dest i2type x3dataN = opcode "OSClisten" args+ where args = [to i0handle, to i1dest, to i2type] ++ map to x3dataN+++-- | * opcode : OSCsend+-- +-- +-- * syntax : +-- +-- > OSCsend kwhen, ihost, iport, idestination, itype [, kdata1, kdata2,...]+-- +-- +-- * description : +-- +-- Uses the OSC protocol to send message to other OSC listening+-- processes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/OSCsend.html>+ +oscSend ::+ (K k0, K k1) =>+ k0 -> Irate -> Irate -> Irate -> Irate -> [k1] -> SignalOut+oscSend k0when i1host i2port i3destination i4type k5dataN+ = outOpcode "OSCsend" args+ where args+ = [to k0when, to i1host, to i2port, to i3destination, to i4type] +++ map to k5dataN
+ src/CsoundExpr/Opcodes/OSCNetwork/Remote.hs view
@@ -0,0 +1,33 @@+-- | Remote Opcodes+module CsoundExpr.Opcodes.OSCNetwork.Remote+ (remoteport)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : remoteport+-- +-- +-- * syntax : +-- +-- > remoteport iportnum+-- +-- +-- * description : +-- +-- Defines the port for use with the insremot, midremot, insglobal+-- and midglobal opcodes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/remoteport.html>+ +remoteport :: Irate -> SignalOut+remoteport i0portnum = outOpcode "remoteport" args+ where args = [to i0portnum]
+ src/CsoundExpr/Opcodes/Pitch.hs view
@@ -0,0 +1,10 @@+-- | Pitch Converters+module CsoundExpr.Opcodes.Pitch+ (module CsoundExpr.Opcodes.Pitch.Funcs,+ module CsoundExpr.Opcodes.Pitch.Tuning)+where++++import CsoundExpr.Opcodes.Pitch.Funcs+import CsoundExpr.Opcodes.Pitch.Tuning
+ src/CsoundExpr/Opcodes/Pitch/Funcs.hs view
@@ -0,0 +1,246 @@+-- | Functions+module CsoundExpr.Opcodes.Pitch.Funcs+ (cent,+ cpsmidinn,+ cpsoct,+ cpspch,+ octave,+ octcps,+ octmidinn,+ octpch,+ pchmidinn,+ pchoct,+ semitone)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : cent+-- +-- +-- * syntax : +-- +-- > cent(x)+-- +-- +-- * description : +-- +-- Calculates a factor to raise/lower a frequency by a given amount+-- of cents.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cent.html>+ +cent :: (X x0) => x0 -> x0+cent x0sig = prefixOperation "cent" args+ where args = [to x0sig]+++-- | * opcode : cpsmidinn+-- +-- +-- * syntax : +-- +-- > cpsmidinn (MidiNoteNumber) (init- or control-rate args only)+-- +-- +-- * description : +-- +-- Converts a Midi note number value to cycles-per-second.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cpsmidinn.html>+ +cpsmidinn :: (K k0) => k0 -> k0+cpsmidinn k0sig = prefixOperation "cpsmidinn" args+ where args = [to k0sig]+++-- | * opcode : cpsoct+-- +-- +-- * syntax : +-- +-- > cpsoct (oct) (no rate restriction)+-- +-- +-- * description : +-- +-- Converts an octave-point-decimal value to cycles-per-second.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cpsoct.html>+ +cpsoct :: (X x0) => x0 -> x0+cpsoct x0sig = prefixOperation "cpsoct" args+ where args = [to x0sig]+++-- | * opcode : cpspch+-- +-- +-- * syntax : +-- +-- > cpspch (pch) (init- or control-rate args only)+-- +-- +-- * description : +-- +-- Converts a pitch-class value to cycles-per-second.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cpspch.html>+ +cpspch :: (K k0) => k0 -> k0+cpspch k0sig = prefixOperation "cpspch" args+ where args = [to k0sig]+++-- | * opcode : octave+-- +-- +-- * syntax : +-- +-- > octave(x)+-- +-- +-- * description : +-- +-- Calculates a factor to raise/lower a frequency by a given amount+-- of octaves.+-- +-- +-- * url : <http://www.csounds.com/manual/html/octave.html>+ +octave :: (X x0) => x0 -> x0+octave x0sig = prefixOperation "octave" args+ where args = [to x0sig]+++-- | * opcode : octcps+-- +-- +-- * syntax : +-- +-- > octcps (cps) (init- or control-rate args only)+-- +-- +-- * description : +-- +-- Converts a cycles-per-second value to octave-point-decimal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/octcps.html>+ +octcps :: (K k0) => k0 -> k0+octcps k0sig = prefixOperation "octcps" args+ where args = [to k0sig]+++-- | * opcode : octmidinn+-- +-- +-- * syntax : +-- +-- > octmidinn (MidiNoteNumber) (init- or control-rate args only)+-- +-- +-- * description : +-- +-- Converts a Midi note number value to octave-point-decimal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/octmidinn.html>+ +octmidinn :: (K k0) => k0 -> k0+octmidinn k0sig = prefixOperation "octmidinn" args+ where args = [to k0sig]+++-- | * opcode : octpch+-- +-- +-- * syntax : +-- +-- > octpch (pch) (init- or control-rate args only)+-- +-- +-- * description : +-- +-- Converts a pitch-class value to octave-point-decimal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/octpch.html>+ +octpch :: (K k0) => k0 -> k0+octpch k0sig = prefixOperation "octpch" args+ where args = [to k0sig]+++-- | * opcode : pchmidinn+-- +-- +-- * syntax : +-- +-- > pchmidinn (MidiNoteNumber) (init- or control-rate args only)+-- +-- +-- * description : +-- +-- Converts a Midi note number value to octave point pitch-class+-- units.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pchmidinn.html>+ +pchmidinn :: (K k0) => k0 -> k0+pchmidinn k0sig = prefixOperation "pchmidinn" args+ where args = [to k0sig]+++-- | * opcode : pchoct+-- +-- +-- * syntax : +-- +-- > pchoct (oct) (init- or control-rate args only)+-- +-- +-- * description : +-- +-- Converts an octave-point-decimal value to pitch-class.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pchoct.html>+ +pchoct :: (K k0) => k0 -> k0+pchoct k0sig = prefixOperation "pchoct" args+ where args = [to k0sig]+++-- | * opcode : semitone+-- +-- +-- * syntax : +-- +-- > semitone(x)+-- +-- +-- * description : +-- +-- Calculates a factor to raise/lower a frequency by a given amount+-- of semitones.+-- +-- +-- * url : <http://www.csounds.com/manual/html/semitone.html>+ +semitone :: (X x0) => x0 -> x0+semitone x0sig = prefixOperation "semitone" args+ where args = [to x0sig]
+ src/CsoundExpr/Opcodes/Pitch/Tuning.hs view
@@ -0,0 +1,98 @@+-- | Tuning Opcodes+module CsoundExpr.Opcodes.Pitch.Tuning+ (cps2pch,+ cpsxpch,+ cpstun,+ cpstuni)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : cps2pch+-- +-- +-- * syntax : +-- +-- > icps cps2pch ipch, iequal+-- +-- +-- * description : +-- +-- Converts a pitch-class value into cycles-per-second (Hz) for+-- equal divisions of the octave.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cps2pch.html>+ +cps2pch :: Irate -> Irate -> Irate+cps2pch i0pch i1equal = opcode "cps2pch" args+ where args = [to i0pch, to i1equal]+++-- | * opcode : cpsxpch+-- +-- +-- * syntax : +-- +-- > icps cpsxpch ipch, iequal, irepeat, ibase+-- +-- +-- * description : +-- +-- Converts a pitch-class value into cycles-per-second (Hz) for+-- equal divisions of any interval. There is a restriction of no+-- more than 100 equal divisions.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cpsxpch.html>+ +cpsxpch :: Irate -> Irate -> Irate -> Irate -> Irate+cpsxpch i0pch i1equal i2repeat i3base = opcode "cpsxpch" args+ where args = [to i0pch, to i1equal, to i2repeat, to i3base]+++-- | * opcode : cpstun+-- +-- +-- * syntax : +-- +-- > kcps cpstun ktrig, kindex, kfn+-- +-- +-- * description : +-- +-- Returns micro-tuning values at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cpstun.html>+ +cpstun :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+cpstun k0trig k1index k2fn = opcode "cpstun" args+ where args = [to k0trig, to k1index, to k2fn]+++-- | * opcode : cpstuni+-- +-- +-- * syntax : +-- +-- > icps cpstuni index, ifn+-- +-- +-- * description : +-- +-- Returns micro-tuning values at init-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cpstuni.html>+ +cpstuni :: Irate -> Irate -> Irate+cpstuni i0ndex i1fn = opcode "cpstuni" args+ where args = [to i0ndex, to i1fn]
+ src/CsoundExpr/Opcodes/Plugin.hs view
@@ -0,0 +1,10 @@+-- | Plugin Hosting+module CsoundExpr.Opcodes.Plugin+ (module CsoundExpr.Opcodes.Plugin.Dssi4cs,+ module CsoundExpr.Opcodes.Plugin.Vst4cs)+where++++import CsoundExpr.Opcodes.Plugin.Dssi4cs+import CsoundExpr.Opcodes.Plugin.Vst4cs
+ src/CsoundExpr/Opcodes/Plugin/Dssi4cs.hs view
@@ -0,0 +1,123 @@+-- | DSSI and LADSPA for Csound+module CsoundExpr.Opcodes.Plugin.Dssi4cs+ (dssiinit,+ dssiactivate,+ dssilist,+ dssiaudio,+ dssictls)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : dssiinit+-- +-- +-- * syntax : +-- +-- > ihandle dssiinit ilibraryname, iplugindex [, iverbose]+-- +-- +-- * description : +-- +-- dssiinit is used to load a DSSI or LADSPA plugin into memory for+-- use with the other dssi4cs opcodes. Both LADSPA effects and DSSI+-- instruments can be used.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dssiinit.html>+ +dssiinit :: [Irate] -> Irate -> Irate -> Irate+dssiinit i0init i1libraryname i2plugindex = opcode "dssiinit" args+ where args = [to i1libraryname, to i2plugindex] ++ map to i0init+++-- | * opcode : dssiactivate+-- +-- +-- * syntax : +-- +-- > dssiactivate ihandle, ktoggle+-- +-- +-- * description : +-- +-- dssiactivate is used to activate or deactivate a DSSI or LADSPA+-- plugin. It calles the plugin's activate() and deactivate()+-- functions if they are provided.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dssiactivate.html>+ +dssiactivate :: (K k0) => Irate -> k0 -> SignalOut+dssiactivate i0handle k1toggle = outOpcode "dssiactivate" args+ where args = [to i0handle, to k1toggle]+++-- | * opcode : dssilist+-- +-- +-- * syntax : +-- +-- > dssilist+-- +-- +-- * description : +-- +-- dssilist checks the variables DSSI_PATH and LADSPA_PATH and+-- lists all plugins available in all plugin libraries there.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dssilist.html>+ +dssilist :: SignalOut+dssilist = outOpcode "dssilist" args+ where args = []+++-- | * opcode : dssiaudio+-- +-- +-- * syntax : +-- +-- > aout1 [, aout2, aout3, aout4] dssiaudio ihandle, ain1 [,ain2, ain3, ain4]+-- +-- +-- * description : +-- +-- dssiaudio generates audio by processing an input signal through+-- a LADSPA plugin.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dssiaudio.html>+ +dssiaudio :: [Arate] -> Irate -> Arate -> MultiOut+dssiaudio a0init i1handle a2in1 = opcode "dssiaudio" args+ where args = [to i1handle, to a2in1] ++ map to a0init+++-- | * opcode : dssictls+-- +-- +-- * syntax : +-- +-- > dssictls ihandle, iport, kvalue, ktrigger+-- +-- +-- * description : +-- +-- dssictls sends control values to a plugin's control port+-- +-- +-- * url : <http://www.csounds.com/manual/html/dssictls.html>+ +dssictls :: (K k0, K k1) => Irate -> Irate -> k0 -> k1 -> SignalOut+dssictls i0handle i1port k2value k3trigger+ = outOpcode "dssictls" args+ where args = [to i0handle, to i1port, to k2value, to k3trigger]
+ src/CsoundExpr/Opcodes/Plugin/Vst4cs.hs view
@@ -0,0 +1,174 @@+-- | VST for Csound+module CsoundExpr.Opcodes.Plugin.Vst4cs+ (vstinit,+ vstmidiout,+ vstnote,+ vstinfo,+ vstbankload,+ vstprogset,+ vstedit)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : vstinit+-- +-- +-- * syntax : +-- +-- > instance vstinit ilibrarypath [,iverbose]+-- +-- +-- * description : +-- +-- vstinit is used to load a VST plugin into memory for use with+-- the other vst4cs opcodes. Both VST effects and instruments+-- (synthesizers) can be used.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vstinit.html>+ +vstinit :: [Irate] -> Irate -> Irate+vstinit i0init i1librarypath = opcode "vstinit" args+ where args = [to i1librarypath] ++ map to i0init+++-- | * opcode : vstmidiout+-- +-- +-- * syntax : +-- +-- > vstmidiout instance, kstatus, kchan, kdata1, kdata2+-- +-- +-- * description : +-- +-- vstmidiout is used for sending MIDI information to a VST plugin.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vstmidiout.html>+ +vstmidiout ::+ (K k0, K k1, K k2, K k3) =>+ Irate -> k0 -> k1 -> k2 -> k3 -> SignalOut+vstmidiout i0nstance k1status k2chan k3data1 k4data2+ = outOpcode "vstmidiout" args+ where args+ = [to i0nstance, to k1status, to k2chan, to k3data1, to k4data2]+++-- | * opcode : vstnote+-- +-- +-- * syntax : +-- +-- > vstnote instance, kchan, knote, kveloc, kdur+-- +-- +-- * description : +-- +-- vstnote sends a MIDI note with definite duration to a VST+-- plugin.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vstnote.html>+ +vstnote ::+ (K k0, K k1, K k2, K k3) =>+ Irate -> k0 -> k1 -> k2 -> k3 -> SignalOut+vstnote i0nstance k1chan k2note k3veloc k4dur+ = outOpcode "vstnote" args+ where args+ = [to i0nstance, to k1chan, to k2note, to k3veloc, to k4dur]+++-- | * opcode : vstinfo+-- +-- +-- * syntax : +-- +-- > vstinfo instance+-- +-- +-- * description : +-- +-- vstinfo displays the parameters and the programs of a VST+-- plugin.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vstinfo.html>+ +vstinfo :: Irate -> SignalOut+vstinfo i0nstance = outOpcode "vstinfo" args+ where args = [to i0nstance]+++-- | * opcode : vstbankload+-- +-- +-- * syntax : +-- +-- > vstbankload instance, ipath+-- +-- +-- * description : +-- +-- vstbankload is used for loading parameter banks to a VST plugin.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vstbankload.html>+ +vstbankload :: Irate -> Irate -> SignalOut+vstbankload i0nstance i1path = outOpcode "vstbankload" args+ where args = [to i0nstance, to i1path]+++-- | * opcode : vstprogset+-- +-- +-- * syntax : +-- +-- > vstprogset instance, kprogram+-- +-- +-- * description : +-- +-- vstprogset sets one of the programs in an .fxb bank.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vstprogset.html>+ +vstprogset :: (K k0) => Irate -> k0 -> SignalOut+vstprogset i0nstance k1program = outOpcode "vstprogset" args+ where args = [to i0nstance, to k1program]+++-- | * opcode : vstedit+-- +-- +-- * syntax : +-- +-- > vstedit instance+-- +-- +-- * description : +-- +-- vstedit opens the custom GUI editor widow for a VST plugin. Note+-- that not all VST plugins have custom GUI editors. It may be+-- necessary to use the --displays command-line option to ensure+-- that Csound handles events from the editor window and displays it+-- properly.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vstedit.html>+ +vstedit :: Irate -> SignalOut+vstedit i0nstance = outOpcode "vstedit" args+ where args = [to i0nstance]
+ src/CsoundExpr/Opcodes/Siggen.hs view
@@ -0,0 +1,38 @@+-- | Signal Generators+module CsoundExpr.Opcodes.Siggen+ (module CsoundExpr.Opcodes.Siggen.Additive,+ module CsoundExpr.Opcodes.Siggen.Basic,+ module CsoundExpr.Opcodes.Siggen.Dynamic,+ module CsoundExpr.Opcodes.Siggen.Fmsynth,+ module CsoundExpr.Opcodes.Siggen.Granular,+ module CsoundExpr.Opcodes.Siggen.Hvs,+ module CsoundExpr.Opcodes.Siggen.Lineexp,+ module CsoundExpr.Opcodes.Siggen.Envelope,+ module CsoundExpr.Opcodes.Siggen.Models,+ module CsoundExpr.Opcodes.Siggen.Phasors,+ module CsoundExpr.Opcodes.Siggen.Noise,+ module CsoundExpr.Opcodes.Siggen.Sample,+ module CsoundExpr.Opcodes.Siggen.ScanTop,+ module CsoundExpr.Opcodes.Siggen.Tableacc,+ module CsoundExpr.Opcodes.Siggen.Waveterr,+ module CsoundExpr.Opcodes.Siggen.Wavguide)+where++++import CsoundExpr.Opcodes.Siggen.Additive+import CsoundExpr.Opcodes.Siggen.Basic+import CsoundExpr.Opcodes.Siggen.Dynamic+import CsoundExpr.Opcodes.Siggen.Fmsynth+import CsoundExpr.Opcodes.Siggen.Granular+import CsoundExpr.Opcodes.Siggen.Hvs+import CsoundExpr.Opcodes.Siggen.Lineexp+import CsoundExpr.Opcodes.Siggen.Envelope+import CsoundExpr.Opcodes.Siggen.Models+import CsoundExpr.Opcodes.Siggen.Phasors+import CsoundExpr.Opcodes.Siggen.Noise+import CsoundExpr.Opcodes.Siggen.Sample+import CsoundExpr.Opcodes.Siggen.ScanTop+import CsoundExpr.Opcodes.Siggen.Tableacc+import CsoundExpr.Opcodes.Siggen.Waveterr+import CsoundExpr.Opcodes.Siggen.Wavguide
+ src/CsoundExpr/Opcodes/Siggen/Additive.hs view
@@ -0,0 +1,117 @@+-- | Additive Synthesis/Resynthesis+module CsoundExpr.Opcodes.Siggen.Additive+ (adsyn,+ adsynt,+ adsynt2,+ hsboscil)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : adsyn+-- +-- +-- * syntax : +-- +-- > ares adsyn kamod, kfmod, ksmod, ifilcod+-- +-- +-- * description : +-- +-- Output is an additive set of individually controlled sinusoids,+-- using an oscillator bank.+-- +-- +-- * url : <http://www.csounds.com/manual/html/adsyn.html>+ +adsyn :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> String -> Arate+adsyn k0amod k1fmod k2smod s3file = opcode "adsyn" args+ where args = [to k0amod, to k1fmod, to k2smod, to s3file]+++-- | * opcode : adsynt+-- +-- +-- * syntax : +-- +-- > ares adsynt kamp, kcps, iwfn, ifreqfn, iampfn, icnt [, iphs]+-- +-- +-- * description : +-- +-- Performs additive synthesis with an arbitrary number of+-- partials, not necessarily harmonic.+-- +-- +-- * url : <http://www.csounds.com/manual/html/adsynt.html>+ +adsynt ::+ (K k0, K k1) =>+ [Irate] -> k0 -> k1 -> Irate -> Irate -> Irate -> Irate -> Arate+adsynt i0init k1amp k2cps i3wfn i4freqfn i5ampfn i6cnt+ = opcode "adsynt" args+ where args+ = [to k1amp, to k2cps, to i3wfn, to i4freqfn, to i5ampfn, to i6cnt]+ ++ map to i0init+++-- | * opcode : adsynt2+-- +-- +-- * syntax : +-- +-- > ar adsynt2 kamp, kcps, iwfn, ifreqfn, iampfn, icnt [, iphs]+-- +-- +-- * description : +-- +-- Performs additive synthesis with an arbitrary number of+-- partials, not necessarily harmonic. (see adsynt for detailed+-- manual)+-- +-- +-- * url : <http://www.csounds.com/manual/html/adsynt2.html>+ +adsynt2 ::+ (K k0, K k1) =>+ [Irate] -> k0 -> k1 -> Irate -> Irate -> Irate -> Irate -> Arate+adsynt2 i0init k1amp k2cps i3wfn i4freqfn i5ampfn i6cnt+ = opcode "adsynt2" args+ where args+ = [to k1amp, to k2cps, to i3wfn, to i4freqfn, to i5ampfn, to i6cnt]+ ++ map to i0init+++-- | * opcode : hsboscil+-- +-- +-- * syntax : +-- +-- > ares hsboscil kamp, ktone, kbrite, ibasfreq, iwfn, ioctfn +-- > [, ioctcnt] [, iphs]+-- +-- +-- * description : +-- +-- An oscillator which takes tonality and brightness as arguments,+-- relative to a base frequency.+-- +-- +-- * url : <http://www.csounds.com/manual/html/hsboscil.html>+ +hsboscil ::+ (K k0, K k1, K k2) =>+ [Irate] -> k0 -> k1 -> k2 -> Irate -> Irate -> Irate -> Arate+hsboscil i0init k1amp k2tone k3brite i4basfreq i5wfn i6octfn+ = opcode "hsboscil" args+ where args+ = [to k1amp, to k2tone, to k3brite, to i4basfreq, to i5wfn,+ to i6octfn]+ ++ map to i0init
+ src/CsoundExpr/Opcodes/Siggen/Basic.hs view
@@ -0,0 +1,661 @@+-- | Basic Oscillators+module CsoundExpr.Opcodes.Siggen.Basic+ (oscbnk,+ oscilA,+ oscilK,+ oscil3A,+ oscil3K,+ osciliA,+ osciliK,+ oscils,+ poscilAAA,+ poscilAAK,+ poscilAKA,+ poscilAKK,+ poscilI,+ poscilK,+ poscil3A,+ poscil3K,+ osciliktA,+ osciliktK,+ osciliktp,+ oscilikts,+ osciln,+ lfoA,+ lfoK,+ vibr,+ vibrato)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : oscbnk+-- +-- +-- * syntax : +-- +-- > ares oscbnk kcps, kamd, kfmd, kpmd, iovrlap, iseed, kl1minf, kl1maxf, +-- > kl2minf, kl2maxf, ilfomode, keqminf, keqmaxf, keqminl, keqmaxl, +-- > keqminq, keqmaxq, ieqmode, kfn [, il1fn] [, il2fn] [, ieqffn] +-- > [, ieqlfn] [, ieqqfn] [, itabl] [, ioutfn]+-- +-- +-- * description : +-- +-- This unit generator mixes the output of any number of+-- oscillators. The frequency, phase, and amplitude of each+-- oscillator can be modulated by two LFOs (all oscillators have a+-- separate set of LFOs, with different phase and frequency);+-- additionally, the output of each oscillator can be filtered+-- through an optional parametric equalizer (also controlled by the+-- LFOs). This opcode is most useful for rendering ensemble+-- (strings, choir, etc.) instruments.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscbnk.html>+ +oscbnk ::+ (K k0, K k1, K k2, K k3, K k4, K k5, K k6, K k7, K k8, K k9, K k10,+ K k11, K k12, K k13, K k14) =>+ [Irate] ->+ k0 ->+ k1 ->+ k2 ->+ k3 ->+ Irate ->+ Irate ->+ k4 ->+ k5 ->+ k6 ->+ k7 ->+ Irate ->+ k8 -> k9 -> k10 -> k11 -> k12 -> k13 -> Irate -> k14 -> Arate+oscbnk i0init k1cps k2amd k3fmd k4pmd i5ovrlap i6seed k7l1minf+ k8l1maxf k9l2minf k10l2maxf i11lfomode k12eqminf k13eqmaxf+ k14eqminl k15eqmaxl k16eqminq k17eqmaxq i18eqmode k19fn+ = opcode "oscbnk" args+ where args+ = [to k1cps, to k2amd, to k3fmd, to k4pmd, to i5ovrlap, to i6seed,+ to k7l1minf, to k8l1maxf, to k9l2minf, to k10l2maxf, to i11lfomode,+ to k12eqminf, to k13eqmaxf, to k14eqminl, to k15eqmaxl,+ to k16eqminq, to k17eqmaxq, to i18eqmode, to k19fn]+ ++ map to i0init+++-- | * opcode : oscil+-- +-- +-- * syntax : +-- +-- > ares oscil xamp, xcps, ifn [, iphs]+-- > kres oscil kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- oscil reads table ifn sequentially and repeatedly at a frequency+-- xcps. The amplitude is scaled by xamp.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscil.html>+ +oscilA :: (X x0, X x1) => [Irate] -> x0 -> x1 -> Irate -> Arate+oscilA i0init x1amp x2cps i3fn = opcode "oscil" args+ where args = [to x1amp, to x2cps, to i3fn] ++ map to i0init+++-- | * opcode : oscil+-- +-- +-- * syntax : +-- +-- > ares oscil xamp, xcps, ifn [, iphs]+-- > kres oscil kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- oscil reads table ifn sequentially and repeatedly at a frequency+-- xcps. The amplitude is scaled by xamp.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscil.html>+ +oscilK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Krate+oscilK i0init k1amp k2cps i3fn = opcode "oscil" args+ where args = [to k1amp, to k2cps, to i3fn] ++ map to i0init+++-- | * opcode : oscil3+-- +-- +-- * syntax : +-- +-- > ares oscil3 xamp, xcps, ifn [, iphs]+-- > kres oscil3 kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- oscil3 reads table ifn sequentially and repeatedly at a+-- frequency xcps. The amplitude is scaled by xamp. Cubic+-- interpolation is applied for table look up from internal phase+-- values.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscil3.html>+ +oscil3A :: (X x0, X x1) => [Irate] -> x0 -> x1 -> Irate -> Arate+oscil3A i0init x1amp x2cps i3fn = opcode "oscil3" args+ where args = [to x1amp, to x2cps, to i3fn] ++ map to i0init+++-- | * opcode : oscil3+-- +-- +-- * syntax : +-- +-- > ares oscil3 xamp, xcps, ifn [, iphs]+-- > kres oscil3 kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- oscil3 reads table ifn sequentially and repeatedly at a+-- frequency xcps. The amplitude is scaled by xamp. Cubic+-- interpolation is applied for table look up from internal phase+-- values.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscil3.html>+ +oscil3K :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Krate+oscil3K i0init k1amp k2cps i3fn = opcode "oscil3" args+ where args = [to k1amp, to k2cps, to i3fn] ++ map to i0init+++-- | * opcode : oscili+-- +-- +-- * syntax : +-- +-- > ares oscili xamp, xcps, ifn [, iphs]+-- > kres oscili kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- oscili reads table ifn sequentially and repeatedly at a+-- frequency xcps. The amplitude is scaled by xamp. Linear+-- interpolation is applied for table look up from internal phase+-- values.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscili.html>+ +osciliA :: (X x0, X x1) => [Irate] -> x0 -> x1 -> Irate -> Arate+osciliA i0init x1amp x2cps i3fn = opcode "oscili" args+ where args = [to x1amp, to x2cps, to i3fn] ++ map to i0init+++-- | * opcode : oscili+-- +-- +-- * syntax : +-- +-- > ares oscili xamp, xcps, ifn [, iphs]+-- > kres oscili kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- oscili reads table ifn sequentially and repeatedly at a+-- frequency xcps. The amplitude is scaled by xamp. Linear+-- interpolation is applied for table look up from internal phase+-- values.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscili.html>+ +osciliK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Krate+osciliK i0init k1amp k2cps i3fn = opcode "oscili" args+ where args = [to k1amp, to k2cps, to i3fn] ++ map to i0init+++-- | * opcode : oscils+-- +-- +-- * syntax : +-- +-- > ares oscils iamp, icps, iphs [, iflg]+-- +-- +-- * description : +-- +-- Simple, fast sine oscillator, that uses only one multiply, and+-- two add operations to generate one sample of output, and does not+-- require a function table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscils.html>+ +oscils :: [Irate] -> Irate -> Irate -> Irate -> Arate+oscils i0init i1amp i2cps i3phs = opcode "oscils" args+ where args = [to i1amp, to i2cps, to i3phs] ++ map to i0init+++-- | * opcode : poscil+-- +-- +-- * syntax : +-- +-- > ares poscil aamp, acps, ifn [, iphs]+-- > ares poscil aamp, kcps, ifn [, iphs]+-- > ares poscil kamp, acps, ifn [, iphs]+-- > ares poscil kamp, kcps, ifn [, iphs]+-- > ires poscil kamp, kcps, ifn [, iphs]+-- > kres poscil kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- High precision oscillator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poscil.html>+ +poscilAAA :: [Irate] -> Arate -> Arate -> Irate -> Arate+poscilAAA i0init a1amp a2cps i3fn = opcode "poscil" args+ where args = [to a1amp, to a2cps, to i3fn] ++ map to i0init+++-- | * opcode : poscil+-- +-- +-- * syntax : +-- +-- > ares poscil aamp, acps, ifn [, iphs]+-- > ares poscil aamp, kcps, ifn [, iphs]+-- > ares poscil kamp, acps, ifn [, iphs]+-- > ares poscil kamp, kcps, ifn [, iphs]+-- > ires poscil kamp, kcps, ifn [, iphs]+-- > kres poscil kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- High precision oscillator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poscil.html>+ +poscilAAK :: (K k0) => [Irate] -> Arate -> k0 -> Irate -> Arate+poscilAAK i0init a1amp k2cps i3fn = opcode "poscil" args+ where args = [to a1amp, to k2cps, to i3fn] ++ map to i0init+++-- | * opcode : poscil+-- +-- +-- * syntax : +-- +-- > ares poscil aamp, acps, ifn [, iphs]+-- > ares poscil aamp, kcps, ifn [, iphs]+-- > ares poscil kamp, acps, ifn [, iphs]+-- > ares poscil kamp, kcps, ifn [, iphs]+-- > ires poscil kamp, kcps, ifn [, iphs]+-- > kres poscil kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- High precision oscillator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poscil.html>+ +poscilAKA :: (K k0) => [Irate] -> k0 -> Arate -> Irate -> Arate+poscilAKA i0init k1amp a2cps i3fn = opcode "poscil" args+ where args = [to k1amp, to a2cps, to i3fn] ++ map to i0init+++-- | * opcode : poscil+-- +-- +-- * syntax : +-- +-- > ares poscil aamp, acps, ifn [, iphs]+-- > ares poscil aamp, kcps, ifn [, iphs]+-- > ares poscil kamp, acps, ifn [, iphs]+-- > ares poscil kamp, kcps, ifn [, iphs]+-- > ires poscil kamp, kcps, ifn [, iphs]+-- > kres poscil kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- High precision oscillator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poscil.html>+ +poscilAKK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Arate+poscilAKK i0init k1amp k2cps i3fn = opcode "poscil" args+ where args = [to k1amp, to k2cps, to i3fn] ++ map to i0init+++-- | * opcode : poscil+-- +-- +-- * syntax : +-- +-- > ares poscil aamp, acps, ifn [, iphs]+-- > ares poscil aamp, kcps, ifn [, iphs]+-- > ares poscil kamp, acps, ifn [, iphs]+-- > ares poscil kamp, kcps, ifn [, iphs]+-- > ires poscil kamp, kcps, ifn [, iphs]+-- > kres poscil kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- High precision oscillator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poscil.html>+ +poscilI :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Irate+poscilI i0init k1amp k2cps i3fn = opcode "poscil" args+ where args = [to k1amp, to k2cps, to i3fn] ++ map to i0init+++-- | * opcode : poscil+-- +-- +-- * syntax : +-- +-- > ares poscil aamp, acps, ifn [, iphs]+-- > ares poscil aamp, kcps, ifn [, iphs]+-- > ares poscil kamp, acps, ifn [, iphs]+-- > ares poscil kamp, kcps, ifn [, iphs]+-- > ires poscil kamp, kcps, ifn [, iphs]+-- > kres poscil kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- High precision oscillator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poscil.html>+ +poscilK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Krate+poscilK i0init k1amp k2cps i3fn = opcode "poscil" args+ where args = [to k1amp, to k2cps, to i3fn] ++ map to i0init+++-- | * opcode : poscil3+-- +-- +-- * syntax : +-- +-- > ares poscil3 kamp, kcps, ifn [, iphs]+-- > kres poscil3 kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- High precision oscillator with cubic interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poscil3.html>+ +poscil3A :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Arate+poscil3A i0init k1amp k2cps i3fn = opcode "poscil3" args+ where args = [to k1amp, to k2cps, to i3fn] ++ map to i0init+++-- | * opcode : poscil3+-- +-- +-- * syntax : +-- +-- > ares poscil3 kamp, kcps, ifn [, iphs]+-- > kres poscil3 kamp, kcps, ifn [, iphs]+-- +-- +-- * description : +-- +-- High precision oscillator with cubic interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poscil3.html>+ +poscil3K :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Krate+poscil3K i0init k1amp k2cps i3fn = opcode "poscil3" args+ where args = [to k1amp, to k2cps, to i3fn] ++ map to i0init+++-- | * opcode : oscilikt+-- +-- +-- * syntax : +-- +-- > ares oscilikt xamp, xcps, kfn [, iphs] [, istor]+-- > kres oscilikt kamp, kcps, kfn [, iphs] [, istor]+-- +-- +-- * description : +-- +-- oscilikt is very similar to oscili, but allows changing the+-- table number at k-rate. It is slightly slower than oscili+-- (especially with high control rate), although also more accurate+-- as it uses a 31-bit phase accumulator, as opposed to the 24-bit+-- one used by oscili.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscilikt.html>+ +osciliktA ::+ (X x0, X x1, K k0) => [Irate] -> x0 -> x1 -> k0 -> Arate+osciliktA i0init x1amp x2cps k3fn = opcode "oscilikt" args+ where args = [to x1amp, to x2cps, to k3fn] ++ map to i0init+++-- | * opcode : oscilikt+-- +-- +-- * syntax : +-- +-- > ares oscilikt xamp, xcps, kfn [, iphs] [, istor]+-- > kres oscilikt kamp, kcps, kfn [, iphs] [, istor]+-- +-- +-- * description : +-- +-- oscilikt is very similar to oscili, but allows changing the+-- table number at k-rate. It is slightly slower than oscili+-- (especially with high control rate), although also more accurate+-- as it uses a 31-bit phase accumulator, as opposed to the 24-bit+-- one used by oscili.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscilikt.html>+ +osciliktK ::+ (K k0, K k1, K k2) => [Irate] -> k0 -> k1 -> k2 -> Krate+osciliktK i0init k1amp k2cps k3fn = opcode "oscilikt" args+ where args = [to k1amp, to k2cps, to k3fn] ++ map to i0init+++-- | * opcode : osciliktp+-- +-- +-- * syntax : +-- +-- > ares osciliktp kcps, kfn, kphs [, istor]+-- +-- +-- * description : +-- +-- osciliktp allows phase modulation (which is actually implemented+-- as k-rate frequency modulation, by differentiating phase input).+-- The disadvantage is that there is no amplitude control, and+-- frequency can be varied only at the control-rate. This opcode can+-- be faster or slower than oscilikt, depending on the control-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/osciliktp.html>+ +osciliktp ::+ (K k0, K k1, K k2) => [Irate] -> k0 -> k1 -> k2 -> Arate+osciliktp i0init k1cps k2fn k3phs = opcode "osciliktp" args+ where args = [to k1cps, to k2fn, to k3phs] ++ map to i0init+++-- | * opcode : oscilikts+-- +-- +-- * syntax : +-- +-- > ares oscilikts xamp, xcps, kfn, async, kphs [, istor]+-- +-- +-- * description : +-- +-- oscilikts is the same as oscilikt. Except it has a sync input+-- that can be used to re-initialize the oscillator to a k-rate+-- phase value. It is slower than oscilikt and osciliktp.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscilikts.html>+ +oscilikts ::+ (X x0, X x1, K k0, K k1) =>+ [Irate] -> x0 -> x1 -> k0 -> Arate -> k1 -> Arate+oscilikts i0init x1amp x2cps k3fn a4sync k5phs+ = opcode "oscilikts" args+ where args+ = [to x1amp, to x2cps, to k3fn, to a4sync, to k5phs] +++ map to i0init+++-- | * opcode : osciln+-- +-- +-- * syntax : +-- +-- > ares osciln kamp, ifrq, ifn, itimes+-- +-- +-- * description : +-- +-- Accesses table values at a user-defined frequency. This opcode+-- can also be written as oscilx.+-- +-- +-- * url : <http://www.csounds.com/manual/html/osciln.html>+ +osciln :: (K k0) => k0 -> Irate -> Irate -> Irate -> Arate+osciln k0amp i1frq i2fn i3times = opcode "osciln" args+ where args = [to k0amp, to i1frq, to i2fn, to i3times]+++-- | * opcode : lfo+-- +-- +-- * syntax : +-- +-- > kres lfo kamp, kcps [, itype]+-- > ares lfo kamp, kcps [, itype]+-- +-- +-- * description : +-- +-- A low frequency oscillator of various shapes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lfo.html>+ +lfoA :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Arate+lfoA i0init k1amp k2cps = opcode "lfo" args+ where args = [to k1amp, to k2cps] ++ map to i0init+++-- | * opcode : lfo+-- +-- +-- * syntax : +-- +-- > kres lfo kamp, kcps [, itype]+-- > ares lfo kamp, kcps [, itype]+-- +-- +-- * description : +-- +-- A low frequency oscillator of various shapes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lfo.html>+ +lfoK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Krate+lfoK i0init k1amp k2cps = opcode "lfo" args+ where args = [to k1amp, to k2cps] ++ map to i0init+++-- | * opcode : vibr+-- +-- +-- * syntax : +-- +-- > kout vibr kAverageAmp, kAverageFreq, ifn+-- +-- +-- * description : +-- +-- Easier-to-use user-controllable vibrato.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vibr.html>+ +vibr :: (K k0, K k1) => k0 -> k1 -> Irate -> Krate+vibr k0AverageAmp k1AverageFreq i2fn = opcode "vibr" args+ where args = [to k0AverageAmp, to k1AverageFreq, to i2fn]+++-- | * opcode : vibrato+-- +-- +-- * syntax : +-- +-- > kout vibrato kAverageAmp, kAverageFreq, kRandAmountAmp, +-- > kRandAmountFreq, kAmpMinRate, kAmpMaxRate, kcpsMinRate, +-- > kcpsMaxRate, ifn [, iphs]+-- +-- +-- * description : +-- +-- Generates a natural-sounding user-controllable vibrato.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vibrato.html>+ +vibrato ::+ (K k0, K k1, K k2, K k3, K k4, K k5, K k6, K k7) =>+ [Irate] ->+ k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> Irate -> Krate+vibrato i0init k1AverageAmp k2AverageFreq k3RandAmountAmp+ k4RandAmountFreq k5AmpMinRate k6AmpMaxRate k7cpsMinRate+ k8cpsMaxRate i9fn = opcode "vibrato" args+ where args+ = [to k1AverageAmp, to k2AverageFreq, to k3RandAmountAmp,+ to k4RandAmountFreq, to k5AmpMinRate, to k6AmpMaxRate,+ to k7cpsMinRate, to k8cpsMaxRate, to i9fn]+ ++ map to i0init
+ src/CsoundExpr/Opcodes/Siggen/Dynamic.hs view
@@ -0,0 +1,213 @@+-- | Dynamic Spectrum Oscillators+module CsoundExpr.Opcodes.Siggen.Dynamic+ (buzz,+ gbuzz,+ mpulse,+ vco,+ vco2,+ vco2init,+ vco2ft,+ vco2ift)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : buzz+-- +-- +-- * syntax : +-- +-- > ares buzz xamp, xcps, knh, ifn [, iphs]+-- +-- +-- * description : +-- +-- Output is a set of harmonically related sine partials.+-- +-- +-- * url : <http://www.csounds.com/manual/html/buzz.html>+ +buzz ::+ (X x0, X x1, K k0) => [Irate] -> x0 -> x1 -> k0 -> Irate -> Arate+buzz i0init x1amp x2cps k3nh i4fn = opcode "buzz" args+ where args+ = [to x1amp, to x2cps, to k3nh, to i4fn] ++ map to i0init+++-- | * opcode : gbuzz+-- +-- +-- * syntax : +-- +-- > ares gbuzz xamp, xcps, knh, klh, kmul, ifn [, iphs]+-- +-- +-- * description : +-- +-- Output is a set of harmonically related cosine partials.+-- +-- +-- * url : <http://www.csounds.com/manual/html/gbuzz.html>+ +gbuzz ::+ (X x0, X x1, K k0, K k1, K k2) =>+ [Irate] -> x0 -> x1 -> k0 -> k1 -> k2 -> Irate -> Arate+gbuzz i0init x1amp x2cps k3nh k4lh k5mul i6fn = opcode "gbuzz" args+ where args+ = [to x1amp, to x2cps, to k3nh, to k4lh, to k5mul, to i6fn] +++ map to i0init+++-- | * opcode : mpulse+-- +-- +-- * syntax : +-- +-- > ares mpulse kamp, kintvl [, ioffset]+-- +-- +-- * description : +-- +-- Generates a set of impulses of amplitude kamp separated by+-- kintvl seconds (or samples if kintvl is negative). The first+-- impulse is generated after a delay of ioffset seconds.+-- +-- +-- * url : <http://www.csounds.com/manual/html/mpulse.html>+ +mpulse :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Arate+mpulse i0init k1amp k2intvl = opcode "mpulse" args+ where args = [to k1amp, to k2intvl] ++ map to i0init+++-- | * opcode : vco+-- +-- +-- * syntax : +-- +-- > ares vco xamp, xcps, iwave, kpw [, ifn] [, imaxd] [, ileak] [, inyx] +-- > [, iphs] [, iskip]+-- +-- +-- * description : +-- +-- Implementation of a band limited, analog modeled oscillator,+-- based on integration of band limited impulses. vco can be used to+-- simulate a variety of analog wave forms.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vco.html>+ +vco ::+ (X x0, X x1, K k0) => [Irate] -> x0 -> x1 -> Irate -> k0 -> Arate+vco i0init x1amp x2cps i3wave k4pw = opcode "vco" args+ where args+ = [to x1amp, to x2cps, to i3wave, to k4pw] ++ map to i0init+++-- | * opcode : vco2+-- +-- +-- * syntax : +-- +-- > ares vco2 kamp, kcps [, imode] [, kpw] [, kphs] [, inyx]+-- +-- +-- * description : +-- +-- vco2 is similar to vco. But the implementation uses+-- pre-calculated tables of band-limited waveforms (see also GEN30)+-- rather than integrating impulses. This opcode can be faster than+-- vco (especially if a low control-rate is used) and also allows+-- better sound quality. Additionally, there are more waveforms and+-- oscillator phase can be modulated at k-rate. The disadvantage is+-- increased memory usage. For more details about vco2 tables, see+-- also vco2init and vco2ft.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vco2.html>+ +vco2 ::+ (K k0, K k1, K k2) =>+ [Irate] -> [k0] -> [Irate] -> k1 -> k2 -> Arate+vco2 i0init k1init i2init k3amp k4cps = opcode "vco2" args+ where args+ = [to k3amp, to k4cps] ++ map to i0init ++ map to k1init +++ map to i2init+++-- | * opcode : vco2init+-- +-- +-- * syntax : +-- +-- > ifn vco2init iwave [, ibasfn] [, ipmul] [, iminsiz] [, imaxsiz] [, isrcft]+-- +-- +-- * description : +-- +-- vco2init calculates tables for use by vco2 opcode. Optionally,+-- it is also possible to access these tables as standard Csound+-- function tables. In this case, vco2ft can be used to find the+-- correct table number for a given oscillator frequency.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vco2init.html>+ +vco2init :: [Irate] -> Irate -> Irate+vco2init i0init i1wave = opcode "vco2init" args+ where args = [to i1wave] ++ map to i0init+++-- | * opcode : vco2ft+-- +-- +-- * syntax : +-- +-- > kfn vco2ft kcps, iwave [, inyx]+-- +-- +-- * description : +-- +-- vco2ft returns the function table number to be used for+-- generating the specified waveform at a given frequency. This+-- function table number can be used by any Csound opcode that+-- generates a signal by reading function tables (like oscilikt).+-- The tables must be calculated by vco2init before vco2ft is called+-- and shared as Csound ftables (ibasfn).+-- +-- +-- * url : <http://www.csounds.com/manual/html/vco2ft.html>+ +vco2ft :: (K k0) => [Irate] -> k0 -> Irate -> Krate+vco2ft i0init k1cps i2wave = opcode "vco2ft" args+ where args = [to k1cps, to i2wave] ++ map to i0init+++-- | * opcode : vco2ift+-- +-- +-- * syntax : +-- +-- > ifn vco2ift icps, iwave [, inyx]+-- +-- +-- * description : +-- +-- vco2ift is the same as vco2ft, but works at i-time. It is+-- suitable for use with opcodes that expect an i-rate table number+-- (for example, oscili).+-- +-- +-- * url : <http://www.csounds.com/manual/html/vco2ift.html>+ +vco2ift :: [Irate] -> Irate -> Irate -> Irate+vco2ift i0init i1cps i2wave = opcode "vco2ift" args+ where args = [to i1cps, to i2wave] ++ map to i0init
+ src/CsoundExpr/Opcodes/Siggen/Envelope.hs view
@@ -0,0 +1,409 @@+-- | Envelope Generators+module CsoundExpr.Opcodes.Siggen.Envelope+ (adsrA,+ adsrK,+ madsrA,+ madsrK,+ mxadsrA,+ mxadsrK,+ xadsrA,+ xadsrK,+ linenA,+ linenK,+ linenrA,+ linenrK,+ envlpxA,+ envlpxK,+ envlpxrA,+ envlpxrK)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : adsr+-- +-- +-- * syntax : +-- +-- > ares adsr iatt, idec, islev, irel [, idel]+-- > kres adsr iatt, idec, islev, irel [, idel]+-- +-- +-- * description : +-- +-- Calculates the classical ADSR envelope using linear segments.+-- +-- +-- * url : <http://www.csounds.com/manual/html/adsr.html>+ +adsrA :: [Irate] -> Irate -> Irate -> Irate -> Irate -> Arate+adsrA i0init i1att i2dec i3slev i4rel = opcode "adsr" args+ where args+ = [to i1att, to i2dec, to i3slev, to i4rel] ++ map to i0init+++-- | * opcode : adsr+-- +-- +-- * syntax : +-- +-- > ares adsr iatt, idec, islev, irel [, idel]+-- > kres adsr iatt, idec, islev, irel [, idel]+-- +-- +-- * description : +-- +-- Calculates the classical ADSR envelope using linear segments.+-- +-- +-- * url : <http://www.csounds.com/manual/html/adsr.html>+ +adsrK :: [Irate] -> Irate -> Irate -> Irate -> Irate -> Krate+adsrK i0init i1att i2dec i3slev i4rel = opcode "adsr" args+ where args+ = [to i1att, to i2dec, to i3slev, to i4rel] ++ map to i0init+++-- | * opcode : madsr+-- +-- +-- * syntax : +-- +-- > ares madsr iatt, idec, islev, irel [, idel] [, ireltim]+-- > kres madsr iatt, idec, islev, irel [, idel] [, ireltim]+-- +-- +-- * description : +-- +-- Calculates the classical ADSR envelope using the linsegr+-- mechanism.+-- +-- +-- * url : <http://www.csounds.com/manual/html/madsr.html>+ +madsrA :: [Irate] -> Irate -> Irate -> Irate -> Irate -> Arate+madsrA i0init i1att i2dec i3slev i4rel = opcode "madsr" args+ where args+ = [to i1att, to i2dec, to i3slev, to i4rel] ++ map to i0init+++-- | * opcode : madsr+-- +-- +-- * syntax : +-- +-- > ares madsr iatt, idec, islev, irel [, idel] [, ireltim]+-- > kres madsr iatt, idec, islev, irel [, idel] [, ireltim]+-- +-- +-- * description : +-- +-- Calculates the classical ADSR envelope using the linsegr+-- mechanism.+-- +-- +-- * url : <http://www.csounds.com/manual/html/madsr.html>+ +madsrK :: [Irate] -> Irate -> Irate -> Irate -> Irate -> Krate+madsrK i0init i1att i2dec i3slev i4rel = opcode "madsr" args+ where args+ = [to i1att, to i2dec, to i3slev, to i4rel] ++ map to i0init+++-- | * opcode : mxadsr+-- +-- +-- * syntax : +-- +-- > ares mxadsr iatt, idec, islev, irel [, idel] [, ireltim]+-- > kres mxadsr iatt, idec, islev, irel [, idel] [, ireltim]+-- +-- +-- * description : +-- +-- Calculates the classical ADSR envelope using the expsegr+-- mechanism.+-- +-- +-- * url : <http://www.csounds.com/manual/html/mxadsr.html>+ +mxadsrA :: [Irate] -> Irate -> Irate -> Irate -> Irate -> Arate+mxadsrA i0init i1att i2dec i3slev i4rel = opcode "mxadsr" args+ where args+ = [to i1att, to i2dec, to i3slev, to i4rel] ++ map to i0init+++-- | * opcode : mxadsr+-- +-- +-- * syntax : +-- +-- > ares mxadsr iatt, idec, islev, irel [, idel] [, ireltim]+-- > kres mxadsr iatt, idec, islev, irel [, idel] [, ireltim]+-- +-- +-- * description : +-- +-- Calculates the classical ADSR envelope using the expsegr+-- mechanism.+-- +-- +-- * url : <http://www.csounds.com/manual/html/mxadsr.html>+ +mxadsrK :: [Irate] -> Irate -> Irate -> Irate -> Irate -> Krate+mxadsrK i0init i1att i2dec i3slev i4rel = opcode "mxadsr" args+ where args+ = [to i1att, to i2dec, to i3slev, to i4rel] ++ map to i0init+++-- | * opcode : xadsr+-- +-- +-- * syntax : +-- +-- > ares xadsr iatt, idec, islev, irel [, idel]+-- > kres xadsr iatt, idec, islev, irel [, idel]+-- +-- +-- * description : +-- +-- Calculates the classical ADSR envelope+-- +-- +-- * url : <http://www.csounds.com/manual/html/xadsr.html>+ +xadsrA :: [Irate] -> Irate -> Irate -> Irate -> Irate -> Arate+xadsrA i0init i1att i2dec i3slev i4rel = opcode "xadsr" args+ where args+ = [to i1att, to i2dec, to i3slev, to i4rel] ++ map to i0init+++-- | * opcode : xadsr+-- +-- +-- * syntax : +-- +-- > ares xadsr iatt, idec, islev, irel [, idel]+-- > kres xadsr iatt, idec, islev, irel [, idel]+-- +-- +-- * description : +-- +-- Calculates the classical ADSR envelope+-- +-- +-- * url : <http://www.csounds.com/manual/html/xadsr.html>+ +xadsrK :: [Irate] -> Irate -> Irate -> Irate -> Irate -> Krate+xadsrK i0init i1att i2dec i3slev i4rel = opcode "xadsr" args+ where args+ = [to i1att, to i2dec, to i3slev, to i4rel] ++ map to i0init+++-- | * opcode : linen+-- +-- +-- * syntax : +-- +-- > ares linen xamp, irise, idur, idec+-- > kres linen kamp, irise, idur, idec+-- +-- +-- * description : +-- +-- linen -- apply a straight line rise and decay pattern to an+-- input amp signal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linen.html>+ +linenA :: (X x0) => x0 -> Irate -> Irate -> Irate -> Arate+linenA x0amp i1rise i2dur i3dec = opcode "linen" args+ where args = [to x0amp, to i1rise, to i2dur, to i3dec]+++-- | * opcode : linen+-- +-- +-- * syntax : +-- +-- > ares linen xamp, irise, idur, idec+-- > kres linen kamp, irise, idur, idec+-- +-- +-- * description : +-- +-- linen -- apply a straight line rise and decay pattern to an+-- input amp signal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linen.html>+ +linenK :: (K k0) => k0 -> Irate -> Irate -> Irate -> Krate+linenK k0amp i1rise i2dur i3dec = opcode "linen" args+ where args = [to k0amp, to i1rise, to i2dur, to i3dec]+++-- | * opcode : linenr+-- +-- +-- * syntax : +-- +-- > ares linenr xamp, irise, idec, iatdec+-- > kres linenr kamp, irise, idec, iatdec+-- +-- +-- * description : +-- +-- linenr -- same as linen except that the final segment is entered+-- only on sensing a MIDI note release. The note is then extended by+-- the decay time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linenr.html>+ +linenrA :: (X x0) => x0 -> Irate -> Irate -> Irate -> Arate+linenrA x0amp i1rise i2dec i3atdec = opcode "linenr" args+ where args = [to x0amp, to i1rise, to i2dec, to i3atdec]+++-- | * opcode : linenr+-- +-- +-- * syntax : +-- +-- > ares linenr xamp, irise, idec, iatdec+-- > kres linenr kamp, irise, idec, iatdec+-- +-- +-- * description : +-- +-- linenr -- same as linen except that the final segment is entered+-- only on sensing a MIDI note release. The note is then extended by+-- the decay time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linenr.html>+ +linenrK :: (K k0) => k0 -> Irate -> Irate -> Irate -> Krate+linenrK k0amp i1rise i2dec i3atdec = opcode "linenr" args+ where args = [to k0amp, to i1rise, to i2dec, to i3atdec]+++-- | * opcode : envlpx+-- +-- +-- * syntax : +-- +-- > ares envlpx xamp, irise, idur, idec, ifn, iatss, iatdec [, ixmod]+-- > kres envlpx kamp, irise, idur, idec, ifn, iatss, iatdec [, ixmod]+-- +-- +-- * description : +-- +-- envlpx -- apply an envelope consisting of 3 segments:+-- +-- +-- * url : <http://www.csounds.com/manual/html/envlpx.html>+ +envlpxA ::+ (X x0) =>+ [Irate] ->+ x0 -> Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> Arate+envlpxA i0init x1amp i2rise i3dur i4dec i5fn i6atss i7atdec+ = opcode "envlpx" args+ where args+ = [to x1amp, to i2rise, to i3dur, to i4dec, to i5fn, to i6atss,+ to i7atdec]+ ++ map to i0init+++-- | * opcode : envlpx+-- +-- +-- * syntax : +-- +-- > ares envlpx xamp, irise, idur, idec, ifn, iatss, iatdec [, ixmod]+-- > kres envlpx kamp, irise, idur, idec, ifn, iatss, iatdec [, ixmod]+-- +-- +-- * description : +-- +-- envlpx -- apply an envelope consisting of 3 segments:+-- +-- +-- * url : <http://www.csounds.com/manual/html/envlpx.html>+ +envlpxK ::+ (K k0) =>+ [Irate] ->+ k0 -> Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> Krate+envlpxK i0init k1amp i2rise i3dur i4dec i5fn i6atss i7atdec+ = opcode "envlpx" args+ where args+ = [to k1amp, to i2rise, to i3dur, to i4dec, to i5fn, to i6atss,+ to i7atdec]+ ++ map to i0init+++-- | * opcode : envlpxr+-- +-- +-- * syntax : +-- +-- > ares envlpxr xamp, irise, idec, ifn, iatss, iatdec [, ixmod] [,irind]+-- > kres envlpxr kamp, irise, idec, ifn, iatss, iatdec [, ixmod] [,irind]+-- +-- +-- * description : +-- +-- envlpxr is the same as envlpx except that the final segment is+-- entered only on sensing a MIDI note release. The note is then+-- extended by the decay time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/envlpxr.html>+ +envlpxrA ::+ (X x0) =>+ [Irate] -> x0 -> Irate -> Irate -> Irate -> Irate -> Irate -> Arate+envlpxrA i0init x1amp i2rise i3dec i4fn i5atss i6atdec+ = opcode "envlpxr" args+ where args+ = [to x1amp, to i2rise, to i3dec, to i4fn, to i5atss, to i6atdec]+ ++ map to i0init+++-- | * opcode : envlpxr+-- +-- +-- * syntax : +-- +-- > ares envlpxr xamp, irise, idec, ifn, iatss, iatdec [, ixmod] [,irind]+-- > kres envlpxr kamp, irise, idec, ifn, iatss, iatdec [, ixmod] [,irind]+-- +-- +-- * description : +-- +-- envlpxr is the same as envlpx except that the final segment is+-- entered only on sensing a MIDI note release. The note is then+-- extended by the decay time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/envlpxr.html>+ +envlpxrK ::+ (K k0) =>+ [Irate] -> k0 -> Irate -> Irate -> Irate -> Irate -> Irate -> Krate+envlpxrK i0init k1amp i2rise i3dec i4fn i5atss i6atdec+ = opcode "envlpxr" args+ where args+ = [to k1amp, to i2rise, to i3dec, to i4fn, to i5atss, to i6atdec]+ ++ map to i0init
+ src/CsoundExpr/Opcodes/Siggen/Fmsynth.hs view
@@ -0,0 +1,491 @@+-- | FM Synthesis+module CsoundExpr.Opcodes.Siggen.Fmsynth+ (foscil,+ foscili,+ crossfm,+ crossfmi,+ crosspm,+ crosspmi,+ crossfmpm,+ crossfmpmi,+ fmb3,+ fmbell,+ fmmetal,+ fmpercfl,+ fmrhode,+ fmvoice,+ fmwurlie)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : foscil+-- +-- +-- * syntax : +-- +-- > ares foscil xamp, kcps, xcar, xmod, kndx, ifn [, iphs]+-- +-- +-- * description : +-- +-- A basic frequency modulated oscillator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/foscil.html>+ +foscil ::+ (X x0, K k0, X x1, X x2, K k1) =>+ [Irate] -> x0 -> k0 -> x1 -> x2 -> k1 -> Irate -> Arate+foscil i0init x1amp k2cps x3car x4mod k5ndx i6fn+ = opcode "foscil" args+ where args+ = [to x1amp, to k2cps, to x3car, to x4mod, to k5ndx, to i6fn] +++ map to i0init+++-- | * opcode : foscili+-- +-- +-- * syntax : +-- +-- > ares foscili xamp, kcps, xcar, xmod, kndx, ifn [, iphs]+-- +-- +-- * description : +-- +-- Basic frequency modulated oscillator with linear interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/foscili.html>+ +foscili ::+ (X x0, K k0, X x1, X x2, K k1) =>+ [Irate] -> x0 -> k0 -> x1 -> x2 -> k1 -> Irate -> Arate+foscili i0init x1amp k2cps x3car x4mod k5ndx i6fn+ = opcode "foscili" args+ where args+ = [to x1amp, to k2cps, to x3car, to x4mod, to k5ndx, to i6fn] +++ map to i0init+++-- | * opcode : crossfm+-- +-- +-- * syntax : +-- +-- > a1, a2 crossfm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crosspm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crosspmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmpm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmpmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- +-- +-- * description : +-- +-- Two oscillators, mutually frequency and/or phase modulated by+-- each other.+-- +-- +-- * url : <http://www.csounds.com/manual/html/crossfm.html>+ +crossfm ::+ (X x0, X x1, X x2, X x3, K k0) =>+ [Irate] -> x0 -> x1 -> x2 -> x3 -> k0 -> Irate -> Irate -> MultiOut+crossfm i0init x1frq1 x2frq2 x3ndx1 x4ndx2 k5cps i6fn1 i7fn2+ = opcode "crossfm" args+ where args+ = [to x1frq1, to x2frq2, to x3ndx1, to x4ndx2, to k5cps, to i6fn1,+ to i7fn2]+ ++ map to i0init+++-- | * opcode : crossfmi+-- +-- +-- * syntax : +-- +-- > a1, a2 crossfm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crosspm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crosspmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmpm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmpmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- +-- +-- * description : +-- +-- Two oscillators, mutually frequency and/or phase modulated by+-- each other.+-- +-- +-- * url : <http://www.csounds.com/manual/html/crossfm.html>+ +crossfmi ::+ (X x0, X x1, X x2, X x3, K k0) =>+ [Irate] -> x0 -> x1 -> x2 -> x3 -> k0 -> Irate -> Irate -> MultiOut+crossfmi i0init x1frq1 x2frq2 x3ndx1 x4ndx2 k5cps i6fn1 i7fn2+ = opcode "crossfmi" args+ where args+ = [to x1frq1, to x2frq2, to x3ndx1, to x4ndx2, to k5cps, to i6fn1,+ to i7fn2]+ ++ map to i0init+++-- | * opcode : crosspm+-- +-- +-- * syntax : +-- +-- > a1, a2 crossfm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crosspm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crosspmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmpm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmpmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- +-- +-- * description : +-- +-- Two oscillators, mutually frequency and/or phase modulated by+-- each other.+-- +-- +-- * url : <http://www.csounds.com/manual/html/crossfm.html>+ +crosspm ::+ (X x0, X x1, X x2, X x3, K k0) =>+ [Irate] -> x0 -> x1 -> x2 -> x3 -> k0 -> Irate -> Irate -> MultiOut+crosspm i0init x1frq1 x2frq2 x3ndx1 x4ndx2 k5cps i6fn1 i7fn2+ = opcode "crosspm" args+ where args+ = [to x1frq1, to x2frq2, to x3ndx1, to x4ndx2, to k5cps, to i6fn1,+ to i7fn2]+ ++ map to i0init+++-- | * opcode : crosspmi+-- +-- +-- * syntax : +-- +-- > a1, a2 crossfm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crosspm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crosspmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmpm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmpmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- +-- +-- * description : +-- +-- Two oscillators, mutually frequency and/or phase modulated by+-- each other.+-- +-- +-- * url : <http://www.csounds.com/manual/html/crossfm.html>+ +crosspmi ::+ (X x0, X x1, X x2, X x3, K k0) =>+ [Irate] -> x0 -> x1 -> x2 -> x3 -> k0 -> Irate -> Irate -> MultiOut+crosspmi i0init x1frq1 x2frq2 x3ndx1 x4ndx2 k5cps i6fn1 i7fn2+ = opcode "crosspmi" args+ where args+ = [to x1frq1, to x2frq2, to x3ndx1, to x4ndx2, to k5cps, to i6fn1,+ to i7fn2]+ ++ map to i0init+++-- | * opcode : crossfmpm+-- +-- +-- * syntax : +-- +-- > a1, a2 crossfm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crosspm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crosspmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmpm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmpmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- +-- +-- * description : +-- +-- Two oscillators, mutually frequency and/or phase modulated by+-- each other.+-- +-- +-- * url : <http://www.csounds.com/manual/html/crossfm.html>+ +crossfmpm ::+ (X x0, X x1, X x2, X x3, K k0) =>+ [Irate] -> x0 -> x1 -> x2 -> x3 -> k0 -> Irate -> Irate -> MultiOut+crossfmpm i0init x1frq1 x2frq2 x3ndx1 x4ndx2 k5cps i6fn1 i7fn2+ = opcode "crossfmpm" args+ where args+ = [to x1frq1, to x2frq2, to x3ndx1, to x4ndx2, to k5cps, to i6fn1,+ to i7fn2]+ ++ map to i0init+++-- | * opcode : crossfmpmi+-- +-- +-- * syntax : +-- +-- > a1, a2 crossfm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crosspm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crosspmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmpm xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- > a1, a2 crossfmpmi xfrq1, xfrq2, xndx1, xndx2, kcps, ifn1, ifn2 [, iphs1] [, iphs2]+-- +-- +-- * description : +-- +-- Two oscillators, mutually frequency and/or phase modulated by+-- each other.+-- +-- +-- * url : <http://www.csounds.com/manual/html/crossfm.html>+ +crossfmpmi ::+ (X x0, X x1, X x2, X x3, K k0) =>+ [Irate] -> x0 -> x1 -> x2 -> x3 -> k0 -> Irate -> Irate -> MultiOut+crossfmpmi i0init x1frq1 x2frq2 x3ndx1 x4ndx2 k5cps i6fn1 i7fn2+ = opcode "crossfmpmi" args+ where args+ = [to x1frq1, to x2frq2, to x3ndx1, to x4ndx2, to k5cps, to i6fn1,+ to i7fn2]+ ++ map to i0init+++-- | * opcode : fmb3+-- +-- +-- * syntax : +-- +-- > ares fmb3 kamp, kfreq, kc1, kc2, kvdepth, kvrate, ifn1, ifn2, ifn3, +-- > ifn4, ivfn+-- +-- +-- * description : +-- +-- Uses FM synthesis to create a Hammond B3 organ sound. It comes+-- from a family of FM sounds, all using 4 basic oscillators and+-- various architectures, as used in the TX81Z synthesizer.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fmb3.html>+ +fmb3 ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ k0 ->+ k1 ->+ k2 ->+ k3 ->+ k4 -> k5 -> Irate -> Irate -> Irate -> Irate -> Irate -> Arate+fmb3 k0amp k1freq k2c1 k3c2 k4vdepth k5vrate i6fn1 i7fn2 i8fn3+ i9fn4 i10vfn = opcode "fmb3" args+ where args+ = [to k0amp, to k1freq, to k2c1, to k3c2, to k4vdepth, to k5vrate,+ to i6fn1, to i7fn2, to i8fn3, to i9fn4, to i10vfn]+++-- | * opcode : fmbell+-- +-- +-- * syntax : +-- +-- > ares fmbell kamp, kfreq, kc1, kc2, kvdepth, kvrate, ifn1, ifn2, ifn3, +-- > ifn4, ivfn+-- +-- +-- * description : +-- +-- Uses FM synthesis to create a tublar bell sound. It comes from a+-- family of FM sounds, all using 4 basic oscillators and various+-- architectures, as used in the TX81Z synthesizer.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fmbell.html>+ +fmbell ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ k0 ->+ k1 ->+ k2 ->+ k3 ->+ k4 -> k5 -> Irate -> Irate -> Irate -> Irate -> Irate -> Arate+fmbell k0amp k1freq k2c1 k3c2 k4vdepth k5vrate i6fn1 i7fn2 i8fn3+ i9fn4 i10vfn = opcode "fmbell" args+ where args+ = [to k0amp, to k1freq, to k2c1, to k3c2, to k4vdepth, to k5vrate,+ to i6fn1, to i7fn2, to i8fn3, to i9fn4, to i10vfn]+++-- | * opcode : fmmetal+-- +-- +-- * syntax : +-- +-- > ares fmmetal kamp, kfreq, kc1, kc2, kvdepth, kvrate, ifn1, ifn2, ifn3, +-- > ifn4, ivfn+-- +-- +-- * description : +-- +-- Uses FM synthesis to create a Heavy Metal sound. It comes from a+-- family of FM sounds, all using 4 basic oscillators and various+-- architectures, as used in the TX81Z synthesizer.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fmmetal.html>+ +fmmetal ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ k0 ->+ k1 ->+ k2 ->+ k3 ->+ k4 -> k5 -> Irate -> Irate -> Irate -> Irate -> Irate -> Arate+fmmetal k0amp k1freq k2c1 k3c2 k4vdepth k5vrate i6fn1 i7fn2 i8fn3+ i9fn4 i10vfn = opcode "fmmetal" args+ where args+ = [to k0amp, to k1freq, to k2c1, to k3c2, to k4vdepth, to k5vrate,+ to i6fn1, to i7fn2, to i8fn3, to i9fn4, to i10vfn]+++-- | * opcode : fmpercfl+-- +-- +-- * syntax : +-- +-- > ares fmpercfl kamp, kfreq, kc1, kc2, kvdepth, kvrate, ifn1, ifn2, +-- > ifn3, ifn4, ivfn+-- +-- +-- * description : +-- +-- Uses FM synthesis to create a percussive flute sound. It comes+-- from a family of FM sounds, all using 4 basic oscillators and+-- various architectures, as used in the TX81Z synthesizer.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fmpercfl.html>+ +fmpercfl ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ k0 ->+ k1 ->+ k2 ->+ k3 ->+ k4 -> k5 -> Irate -> Irate -> Irate -> Irate -> Irate -> Arate+fmpercfl k0amp k1freq k2c1 k3c2 k4vdepth k5vrate i6fn1 i7fn2 i8fn3+ i9fn4 i10vfn = opcode "fmpercfl" args+ where args+ = [to k0amp, to k1freq, to k2c1, to k3c2, to k4vdepth, to k5vrate,+ to i6fn1, to i7fn2, to i8fn3, to i9fn4, to i10vfn]+++-- | * opcode : fmrhode+-- +-- +-- * syntax : +-- +-- > ares fmrhode kamp, kfreq, kc1, kc2, kvdepth, kvrate, ifn1, ifn2, +-- > ifn3, ifn4, ivfn+-- +-- +-- * description : +-- +-- Uses FM synthesis to create a Fender Rhodes electric piano+-- sound. It comes from a family of FM sounds, all using 4 basic+-- oscillators and various architectures, as used in the TX81Z+-- synthesizer.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fmrhode.html>+ +fmrhode ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ k0 ->+ k1 ->+ k2 ->+ k3 ->+ k4 -> k5 -> Irate -> Irate -> Irate -> Irate -> Irate -> Arate+fmrhode k0amp k1freq k2c1 k3c2 k4vdepth k5vrate i6fn1 i7fn2 i8fn3+ i9fn4 i10vfn = opcode "fmrhode" args+ where args+ = [to k0amp, to k1freq, to k2c1, to k3c2, to k4vdepth, to k5vrate,+ to i6fn1, to i7fn2, to i8fn3, to i9fn4, to i10vfn]+++-- | * opcode : fmvoice+-- +-- +-- * syntax : +-- +-- > ares fmvoice kamp, kfreq, kvowel, ktilt, kvibamt, kvibrate, ifn1, +-- > ifn2, ifn3, ifn4, ivibfn+-- +-- +-- * description : +-- +-- FM Singing Voice Synthesis+-- +-- +-- * url : <http://www.csounds.com/manual/html/fmvoice.html>+ +fmvoice ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ k0 ->+ k1 ->+ k2 ->+ k3 ->+ k4 -> k5 -> Irate -> Irate -> Irate -> Irate -> Irate -> Arate+fmvoice k0amp k1freq k2vowel k3tilt k4vibamt k5vibrate i6fn1 i7fn2+ i8fn3 i9fn4 i10vibfn = opcode "fmvoice" args+ where args+ = [to k0amp, to k1freq, to k2vowel, to k3tilt, to k4vibamt,+ to k5vibrate, to i6fn1, to i7fn2, to i8fn3, to i9fn4, to i10vibfn]+++-- | * opcode : fmwurlie+-- +-- +-- * syntax : +-- +-- > ares fmwurlie kamp, kfreq, kc1, kc2, kvdepth, kvrate, ifn1, ifn2, ifn3, +-- > ifn4, ivfn+-- +-- +-- * description : +-- +-- Uses FM synthesis to create a Wurlitzer electric piano sound. It+-- comes from a family of FM sounds, all using 4 basic oscillators+-- and various architectures, as used in the TX81Z synthesizer.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fmwurlie.html>+ +fmwurlie ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ k0 ->+ k1 ->+ k2 ->+ k3 ->+ k4 -> k5 -> Irate -> Irate -> Irate -> Irate -> Irate -> Arate+fmwurlie k0amp k1freq k2c1 k3c2 k4vdepth k5vrate i6fn1 i7fn2 i8fn3+ i9fn4 i10vfn = opcode "fmwurlie" args+ where args+ = [to k0amp, to k1freq, to k2c1, to k3c2, to k4vdepth, to k5vrate,+ to i6fn1, to i7fn2, to i8fn3, to i9fn4, to i10vfn]
+ src/CsoundExpr/Opcodes/Siggen/Granular.hs view
@@ -0,0 +1,588 @@+-- | Granular Synthesis+module CsoundExpr.Opcodes.Siggen.Granular+ (diskgrain,+ fof,+ fof2,+ fog,+ grain,+ grain2,+ grain3,+ granule,+ partikkel,+ partikkelsync,+ sndwarp,+ sndwarpst,+ syncgrain,+ syncloop,+ vosim)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : diskgrain+-- +-- +-- * syntax : +-- +-- > asig diskgrain Sfname, kamp, kfreq, kpitch, kgrsize, kprate, +-- > ifun, iolaps [,imaxgrsize, ioffset]+-- +-- +-- * description : +-- +-- diskgrain implements synchronous granular synthesis. The source+-- sound for the grains is obtained by reading a soundfile+-- containing the samples of the source waveform.+-- +-- +-- * url : <http://www.csounds.com/manual/html/diskgrain.html>+ +diskgrain ::+ (K k0, K k1, K k2, K k3, K k4) =>+ [Irate] ->+ String -> k0 -> k1 -> k2 -> k3 -> k4 -> Irate -> Irate -> Arate+diskgrain i0init s1fname k2amp k3freq k4pitch k5grsize k6prate+ i7fun i8olaps = opcode "diskgrain" args+ where args+ = [to s1fname, to k2amp, to k3freq, to k4pitch, to k5grsize,+ to k6prate, to i7fun, to i8olaps]+ ++ map to i0init+++-- | * opcode : fof+-- +-- +-- * syntax : +-- +-- > ares fof xamp, xfund, xform, koct, kband, kris, kdur, kdec, iolaps, +-- > ifna, ifnb, itotdur [, iphs] [, ifmode] [, iskip]+-- +-- +-- * description : +-- +-- Audio output is a succession of sinusoid bursts initiated at+-- frequency xfund with a spectral peak at xform. For xfund above 25+-- Hz these bursts produce a speech-like formant with spectral+-- characteristics determined by the k-input parameters. For lower+-- fundamentals this generator provides a special form of granular+-- synthesis.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fof.html>+ +fof ::+ (X x0, X x1, X x2, K k0, K k1, K k2, K k3, K k4) =>+ [Irate] ->+ x0 ->+ x1 ->+ x2 ->+ k0 ->+ k1 -> k2 -> k3 -> k4 -> Irate -> Irate -> Irate -> Irate -> Arate+fof i0init x1amp x2fund x3form k4oct k5band k6ris k7dur k8dec+ i9olaps i10fna i11fnb i12totdur = opcode "fof" args+ where args+ = [to x1amp, to x2fund, to x3form, to k4oct, to k5band, to k6ris,+ to k7dur, to k8dec, to i9olaps, to i10fna, to i11fnb, to i12totdur]+ ++ map to i0init+++-- | * opcode : fof2+-- +-- +-- * syntax : +-- +-- > ares fof2 xamp, xfund, xform, koct, kband, kris, kdur, kdec, iolaps, +-- > ifna, ifnb, itotdur, kphs, kgliss [, iskip]+-- +-- +-- * description : +-- +-- Audio output is a succession of sinusoid bursts initiated at+-- frequency xfund with a spectral peak at xform. For xfund above 25+-- Hz these bursts produce a speech-like formant with spectral+-- characteristics determined by the k-input parameters. For lower+-- fundamentals this generator provides a special form of granular+-- synthesis.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fof2.html>+ +fof2 ::+ (X x0, X x1, X x2, K k0, K k1, K k2, K k3, K k4, K k5, K k6) =>+ [Irate] ->+ x0 ->+ x1 ->+ x2 ->+ k0 ->+ k1 ->+ k2 ->+ k3 -> k4 -> Irate -> Irate -> Irate -> Irate -> k5 -> k6 -> Arate+fof2 i0init x1amp x2fund x3form k4oct k5band k6ris k7dur k8dec+ i9olaps i10fna i11fnb i12totdur k13phs k14gliss+ = opcode "fof2" args+ where args+ = [to x1amp, to x2fund, to x3form, to k4oct, to k5band, to k6ris,+ to k7dur, to k8dec, to i9olaps, to i10fna, to i11fnb, to i12totdur,+ to k13phs, to k14gliss]+ ++ map to i0init+++-- | * opcode : fog+-- +-- +-- * syntax : +-- +-- > ares fog xamp, xdens, xtrans, aspd, koct, kband, kris, kdur, kdec, +-- > iolaps, ifna, ifnb, itotdur [, iphs] [, itmode] [, iskip]+-- +-- +-- * description : +-- +-- Audio output is a succession of grains derived from data in a+-- stored function table ifna. The local envelope of these grains+-- and their timing is based on the model of fof synthesis and+-- permits detailed control of the granular synthesis.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fog.html>+ +fog ::+ (X x0, X x1, X x2, K k0, K k1, K k2, K k3, K k4) =>+ [Irate] ->+ x0 ->+ x1 ->+ x2 ->+ Arate ->+ k0 ->+ k1 -> k2 -> k3 -> k4 -> Irate -> Irate -> Irate -> Irate -> Arate+fog i0init x1amp x2dens x3trans a4spd k5oct k6band k7ris k8dur+ k9dec i10olaps i11fna i12fnb i13totdur = opcode "fog" args+ where args+ = [to x1amp, to x2dens, to x3trans, to a4spd, to k5oct, to k6band,+ to k7ris, to k8dur, to k9dec, to i10olaps, to i11fna, to i12fnb,+ to i13totdur]+ ++ map to i0init+++-- | * opcode : grain+-- +-- +-- * syntax : +-- +-- > ares grain xamp, xpitch, xdens, kampoff, kpitchoff, kgdur, igfn, +-- > iwfn, imgdur [, igrnd]+-- +-- +-- * description : +-- +-- Generates granular synthesis textures.+-- +-- +-- * url : <http://www.csounds.com/manual/html/grain.html>+ +grain ::+ (X x0, X x1, X x2, K k0, K k1, K k2) =>+ [Irate] ->+ x0 ->+ x1 -> x2 -> k0 -> k1 -> k2 -> Irate -> Irate -> Irate -> Arate+grain i0init x1amp x2pitch x3dens k4ampoff k5pitchoff k6gdur i7gfn+ i8wfn i9mgdur = opcode "grain" args+ where args+ = [to x1amp, to x2pitch, to x3dens, to k4ampoff, to k5pitchoff,+ to k6gdur, to i7gfn, to i8wfn, to i9mgdur]+ ++ map to i0init+++-- | * opcode : grain2+-- +-- +-- * syntax : +-- +-- > ares grain2 kcps, kfmd, kgdur, iovrlp, kfn, iwfn [, irpow] +-- > [, iseed] [, imode]+-- +-- +-- * description : +-- +-- Generate granular synthesis textures. grain2 is simpler to use,+-- but grain3 offers more control.+-- +-- +-- * url : <http://www.csounds.com/manual/html/grain2.html>+ +grain2 ::+ (K k0, K k1, K k2, K k3) =>+ [Irate] -> k0 -> k1 -> k2 -> Irate -> k3 -> Irate -> Arate+grain2 i0init k1cps k2fmd k3gdur i4ovrlp k5fn i6wfn+ = opcode "grain2" args+ where args+ = [to k1cps, to k2fmd, to k3gdur, to i4ovrlp, to k5fn, to i6wfn] +++ map to i0init+++-- | * opcode : grain3+-- +-- +-- * syntax : +-- +-- > ares grain3 kcps, kphs, kfmd, kpmd, kgdur, kdens, imaxovr, kfn, iwfn, +-- > kfrpow, kprpow [, iseed] [, imode]+-- +-- +-- * description : +-- +-- Generate granular synthesis textures. grain2 is simpler to use+-- but grain3 offers more control.+-- +-- +-- * url : <http://www.csounds.com/manual/html/grain3.html>+ +grain3 ::+ (K k0, K k1, K k2, K k3, K k4, K k5, K k6, K k7, K k8) =>+ [Irate] ->+ k0 ->+ k1 ->+ k2 -> k3 -> k4 -> k5 -> Irate -> k6 -> Irate -> k7 -> k8 -> Arate+grain3 i0init k1cps k2phs k3fmd k4pmd k5gdur k6dens i7maxovr k8fn+ i9wfn k10frpow k11prpow = opcode "grain3" args+ where args+ = [to k1cps, to k2phs, to k3fmd, to k4pmd, to k5gdur, to k6dens,+ to i7maxovr, to k8fn, to i9wfn, to k10frpow, to k11prpow]+ ++ map to i0init+++-- | * opcode : granule+-- +-- +-- * syntax : +-- +-- > ares granule xamp, ivoice, iratio, imode, ithd, ifn, ipshift, igskip, +-- > igskip_os, ilength, kgap, igap_os, kgsize, igsize_os, iatt, idec +-- > [, iseed] [, ipitch1] [, ipitch2] [, ipitch3] [, ipitch4] [, ifnenv]+-- +-- +-- * description : +-- +-- The granule unit generator is more complex than grain, but does+-- add new possibilities.+-- +-- +-- * url : <http://www.csounds.com/manual/html/granule.html>+ +granule ::+ (X x0, K k0, K k1) =>+ [Irate] ->+ x0 ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate -> k0 -> Irate -> k1 -> Irate -> Irate -> Irate -> Arate+granule i0init x1amp i2voice i3ratio i4mode i5thd i6fn i7pshift+ i8gskip i9gskip_os i10length k11gap i12gap_os k13gsize i14gsize_os+ i15att i16dec = opcode "granule" args+ where args+ = [to x1amp, to i2voice, to i3ratio, to i4mode, to i5thd, to i6fn,+ to i7pshift, to i8gskip, to i9gskip_os, to i10length, to k11gap,+ to i12gap_os, to k13gsize, to i14gsize_os, to i15att, to i16dec]+ ++ map to i0init+++-- | * opcode : partikkel+-- +-- +-- * syntax : +-- +-- > a1 [, a2, a3, a4, a5, a6, a7, a8] partikkel agrainfreq, +-- > kdistribution, idisttab, async, kenv2amt, ienv2tab, ienv_attack, +-- > ienv_decay, ksustain_amount, ka_d_ratio, kduration, kamp, igainmasks, +-- > kwavfreq, ksweepshape, iwavfreqstarttab, iwavfreqendtab, awavfm, +-- > ifmamptab, kfmenv, icosine, ktraincps, knumpartials, kchroma, +-- > ichannelmasks, krandommask, kwaveform1, kwaveform2, kwaveform3, +-- > kwaveform4, iwaveamptab, asamplepos1, asamplepos2, asamplepos3, +-- > asamplepos4, kwavekey1, kwavekey2, kwavekey3, kwavekey4, imax_grains +-- > [, iopcode_id]+-- +-- +-- * description : +-- +-- partikkel was conceived after reading Curtis Roads' book+-- "Microsound", and the goal was to create an opcode that was+-- capable of all time-domain varieties of granular synthesis+-- described in this book. The idea being that most of the+-- techniques only differ in parameter values, and by having a+-- single opcode that can do all varieties of granular synthesis+-- makes it possible to interpolate between techniques. Granular+-- synthesis is sometimes dubbed particle synthesis, and it was+-- thought apt to name the opcode partikkel to distinguish it from+-- other granular opcodes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/partikkel.html>+ +partikkel ::+ (K k0, K k1, K k2, K k3, K k4, K k5, K k6, K k7, K k8, K k9, K k10,+ K k11, K k12, K k13, K k14, K k15, K k16, K k17, K k18, K k19,+ K k20) =>+ [Irate] ->+ Arate ->+ k0 ->+ Irate ->+ Arate ->+ k1 ->+ Irate ->+ Irate ->+ Irate ->+ k2 ->+ k3 ->+ k4 ->+ k5 ->+ Irate ->+ k6 ->+ k7 ->+ Irate ->+ Irate ->+ Arate ->+ Irate ->+ k8 ->+ Irate ->+ k9 ->+ k10 ->+ k11 ->+ Irate ->+ k12 ->+ k13 ->+ k14 ->+ k15 ->+ k16 ->+ Irate ->+ Arate ->+ Arate ->+ Arate ->+ Arate ->+ k17 ->+ k18 ->+ k19 ->+ k20 ->+ Irate ->+ MultiOut+partikkel i0init a1grainfreq k2distribution i3disttab a4sync+ k5env2amt i6env2tab i7env_attack i8env_decay k9sustain_amount+ k10a_d_ratio k11duration k12amp i13gainmasks k14wavfreq+ k15sweepshape i16wavfreqstarttab i17wavfreqendtab a18wavfm+ i19fmamptab k20fmenv i21cosine k22traincps k23numpartials k24chroma+ i25channelmasks k26randommask k27waveform1 k28waveform2+ k29waveform3 k30waveform4 i31waveamptab a32samplepos1 a33samplepos2+ a34samplepos3 a35samplepos4 k36wavekey1 k37wavekey2 k38wavekey3+ k39wavekey4 i40max_grains = opcode "partikkel" args+ where args+ = [to a1grainfreq, to k2distribution, to i3disttab, to a4sync,+ to k5env2amt, to i6env2tab, to i7env_attack, to i8env_decay,+ to k9sustain_amount, to k10a_d_ratio, to k11duration, to k12amp,+ to i13gainmasks, to k14wavfreq, to k15sweepshape,+ to i16wavfreqstarttab, to i17wavfreqendtab, to a18wavfm,+ to i19fmamptab, to k20fmenv, to i21cosine, to k22traincps,+ to k23numpartials, to k24chroma, to i25channelmasks,+ to k26randommask, to k27waveform1, to k28waveform2,+ to k29waveform3, to k30waveform4, to i31waveamptab,+ to a32samplepos1, to a33samplepos2, to a34samplepos3,+ to a35samplepos4, to k36wavekey1, to k37wavekey2, to k38wavekey3,+ to k39wavekey4, to i40max_grains]+ ++ map to i0init+++-- | * opcode : partikkelsync+-- +-- +-- * syntax : +-- +-- > async [,aphase] partikkelsync iopcode_id+-- +-- +-- * description : +-- +-- partikkelsync is an opcode for outputting partikkel's grain+-- scheduler clock pulse and phase. partikkelsync's output can be+-- used to synchronize other instances of the partikkel opcode to+-- the same clock.+-- +-- +-- * url : <http://www.csounds.com/manual/html/partikkelsync.html>+ +partikkelsync :: Irate -> MultiOut+partikkelsync i0opcode_id = opcode "partikkelsync" args+ where args = [to i0opcode_id]+++-- | * opcode : sndwarp+-- +-- +-- * syntax : +-- +-- > ares [, ac] sndwarp xamp, xtimewarp, xresample, ifn1, ibeg, iwsize, +-- > irandw, ioverlap, ifn2, itimemode+-- +-- +-- * description : +-- +-- sndwarp reads sound samples from a table and applies+-- time-stretching and/or pitch modification. Time and frequency+-- modification are independent from one another. For example, a+-- sound can be stretched in time while raising the pitch!+-- +-- +-- * url : <http://www.csounds.com/manual/html/sndwarp.html>+ +sndwarp ::+ (X x0, X x1, X x2) =>+ x0 ->+ x1 ->+ x2 ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> MultiOut+sndwarp x0amp x1timewarp x2resample i3fn1 i4beg i5wsize i6randw+ i7overlap i8fn2 i9timemode = opcode "sndwarp" args+ where args+ = [to x0amp, to x1timewarp, to x2resample, to i3fn1, to i4beg,+ to i5wsize, to i6randw, to i7overlap, to i8fn2, to i9timemode]+++-- | * opcode : sndwarpst+-- +-- +-- * syntax : +-- +-- > ar1, ar2 [,ac1] [, ac2] sndwarpst xamp, xtimewarp, xresample, ifn1, +-- > ibeg, iwsize, irandw, ioverlap, ifn2, itimemode+-- +-- +-- * description : +-- +-- sndwarpst reads stereo sound samples from a table and applies+-- time-stretching and/or pitch modification. Time and frequency+-- modification are independent from one another. For example, a+-- sound can be stretched in time while raising the pitch!+-- +-- +-- * url : <http://www.csounds.com/manual/html/sndwarpst.html>+ +sndwarpst ::+ (X x0, X x1, X x2) =>+ x0 ->+ x1 ->+ x2 ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> MultiOut+sndwarpst x0amp x1timewarp x2resample i3fn1 i4beg i5wsize i6randw+ i7overlap i8fn2 i9timemode = opcode "sndwarpst" args+ where args+ = [to x0amp, to x1timewarp, to x2resample, to i3fn1, to i4beg,+ to i5wsize, to i6randw, to i7overlap, to i8fn2, to i9timemode]+++-- | * opcode : syncgrain+-- +-- +-- * syntax : +-- +-- > asig syncgrain kamp, kfreq, kpitch, kgrsize, kprate, ifun1, +-- > ifun2, iolaps+-- +-- +-- * description : +-- +-- syncgrain implements synchronous granular synthesis. The source+-- sound for the grains is obtained by reading a function table+-- containing the samples of the source waveform. For sampled-sound+-- sources, GEN01 is used. syncgrain will accept deferred allocation+-- tables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/syncgrain.html>+ +syncgrain ::+ (K k0, K k1, K k2, K k3, K k4) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> Irate -> Irate -> Irate -> Arate+syncgrain k0amp k1freq k2pitch k3grsize k4prate i5fun1 i6fun2+ i7olaps = opcode "syncgrain" args+ where args+ = [to k0amp, to k1freq, to k2pitch, to k3grsize, to k4prate,+ to i5fun1, to i6fun2, to i7olaps]+++-- | * opcode : syncloop+-- +-- +-- * syntax : +-- +-- > asig syncloop kamp, kfreq, kpitch, kgrsize, kprate, klstart, +-- > klend, ifun1, ifun2, iolaps[,istart, iskip]+-- +-- +-- * description : +-- +-- syncloop is a variation on syncgrain, which implements+-- synchronous granular synthesis. syncloop adds loop start and end+-- points and an optional start position. Loop start and end control+-- grain start positions, so the actual grains can go beyond the+-- loop points (if the loop points are not at the extremes of the+-- table), enabling seamless crossfading. For more information on+-- the granular synthesis process, check the syncgrain manual page.+-- +-- +-- * url : <http://www.csounds.com/manual/html/syncloop.html>+ +syncloop ::+ (K k0, K k1, K k2, K k3, K k4, K k5, K k6) =>+ [Irate] ->+ k0 ->+ k1 ->+ k2 -> k3 -> k4 -> k5 -> k6 -> Irate -> Irate -> Irate -> Arate+syncloop i0init k1amp k2freq k3pitch k4grsize k5prate k6lstart+ k7lend i8fun1 i9fun2 i10olaps = opcode "syncloop" args+ where args+ = [to k1amp, to k2freq, to k3pitch, to k4grsize, to k5prate,+ to k6lstart, to k7lend, to i8fun1, to i9fun2, to i10olaps]+ ++ map to i0init+++-- | * opcode : vosim+-- +-- +-- * syntax : +-- +-- > ar vosim kamp, kFund, kForm, kDecay, kPulseCount, kPulseFactor, ifn [, iskip]+-- +-- +-- * description : +-- +-- This opcode produces a simple vocal simulation based on glottal+-- pulses with formant characteristics. Output is a series of sound+-- events, where each event is composed of a burst of squared sine+-- pulses followed by silence. The VOSIM (VOcal SIMulation)+-- synthesis method was developed by Kaegi and Tempelaars in the+-- 1970's.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vosim.html>+ +vosim ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ [Irate] -> k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> Irate -> Arate+vosim i0init k1amp k2Fund k3Form k4Decay k5PulseCount k6PulseFactor+ i7fn = opcode "vosim" args+ where args+ = [to k1amp, to k2Fund, to k3Form, to k4Decay, to k5PulseCount,+ to k6PulseFactor, to i7fn]+ ++ map to i0init
+ src/CsoundExpr/Opcodes/Siggen/Hvs.hs view
@@ -0,0 +1,124 @@+-- | Hyper Vectorial Synthesis+module CsoundExpr.Opcodes.Siggen.Hvs+ (vphaseseg,+ hvs1,+ hvs2,+ hvs3)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : vphaseseg+-- +-- +-- * syntax : +-- +-- > vphaseseg kphase, ioutab, ielems, itab1,idist1,itab2 +-- > [,idist2,itab3,...,idistN-1,itabN]+-- +-- +-- * description : +-- +-- vphaseseg allows one-dimensional HVS (Hyper-Vectorial+-- Synthesis).+-- +-- +-- * url : <http://www.csounds.com/manual/html/vphaseseg.html>+ +vphaseseg :: (K k0) => k0 -> Irate -> Irate -> [Irate] -> SignalOut+vphaseseg k0phase i1outab i2elems i3tabDist+ = outOpcode "vphaseseg" args+ where args+ = [to k0phase, to i1outab, to i2elems] ++ map to i3tabDist+++-- | * opcode : hvs1+-- +-- +-- * syntax : +-- +-- > hvs1 kx, inumParms, inumPointsX, iOutTab, iPositionsTab, iSnapTab [, iConfigTab]+-- +-- +-- * description : +-- +-- hvs1 allows one-dimensional Hyper Vectorial Synthesis (HVS)+-- controlled by externally-updated k-variables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/hvs1.html>+ +hvs1 ::+ (K k0) =>+ [Irate] ->+ k0 -> Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+hvs1 i0init k1x i2numParms i3numPointsX i4OutTab i5PositionsTab+ i6SnapTab = outOpcode "hvs1" args+ where args+ = [to k1x, to i2numParms, to i3numPointsX, to i4OutTab,+ to i5PositionsTab, to i6SnapTab]+ ++ map to i0init+++-- | * opcode : hvs2+-- +-- +-- * syntax : +-- +-- > hvs2 kx, ky, inumParms, inumPointsX, iOutTab, iPositionsTab, iSnapTab [, iConfigTab]+-- +-- +-- * description : +-- +-- hvs2 allows two-dimensional Hyper Vectorial Synthesis (HVS)+-- controlled by externally-updated k-variables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/hvs2.html>+ +hvs2 ::+ (K k0, K k1) =>+ [Irate] ->+ k0 -> k1 -> Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+hvs2 i0init k1x k2y i3numParms i4numPointsX i5OutTab i6PositionsTab+ i7SnapTab = outOpcode "hvs2" args+ where args+ = [to k1x, to k2y, to i3numParms, to i4numPointsX, to i5OutTab,+ to i6PositionsTab, to i7SnapTab]+ ++ map to i0init+++-- | * opcode : hvs3+-- +-- +-- * syntax : +-- +-- > hvs3 kx, ky, kz, inumParms, inumPointsX, iOutTab, iPositionsTab, iSnapTab [, iConfigTab]+-- +-- +-- * description : +-- +-- hvs3 allows three-dimensional Hyper Vectorial Synthesis (HVS)+-- controlled by externally-updated k-variables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/hvs3.html>+ +hvs3 ::+ (K k0, K k1, K k2) =>+ [Irate] ->+ k0 ->+ k1 -> k2 -> Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+hvs3 i0init k1x k2y k3z i4numParms i5numPointsX i6OutTab+ i7PositionsTab i8SnapTab = outOpcode "hvs3" args+ where args+ = [to k1x, to k2y, to k3z, to i4numParms, to i5numPointsX,+ to i6OutTab, to i7PositionsTab, to i8SnapTab]+ ++ map to i0init
+ src/CsoundExpr/Opcodes/Siggen/Lineexp.hs view
@@ -0,0 +1,587 @@+-- | Linear and Exponential Generators+module CsoundExpr.Opcodes.Siggen.Lineexp+ (exponA,+ exponK,+ expcurve,+ transegA,+ transegK,+ expsega,+ expsegrA,+ expsegrK,+ gainslider,+ jsplineA,+ jsplineK,+ lineA,+ lineK,+ linsegA,+ linsegK,+ linsegrA,+ linsegrK,+ logcurve,+ loopseg,+ loopsegp,+ lpshold,+ lpsholdp,+ rsplineA,+ rsplineK,+ scale)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : expon+-- +-- +-- * syntax : +-- +-- > ares expon ia, idur, ib+-- > kres expon ia, idur, ib+-- +-- +-- * description : +-- +-- Trace an exponential curve between specified points.+-- +-- +-- * url : <http://www.csounds.com/manual/html/expon.html>+ +exponA :: Irate -> Irate -> Irate -> Arate+exponA i0a i1dur i2b = opcode "expon" args+ where args = [to i0a, to i1dur, to i2b]+++-- | * opcode : expon+-- +-- +-- * syntax : +-- +-- > ares expon ia, idur, ib+-- > kres expon ia, idur, ib+-- +-- +-- * description : +-- +-- Trace an exponential curve between specified points.+-- +-- +-- * url : <http://www.csounds.com/manual/html/expon.html>+ +exponK :: Irate -> Irate -> Irate -> Krate+exponK i0a i1dur i2b = opcode "expon" args+ where args = [to i0a, to i1dur, to i2b]+++-- | * opcode : expcurve+-- +-- +-- * syntax : +-- +-- > kout expcurve kindex, ksteepness+-- +-- +-- * description : +-- +-- Generates an exponential curve in range 0 to 1 of arbitrary+-- steepness. Steepness index equal to or lower than 1.0 will result+-- in Not-a-Number errors and cause unstable behavior.+-- +-- +-- * url : <http://www.csounds.com/manual/html/expcurve.html>+ +expcurve :: (K k0, K k1) => k0 -> k1 -> Krate+expcurve k0index k1steepness = opcode "expcurve" args+ where args = [to k0index, to k1steepness]+++-- | * opcode : expseg+-- +-- +-- * syntax : +-- +-- > ares expseg ia, idur1, ib [, idur2] [, ic] [...]+-- > kres expseg ia, idur1, ib [, idur2] [, ic] [...]+-- +-- +-- * description : +-- +-- Trace a series of exponential segments between specified points.+-- +-- +-- * url : <http://www.csounds.com/manual/html/expseg.html>+ +transegA :: [Irate] -> Arate+transegA i0vals = opcode "transeg" args+ where args = map to i0vals+++-- | * opcode : expseg+-- +-- +-- * syntax : +-- +-- > ares expseg ia, idur1, ib [, idur2] [, ic] [...]+-- > kres expseg ia, idur1, ib [, idur2] [, ic] [...]+-- +-- +-- * description : +-- +-- Trace a series of exponential segments between specified points.+-- +-- +-- * url : <http://www.csounds.com/manual/html/expseg.html>+ +transegK :: [Irate] -> Krate+transegK i0vals = opcode "transeg" args+ where args = map to i0vals+++-- | * opcode : expsega+-- +-- +-- * syntax : +-- +-- > ares expsega ia, idur1, ib [, idur2] [, ic] [...]+-- +-- +-- * description : +-- +-- An exponential segment generator operating at a-rate. This unit+-- is almost identical to expseg, but more precise when defining+-- segments with very short durations (i.e., in a percussive attack+-- phase) at audio rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/expsega.html>+ +expsega :: [Irate] -> Arate+expsega i0vals = opcode "expsega" args+ where args = map to i0vals+++-- | * opcode : expsegr+-- +-- +-- * syntax : +-- +-- > ares expsegr ia, idur1, ib [, idur2] [, ic] [...], irel, iz+-- > kres expsegr ia, idur1, ib [, idur2] [, ic] [...], irel, iz+-- +-- +-- * description : +-- +-- Trace a series of exponential segments between specified points+-- including a release segment.+-- +-- +-- * url : <http://www.csounds.com/manual/html/expsegr.html>+ +expsegrA :: [Irate] -> Irate -> Irate -> Arate+expsegrA i0vals i1rel i2z = opcode "expsegr" args+ where args = map to i0vals ++ [to i1rel, to i2z]+++-- | * opcode : expsegr+-- +-- +-- * syntax : +-- +-- > ares expsegr ia, idur1, ib [, idur2] [, ic] [...], irel, iz+-- > kres expsegr ia, idur1, ib [, idur2] [, ic] [...], irel, iz+-- +-- +-- * description : +-- +-- Trace a series of exponential segments between specified points+-- including a release segment.+-- +-- +-- * url : <http://www.csounds.com/manual/html/expsegr.html>+ +expsegrK :: [Irate] -> Irate -> Irate -> Krate+expsegrK i0vals i1rel i2z = opcode "expsegr" args+ where args = map to i0vals ++ [to i1rel, to i2z]+++-- | * opcode : gainslider+-- +-- +-- * syntax : +-- +-- > kout gainslider kindex+-- +-- +-- * description : +-- +-- This opcode is intended for use to multiply by an audio signal+-- to give a console mixer like feel. There is no bounds in the+-- source code so you can for example give higher than 127 values+-- for extra amplitude but possibly clipped audio.+-- +-- +-- * url : <http://www.csounds.com/manual/html/gainslider.html>+ +gainslider :: (K k0) => k0 -> Krate+gainslider k0index = opcode "gainslider" args+ where args = [to k0index]+++-- | * opcode : jspline+-- +-- +-- * syntax : +-- +-- > ares jspline xamp, kcpsMin, kcpsMax+-- > kres jspline kamp, kcpsMin, kcpsMax+-- +-- +-- * description : +-- +-- A jitter-spline generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/jspline.html>+ +jsplineA :: (X x0, K k0, K k1) => x0 -> k0 -> k1 -> Arate+jsplineA x0amp k1cpsMin k2cpsMax = opcode "jspline" args+ where args = [to x0amp, to k1cpsMin, to k2cpsMax]+++-- | * opcode : jspline+-- +-- +-- * syntax : +-- +-- > ares jspline xamp, kcpsMin, kcpsMax+-- > kres jspline kamp, kcpsMin, kcpsMax+-- +-- +-- * description : +-- +-- A jitter-spline generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/jspline.html>+ +jsplineK :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+jsplineK k0amp k1cpsMin k2cpsMax = opcode "jspline" args+ where args = [to k0amp, to k1cpsMin, to k2cpsMax]+++-- | * opcode : line+-- +-- +-- * syntax : +-- +-- > ares line ia, idur, ib+-- > kres line ia, idur, ib+-- +-- +-- * description : +-- +-- Trace a straight line between specified points.+-- +-- +-- * url : <http://www.csounds.com/manual/html/line.html>+ +lineA :: Irate -> Irate -> Irate -> Arate+lineA i0a i1dur i2b = opcode "line" args+ where args = [to i0a, to i1dur, to i2b]+++-- | * opcode : line+-- +-- +-- * syntax : +-- +-- > ares line ia, idur, ib+-- > kres line ia, idur, ib+-- +-- +-- * description : +-- +-- Trace a straight line between specified points.+-- +-- +-- * url : <http://www.csounds.com/manual/html/line.html>+ +lineK :: Irate -> Irate -> Irate -> Krate+lineK i0a i1dur i2b = opcode "line" args+ where args = [to i0a, to i1dur, to i2b]+++-- | * opcode : linseg+-- +-- +-- * syntax : +-- +-- > ares linseg ia, idur1, ib [, idur2] [, ic] [...]+-- > kres linseg ia, idur1, ib [, idur2] [, ic] [...]+-- +-- +-- * description : +-- +-- Trace a series of line segments between specified points.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linseg.html>+ +linsegA :: [Irate] -> Arate+linsegA i0vals = opcode "linseg" args+ where args = map to i0vals+++-- | * opcode : linseg+-- +-- +-- * syntax : +-- +-- > ares linseg ia, idur1, ib [, idur2] [, ic] [...]+-- > kres linseg ia, idur1, ib [, idur2] [, ic] [...]+-- +-- +-- * description : +-- +-- Trace a series of line segments between specified points.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linseg.html>+ +linsegK :: [Irate] -> Krate+linsegK i0vals = opcode "linseg" args+ where args = map to i0vals+++-- | * opcode : linsegr+-- +-- +-- * syntax : +-- +-- > ares linsegr ia, idur1, ib [, idur2] [, ic] [...], irel, iz+-- > kres linsegr ia, idur1, ib [, idur2] [, ic] [...], irel, iz+-- +-- +-- * description : +-- +-- Trace a series of line segments between specified points+-- including a release segment.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linsegr.html>+ +linsegrA :: [Irate] -> Irate -> Irate -> Arate+linsegrA i0vals i1rel i2z = opcode "linsegr" args+ where args = map to i0vals ++ [to i1rel, to i2z]+++-- | * opcode : linsegr+-- +-- +-- * syntax : +-- +-- > ares linsegr ia, idur1, ib [, idur2] [, ic] [...], irel, iz+-- > kres linsegr ia, idur1, ib [, idur2] [, ic] [...], irel, iz+-- +-- +-- * description : +-- +-- Trace a series of line segments between specified points+-- including a release segment.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linsegr.html>+ +linsegrK :: [Irate] -> Irate -> Irate -> Krate+linsegrK i0vals i1rel i2z = opcode "linsegr" args+ where args = map to i0vals ++ [to i1rel, to i2z]+++-- | * opcode : logcurve+-- +-- +-- * syntax : +-- +-- > kout logcurve kindex, ksteepness+-- +-- +-- * description : +-- +-- Generates a logarithmic curve in range 0 to 1 of arbitrary+-- steepness. Steepness index equal to or lower than 1.0 will result+-- in Not-a-Number errors and cause unstable behavior.+-- +-- +-- * url : <http://www.csounds.com/manual/html/logcurve.html>+ +logcurve :: (K k0, K k1) => k0 -> k1 -> Krate+logcurve k0index k1steepness = opcode "logcurve" args+ where args = [to k0index, to k1steepness]+++-- | * opcode : loopseg+-- +-- +-- * syntax : +-- +-- > ksig loopseg kfreq, ktrig, ktime0, kvalue0 [, ktime1] [, kvalue1] +-- > [, ktime2] [, kvalue2] [...]+-- +-- +-- * description : +-- +-- Generate control signal consisting of linear segments delimited+-- by two or more specified points. The entire envelope is looped at+-- kfreq rate. Each parameter can be varied at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/loopseg.html>+ +loopseg :: (K k0, K k1, K k2) => k0 -> k1 -> [k2] -> Krate+loopseg k0freq k1trig k2vals = opcode "loopseg" args+ where args = [to k0freq, to k1trig] ++ map to k2vals+++-- | * opcode : loopsegp+-- +-- +-- * syntax : +-- +-- > ksig loopsegp kphase, kvalue0, kdur0, kvalue1 +-- > [, kdur1,..., kdurN-1, kvalueN]+-- +-- +-- * description : +-- +-- Generate control signal consisiting of linear segments delimited+-- by two or more specified points. The entire envelope can be+-- looped at time-variant rate. Each segment coordinate can also be+-- varied at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/loopsegp.html>+ +loopsegp :: (K k0, K k1) => k0 -> [k1] -> Krate+loopsegp k0phase k1vals = opcode "loopsegp" args+ where args = [to k0phase] ++ map to k1vals+++-- | * opcode : lpshold+-- +-- +-- * syntax : +-- +-- > ksig lpshold kfreq, ktrig, ktime0, kvalue0 [, ktime1] [, kvalue1] +-- > [, ktime2] [, kvalue2] [...]+-- +-- +-- * description : +-- +-- Generate control signal consisting of held segments delimited by+-- two or more specified points. The entire envelope is looped at+-- kfreq rate. Each parameter can be varied at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lpshold.html>+ +lpshold :: (K k0, K k1, K k2) => k0 -> k1 -> [k2] -> Krate+lpshold k0freq k1trig k2vals = opcode "lpshold" args+ where args = [to k0freq, to k1trig] ++ map to k2vals+++-- | * opcode : lpsholdp+-- +-- +-- * syntax : +-- +-- > ksig lpsholdp kphase, ktrig, ktime0, kvalue0 [, ktime1] [, kvalue1] +-- > [, ktime2] [, kvalue2] [...]+-- +-- +-- * description : +-- +-- Generate control signal consisiting of held segments delimited+-- by two or more specified points. The entire envelope can be+-- looped at time-variant rate. Each segment coordinate can also be+-- varied at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lpsholdp.html>+ +lpsholdp :: (K k0, K k1) => k0 -> [k1] -> Krate+lpsholdp k0phase k1vals = opcode "lpsholdp" args+ where args = [to k0phase] ++ map to k1vals+++-- | * opcode : rspline+-- +-- +-- * syntax : +-- +-- > ares rspline xrangeMin, xrangeMax, kcpsMin, kcpsMax+-- > kres rspline krangeMin, krangeMax, kcpsMin, kcpsMax+-- +-- +-- * description : +-- +-- Generate random spline curves.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rspline.html>+ +rsplineA ::+ (X x0, X x1, K k0, K k1) => x0 -> x1 -> k0 -> k1 -> Arate+rsplineA x0rangeMin x1rangeMax k2cpsMin k3cpsMax+ = opcode "rspline" args+ where args+ = [to x0rangeMin, to x1rangeMax, to k2cpsMin, to k3cpsMax]+++-- | * opcode : rspline+-- +-- +-- * syntax : +-- +-- > ares rspline xrangeMin, xrangeMax, kcpsMin, kcpsMax+-- > kres rspline krangeMin, krangeMax, kcpsMin, kcpsMax+-- +-- +-- * description : +-- +-- Generate random spline curves.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rspline.html>+ +rsplineK ::+ (K k0, K k1, K k2, K k3) => k0 -> k1 -> k2 -> k3 -> Krate+rsplineK k0rangeMin k1rangeMax k2cpsMin k3cpsMax+ = opcode "rspline" args+ where args+ = [to k0rangeMin, to k1rangeMax, to k2cpsMin, to k3cpsMax]+++-- | * opcode : scale+-- +-- +-- * syntax : +-- +-- > kscl scale kinput, kmax, kmin+-- +-- +-- * description : +-- +-- Scales incoming value to user-definable range. Similar to scale+-- object found in popular dataflow languages.+-- +-- +-- * url : <http://www.csounds.com/manual/html/scale.html>+ +scale :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+scale k0input k1max k2min = opcode "scale" args+ where args = [to k0input, to k1max, to k2min]
+ src/CsoundExpr/Opcodes/Siggen/Models.hs view
@@ -0,0 +1,715 @@+-- | Models and Emulations+module CsoundExpr.Opcodes.Siggen.Models+ (bamboo,+ barmodel,+ cabasa,+ crunch,+ dripwater,+ gogobel,+ guiro,+ mandol,+ marimba,+ moog,+ sandpaper,+ sekere,+ shaker,+ sleighbells,+ stix,+ tambourine,+ vibes,+ voice,+ lorenz,+ planet,+ prepiano,+ prepianoA,+ mandel,+ chuap)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : bamboo+-- +-- +-- * syntax : +-- +-- > ares bamboo kamp, idettack [, inum] [, idamp] [, imaxshake] [, ifreq] +-- > [, ifreq1] [, ifreq2]+-- +-- +-- * description : +-- +-- bamboo is a semi-physical model of a bamboo sound. It is one of+-- the PhISEM percussion opcodes. PhISEM (Physically Informed+-- Stochastic Event Modeling) is an algorithmic approach for+-- simulating collisions of multiple independent sound producing+-- objects.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bamboo.html>+ +bamboo :: (K k0) => [Irate] -> k0 -> Irate -> Arate+bamboo i0init k1amp i2dettack = opcode "bamboo" args+ where args = [to k1amp, to i2dettack] ++ map to i0init+++-- | * opcode : barmodel+-- +-- +-- * syntax : +-- +-- > ares barmodel kbcL, kbcR, iK, ib, kscan, iT30, ipos, ivel, iwid+-- +-- +-- * description : +-- +-- Audio output is a tone similar to a struck metal bar, using a+-- physical model developed from solving the partial differential+-- equation. There are controls over the boundary conditions as well+-- as the bar characteristics.+-- +-- +-- * url : <http://www.csounds.com/manual/html/barmodel.html>+ +barmodel ::+ (K k0, K k1, K k2) =>+ k0 ->+ k1 ->+ Irate -> Irate -> k2 -> Irate -> Irate -> Irate -> Irate -> Arate+barmodel k0bcL k1bcR i2K i3b k4scan i5T30 i6pos i7vel i8wid+ = opcode "barmodel" args+ where args+ = [to k0bcL, to k1bcR, to i2K, to i3b, to k4scan, to i5T30,+ to i6pos, to i7vel, to i8wid]+++-- | * opcode : cabasa+-- +-- +-- * syntax : +-- +-- > ares cabasa iamp, idettack [, inum] [, idamp] [, imaxshake]+-- +-- +-- * description : +-- +-- cabasa is a semi-physical model of a cabasa sound. It is one of+-- the PhISEM percussion opcodes. PhISEM (Physically Informed+-- Stochastic Event Modeling) is an algorithmic approach for+-- simulating collisions of multiple independent sound producing+-- objects.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cabasa.html>+ +cabasa :: [Irate] -> Irate -> Irate -> Arate+cabasa i0init i1amp i2dettack = opcode "cabasa" args+ where args = [to i1amp, to i2dettack] ++ map to i0init+++-- | * opcode : crunch+-- +-- +-- * syntax : +-- +-- > ares crunch iamp, idettack [, inum] [, idamp] [, imaxshake]+-- +-- +-- * description : +-- +-- crunch is a semi-physical model of a crunch sound. It is one of+-- the PhISEM percussion opcodes. PhISEM (Physically Informed+-- Stochastic Event Modeling) is an algorithmic approach for+-- simulating collisions of multiple independent sound producing+-- objects.+-- +-- +-- * url : <http://www.csounds.com/manual/html/crunch.html>+ +crunch :: [Irate] -> Irate -> Irate -> Arate+crunch i0init i1amp i2dettack = opcode "crunch" args+ where args = [to i1amp, to i2dettack] ++ map to i0init+++-- | * opcode : dripwater+-- +-- +-- * syntax : +-- +-- > ares dripwater kamp, idettack [, inum] [, idamp] [, imaxshake] [, ifreq] +-- > [, ifreq1] [, ifreq2]+-- +-- +-- * description : +-- +-- dripwater is a semi-physical model of a water drop. It is one of+-- the PhISEM percussion opcodes. PhISEM (Physically Informed+-- Stochastic Event Modeling) is an algorithmic approach for+-- simulating collisions of multiple independent sound producing+-- objects.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dripwater.html>+ +dripwater :: (K k0) => [Irate] -> k0 -> Irate -> Arate+dripwater i0init k1amp i2dettack = opcode "dripwater" args+ where args = [to k1amp, to i2dettack] ++ map to i0init+++-- | * opcode : gogobel+-- +-- +-- * syntax : +-- +-- > ares gogobel kamp, kfreq, ihrd, ipos, imp, kvibf, kvamp, ivfn+-- +-- +-- * description : +-- +-- Audio output is a tone related to the striking of a cow bell or+-- similar. The method is a physical model developed from Perry+-- Cook, but re-coded for Csound.+-- +-- +-- * url : <http://www.csounds.com/manual/html/gogobel.html>+ +gogobel ::+ (K k0, K k1, K k2, K k3) =>+ k0 -> k1 -> Irate -> Irate -> Irate -> k2 -> k3 -> Irate -> Arate+gogobel k0amp k1freq i2hrd i3pos i4mp k5vibf k6vamp i7vfn+ = opcode "gogobel" args+ where args+ = [to k0amp, to k1freq, to i2hrd, to i3pos, to i4mp, to k5vibf,+ to k6vamp, to i7vfn]+++-- | * opcode : guiro+-- +-- +-- * syntax : +-- +-- > ares guiro kamp, idettack [, inum] [, idamp] [, imaxshake] [, ifreq] [, ifreq1]+-- +-- +-- * description : +-- +-- guiro is a semi-physical model of a guiro sound. It is one of+-- the PhISEM percussion opcodes. PhISEM (Physically Informed+-- Stochastic Event Modeling) is an algorithmic approach for+-- simulating collisions of multiple independent sound producing+-- objects.+-- +-- +-- * url : <http://www.csounds.com/manual/html/guiro.html>+ +guiro :: (K k0) => [Irate] -> k0 -> Irate -> Arate+guiro i0init k1amp i2dettack = opcode "guiro" args+ where args = [to k1amp, to i2dettack] ++ map to i0init+++-- | * opcode : mandol+-- +-- +-- * syntax : +-- +-- > ares mandol kamp, kfreq, kpluck, kdetune, kgain, ksize, ifn [, iminfreq]+-- +-- +-- * description : +-- +-- An emulation of a mandolin.+-- +-- +-- * url : <http://www.csounds.com/manual/html/mandol.html>+ +mandol ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ [Irate] -> k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> Irate -> Arate+mandol i0init k1amp k2freq k3pluck k4detune k5gain k6size i7fn+ = opcode "mandol" args+ where args+ = [to k1amp, to k2freq, to k3pluck, to k4detune, to k5gain,+ to k6size, to i7fn]+ ++ map to i0init+++-- | * opcode : marimba+-- +-- +-- * syntax : +-- +-- > ares marimba kamp, kfreq, ihrd, ipos, imp, kvibf, kvamp, ivibfn, idec +-- > [, idoubles] [, itriples]+-- +-- +-- * description : +-- +-- Audio output is a tone related to the striking of a wooden block+-- as found in a marimba. The method is a physical model developed+-- from Perry Cook but re-coded for Csound.+-- +-- +-- * url : <http://www.csounds.com/manual/html/marimba.html>+ +marimba ::+ (K k0, K k1, K k2, K k3) =>+ [Irate] ->+ k0 ->+ k1 ->+ Irate -> Irate -> Irate -> k2 -> k3 -> Irate -> Irate -> Arate+marimba i0init k1amp k2freq i3hrd i4pos i5mp k6vibf k7vamp i8vibfn+ i9dec = opcode "marimba" args+ where args+ = [to k1amp, to k2freq, to i3hrd, to i4pos, to i5mp, to k6vibf,+ to k7vamp, to i8vibfn, to i9dec]+ ++ map to i0init+++-- | * opcode : moog+-- +-- +-- * syntax : +-- +-- > ares moog kamp, kfreq, kfiltq, kfiltrate, kvibf, kvamp, iafn, iwfn, ivfn+-- +-- +-- * description : +-- +-- An emulation of a mini-Moog synthesizer.+-- +-- +-- * url : <http://www.csounds.com/manual/html/moog.html>+ +moog ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ k0 ->+ k1 -> k2 -> k3 -> k4 -> k5 -> Irate -> Irate -> Irate -> Arate+moog k0amp k1freq k2filtq k3filtrate k4vibf k5vamp i6afn i7wfn+ i8vfn = opcode "moog" args+ where args+ = [to k0amp, to k1freq, to k2filtq, to k3filtrate, to k4vibf,+ to k5vamp, to i6afn, to i7wfn, to i8vfn]+++-- | * opcode : sandpaper+-- +-- +-- * syntax : +-- +-- > ares sandpaper iamp, idettack [, inum] [, idamp] [, imaxshake]+-- +-- +-- * description : +-- +-- sandpaper is a semi-physical model of a sandpaper sound. It is+-- one of the PhISEM percussion opcodes. PhISEM (Physically Informed+-- Stochastic Event Modeling) is an algorithmic approach for+-- simulating collisions of multiple independent sound producing+-- objects.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sandpaper.html>+ +sandpaper :: [Irate] -> Irate -> Irate -> Arate+sandpaper i0init i1amp i2dettack = opcode "sandpaper" args+ where args = [to i1amp, to i2dettack] ++ map to i0init+++-- | * opcode : sekere+-- +-- +-- * syntax : +-- +-- > ares sekere iamp, idettack [, inum] [, idamp] [, imaxshake]+-- +-- +-- * description : +-- +-- sekere is a semi-physical model of a sekere sound. It is one of+-- the PhISEM percussion opcodes. PhISEM (Physically Informed+-- Stochastic Event Modeling) is an algorithmic approach for+-- simulating collisions of multiple independent sound producing+-- objects.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sekere.html>+ +sekere :: [Irate] -> Irate -> Irate -> Arate+sekere i0init i1amp i2dettack = opcode "sekere" args+ where args = [to i1amp, to i2dettack] ++ map to i0init+++-- | * opcode : shaker+-- +-- +-- * syntax : +-- +-- > ares shaker kamp, kfreq, kbeans, kdamp, ktimes [, idecay]+-- +-- +-- * description : +-- +-- Audio output is a tone related to the shaking of a maraca or+-- similar gourd instrument. The method is a physically inspired+-- model developed from Perry Cook, but re-coded for Csound.+-- +-- +-- * url : <http://www.csounds.com/manual/html/shaker.html>+ +shaker ::+ (K k0, K k1, K k2, K k3, K k4) =>+ [Irate] -> k0 -> k1 -> k2 -> k3 -> k4 -> Arate+shaker i0init k1amp k2freq k3beans k4damp k5times+ = opcode "shaker" args+ where args+ = [to k1amp, to k2freq, to k3beans, to k4damp, to k5times] +++ map to i0init+++-- | * opcode : sleighbells+-- +-- +-- * syntax : +-- +-- > ares sleighbells kamp, idettack [, inum] [, idamp] [, imaxshake] [, ifreq] +-- > [, ifreq1] [, ifreq2]+-- +-- +-- * description : +-- +-- sleighbells is a semi-physical model of a sleighbell sound. It+-- is one of the PhISEM percussion opcodes. PhISEM (Physically+-- Informed Stochastic Event Modeling) is an algorithmic approach+-- for simulating collisions of multiple independent sound producing+-- objects.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sleighbells.html>+ +sleighbells :: (K k0) => [Irate] -> k0 -> Irate -> Arate+sleighbells i0init k1amp i2dettack = opcode "sleighbells" args+ where args = [to k1amp, to i2dettack] ++ map to i0init+++-- | * opcode : stix+-- +-- +-- * syntax : +-- +-- > ares stix iamp, idettack [, inum] [, idamp] [, imaxshake]+-- +-- +-- * description : +-- +-- stix is a semi-physical model of a stick sound. It is one of the+-- PhISEM percussion opcodes. PhISEM (Physically Informed Stochastic+-- Event Modeling) is an algorithmic approach for simulating+-- collisions of multiple independent sound producing objects.+-- +-- +-- * url : <http://www.csounds.com/manual/html/stix.html>+ +stix :: [Irate] -> Irate -> Irate -> Arate+stix i0init i1amp i2dettack = opcode "stix" args+ where args = [to i1amp, to i2dettack] ++ map to i0init+++-- | * opcode : tambourine+-- +-- +-- * syntax : +-- +-- > ares tambourine kamp, idettack [, inum] [, idamp] [, imaxshake] [, ifreq] +-- > [, ifreq1] [, ifreq2]+-- +-- +-- * description : +-- +-- tambourine is a semi-physical model of a tambourine sound. It is+-- one of the PhISEM percussion opcodes. PhISEM (Physically Informed+-- Stochastic Event Modeling) is an algorithmic approach for+-- simulating collisions of multiple independent sound producing+-- objects.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tambourine.html>+ +tambourine :: (K k0) => [Irate] -> k0 -> Irate -> Arate+tambourine i0init k1amp i2dettack = opcode "tambourine" args+ where args = [to k1amp, to i2dettack] ++ map to i0init+++-- | * opcode : vibes+-- +-- +-- * syntax : +-- +-- > ares vibes kamp, kfreq, ihrd, ipos, imp, kvibf, kvamp, ivibfn, idec+-- +-- +-- * description : +-- +-- Audio output is a tone related to the striking of a metal block+-- as found in a vibraphone. The method is a physical model+-- developed from Perry Cook, but re-coded for Csound.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vibes.html>+ +vibes ::+ (K k0, K k1, K k2, K k3) =>+ k0 ->+ k1 ->+ Irate -> Irate -> Irate -> k2 -> k3 -> Irate -> Irate -> Arate+vibes k0amp k1freq i2hrd i3pos i4mp k5vibf k6vamp i7vibfn i8dec+ = opcode "vibes" args+ where args+ = [to k0amp, to k1freq, to i2hrd, to i3pos, to i4mp, to k5vibf,+ to k6vamp, to i7vibfn, to i8dec]+++-- | * opcode : voice+-- +-- +-- * syntax : +-- +-- > ares voice kamp, kfreq, kphoneme, kform, kvibf, kvamp, ifn, ivfn+-- +-- +-- * description : +-- +-- An emulation of a human voice.+-- +-- +-- * url : <http://www.csounds.com/manual/html/voice.html>+ +voice ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> Irate -> Irate -> Arate+voice k0amp k1freq k2phoneme k3form k4vibf k5vamp i6fn i7vfn+ = opcode "voice" args+ where args+ = [to k0amp, to k1freq, to k2phoneme, to k3form, to k4vibf,+ to k5vamp, to i6fn, to i7vfn]+++-- | * opcode : lorenz+-- +-- +-- * syntax : +-- +-- > ax, ay, az lorenz ksv, krv, kbv, kh, ix, iy, iz, iskip [, iskipinit]+-- +-- +-- * description : +-- +-- Implements the Lorenz system of equations. The Lorenz system is+-- a chaotic-dynamic system which was originally used to simulate+-- the motion of a particle in convection currents and simplified+-- weather systems. Small differences in initial conditions rapidly+-- lead to diverging values. This is sometimes expressed as the+-- butterfly effect. If a butterfly flaps its wings in Australia, it+-- will have an effect on the weather in Alaska. This system is one+-- of the milestones in the development of chaos theory. It is+-- useful as a chaotic audio source or as a low frequency modulation+-- source.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lorenz.html>+ +lorenz ::+ (K k0, K k1, K k2, K k3) =>+ [Irate] ->+ k0 ->+ k1 -> k2 -> k3 -> Irate -> Irate -> Irate -> Irate -> MultiOut+lorenz i0init k1sv k2rv k3bv k4h i5x i6y i7z i8skip+ = opcode "lorenz" args+ where args+ = [to k1sv, to k2rv, to k3bv, to k4h, to i5x, to i6y, to i7z,+ to i8skip]+ ++ map to i0init+++-- | * opcode : planet+-- +-- +-- * syntax : +-- +-- > ax, ay, az planet kmass1, kmass2, ksep, ix, iy, iz, ivx, ivy, ivz, idelta +-- > [, ifriction] [, iskip]+-- +-- +-- * description : +-- +-- planet simulates a planet orbiting in a binary star system. The+-- outputs are the x, y and z coordinates of the orbiting planet. It+-- is possible for the planet to achieve escape velocity by a close+-- encounter with a star. This makes this system somewhat unstable.+-- +-- +-- * url : <http://www.csounds.com/manual/html/planet.html>+ +planet ::+ (K k0, K k1, K k2) =>+ [Irate] ->+ k0 ->+ k1 ->+ k2 ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> MultiOut+planet i0init k1mass1 k2mass2 k3sep i4x i5y i6z i7vx i8vy i9vz+ i10delta = opcode "planet" args+ where args+ = [to k1mass1, to k2mass2, to k3sep, to i4x, to i5y, to i6z,+ to i7vx, to i8vy, to i9vz, to i10delta]+ ++ map to i0init+++-- | * opcode : prepiano+-- +-- +-- * syntax : +-- +-- > ares prepiano ifreq, iNS, iD, iK, +-- > iT30,iB, kbcl, kbcr, imass, ifreq, iinit, ipos, ivel, isfreq, +-- > isspread[, irattles, irubbers]+-- > al,ar prepiano ifreq, iNS, iD, iK, +-- > iT30,iB, kbcl, kbcr, imass, ifreq, iinit, ipos, ivel, isfreq, +-- > isspread[, irattles, irubbers]+-- +-- +-- * description : +-- +-- Audio output is a tone similar to a piano string, prepared with+-- a number of rubbers and rattles. The method uses a physical model+-- developed from solving the partial differential equation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/prepiano.html>+ +prepiano ::+ (K k0, K k1) =>+ [Irate] ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ k0 ->+ k1 ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> MultiOut+prepiano i0init i1freq i2NS i3D i4K i5T30 i6B k7bcl k8bcr i9mass+ i10freq i11init i12pos i13vel i14sfreq i15sspread+ = opcode "prepiano" args+ where args+ = [to i1freq, to i2NS, to i3D, to i4K, to i5T30, to i6B, to k7bcl,+ to k8bcr, to i9mass, to i10freq, to i11init, to i12pos, to i13vel,+ to i14sfreq, to i15sspread]+ ++ map to i0init+++-- | * opcode : prepiano+-- +-- +-- * syntax : +-- +-- > ares prepiano ifreq, iNS, iD, iK, +-- > iT30,iB, kbcl, kbcr, imass, ifreq, iinit, ipos, ivel, isfreq, +-- > isspread[, irattles, irubbers]+-- > al,ar prepiano ifreq, iNS, iD, iK, +-- > iT30,iB, kbcl, kbcr, imass, ifreq, iinit, ipos, ivel, isfreq, +-- > isspread[, irattles, irubbers]+-- +-- +-- * description : +-- +-- Audio output is a tone similar to a piano string, prepared with+-- a number of rubbers and rattles. The method uses a physical model+-- developed from solving the partial differential equation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/prepiano.html>+ +prepianoA ::+ (K k0, K k1) =>+ [Irate] ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ k0 ->+ k1 ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> Arate+prepianoA i0init i1freq i2NS i3D i4K i5T30 i6B k7bcl k8bcr i9mass+ i10freq i11init i12pos i13vel i14sfreq i15sspread+ = opcode "prepiano" args+ where args+ = [to i1freq, to i2NS, to i3D, to i4K, to i5T30, to i6B, to k7bcl,+ to k8bcr, to i9mass, to i10freq, to i11init, to i12pos, to i13vel,+ to i14sfreq, to i15sspread]+ ++ map to i0init+++-- | * opcode : mandel+-- +-- +-- * syntax : +-- +-- > kiter, koutrig mandel ktrig, kx, ky, kmaxIter+-- +-- +-- * description : +-- +-- Returns the number of iterations corresponding to a given point+-- of complex plane by applying the Mandelbrot set formula.+-- +-- +-- * url : <http://www.csounds.com/manual/html/mandel.html>+ +mandel ::+ (K k0, K k1, K k2, K k3) => k0 -> k1 -> k2 -> k3 -> MultiOut+mandel k0trig k1x k2y k3maxIter = opcode "mandel" args+ where args = [to k0trig, to k1x, to k2y, to k3maxIter]+++-- | * opcode : chuap+-- +-- +-- * syntax : +-- +-- > aI3, aV2, aV1 chuap kL, kR0, kC1, kG, kGa, kGb, kE, kC2, iI3, iV2, iV1, ktime_step+-- +-- +-- * description : +-- +-- Simulates Chua's oscillator, an LRC oscillator with an active+-- resistor, proved capable of bifurcation and chaotic attractors,+-- with k-rate control of circuit elements.+-- +-- +-- * url : <http://www.csounds.com/manual/html/chuap.html>+ +chuap ::+ (K k0, K k1, K k2, K k3, K k4, K k5, K k6, K k7, K k8) =>+ k0 ->+ k1 ->+ k2 ->+ k3 ->+ k4 -> k5 -> k6 -> k7 -> Irate -> Irate -> Irate -> k8 -> MultiOut+chuap k0L k1R0 k2C1 k3G k4Ga k5Gb k6E k7C2 i8I3 i9V2 i10V1+ k11time_step = opcode "chuap" args+ where args+ = [to k0L, to k1R0, to k2C1, to k3G, to k4Ga, to k5Gb, to k6E,+ to k7C2, to i8I3, to i9V2, to i10V1, to k11time_step]
+ src/CsoundExpr/Opcodes/Siggen/Noise.hs view
@@ -0,0 +1,2725 @@+-- | Random (Noise) Generators+module CsoundExpr.Opcodes.Siggen.Noise+ (bexprndA',+ bexprndA,+ bexprndI',+ bexprndI,+ bexprndK',+ bexprndK,+ cauchyA',+ cauchyA,+ cauchyI',+ cauchyI,+ cauchyK',+ cauchyK,+ cuserrndA',+ cuserrndA,+ cuserrndI',+ cuserrndI,+ cuserrndK',+ cuserrndK,+ duserrndA',+ duserrndA,+ duserrndI',+ duserrndI,+ duserrndK',+ duserrndK,+ exprandA',+ exprandA,+ exprandI',+ exprandI,+ exprandK',+ exprandK,+ gaussA',+ gaussA,+ gaussI',+ gaussI,+ gaussK',+ gaussK,+ linrandA',+ linrandA,+ linrandI',+ linrandI,+ linrandK',+ linrandK,+ noise',+ noise,+ pcauchyA',+ pcauchyA,+ pcauchyI',+ pcauchyI,+ pcauchyK',+ pcauchyK,+ pinkish',+ pinkish,+ poissonA',+ poissonA,+ poissonI',+ poissonI,+ poissonK',+ poissonK,+ randA,+ randK,+ randhA,+ randhK,+ randiA,+ randiK,+ rnd31A',+ rnd31A,+ rnd31I',+ rnd31I,+ rnd31K',+ rnd31K,+ randomA',+ randomA,+ randomI',+ randomI,+ randomK',+ randomK,+ randomhA',+ randomhA,+ randomhK',+ randomhK,+ randomiA',+ randomiA,+ randomiK',+ randomiK,+ trirandA',+ trirandA,+ trirandI',+ trirandI,+ trirandK',+ trirandK,+ unirandA',+ unirandA,+ unirandI',+ unirandI,+ unirandK',+ unirandK,+ urdA',+ urdA,+ urdI',+ urdI,+ urdK',+ urdK,+ weibullA',+ weibullA,+ weibullI',+ weibullI,+ weibullK',+ weibullK,+ jitter',+ jitter,+ jitter2',+ jitter2,+ trandom',+ trandom)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : bexprnd+-- +-- +-- * syntax : +-- +-- > ares bexprnd krange+-- > ires bexprnd krange+-- > kres bexprnd krange+-- +-- +-- * description : +-- +-- Exponential distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bexprnd.html>+ +bexprndA' :: (K k0) => k0 -> Arate+bexprndA' k0range = opcode "bexprnd" args+ where args = [to k0range]+++-- | * opcode : bexprnd+-- +-- +-- * syntax : +-- +-- > ares bexprnd krange+-- > ires bexprnd krange+-- > kres bexprnd krange+-- +-- +-- * description : +-- +-- Exponential distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bexprnd.html>+ +bexprndA :: (K k0) => k0 -> SideEffect Arate+bexprndA k0range = opcode "bexprnd" args+ where args = [to k0range]+++-- | * opcode : bexprnd+-- +-- +-- * syntax : +-- +-- > ares bexprnd krange+-- > ires bexprnd krange+-- > kres bexprnd krange+-- +-- +-- * description : +-- +-- Exponential distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bexprnd.html>+ +bexprndI' :: (K k0) => k0 -> Irate+bexprndI' k0range = opcode "bexprnd" args+ where args = [to k0range]+++-- | * opcode : bexprnd+-- +-- +-- * syntax : +-- +-- > ares bexprnd krange+-- > ires bexprnd krange+-- > kres bexprnd krange+-- +-- +-- * description : +-- +-- Exponential distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bexprnd.html>+ +bexprndI :: (K k0) => k0 -> SideEffect Irate+bexprndI k0range = opcode "bexprnd" args+ where args = [to k0range]+++-- | * opcode : bexprnd+-- +-- +-- * syntax : +-- +-- > ares bexprnd krange+-- > ires bexprnd krange+-- > kres bexprnd krange+-- +-- +-- * description : +-- +-- Exponential distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bexprnd.html>+ +bexprndK' :: (K k0) => k0 -> Krate+bexprndK' k0range = opcode "bexprnd" args+ where args = [to k0range]+++-- | * opcode : bexprnd+-- +-- +-- * syntax : +-- +-- > ares bexprnd krange+-- > ires bexprnd krange+-- > kres bexprnd krange+-- +-- +-- * description : +-- +-- Exponential distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bexprnd.html>+ +bexprndK :: (K k0) => k0 -> SideEffect Krate+bexprndK k0range = opcode "bexprnd" args+ where args = [to k0range]+++-- | * opcode : cauchy+-- +-- +-- * syntax : +-- +-- > ares cauchy kalpha+-- > ires cauchy kalpha+-- > kres cauchy kalpha+-- +-- +-- * description : +-- +-- Cauchy distribution random number generator. This is an x-class+-- noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cauchy.html>+ +cauchyA' :: (K k0) => k0 -> Arate+cauchyA' k0alpha = opcode "cauchy" args+ where args = [to k0alpha]+++-- | * opcode : cauchy+-- +-- +-- * syntax : +-- +-- > ares cauchy kalpha+-- > ires cauchy kalpha+-- > kres cauchy kalpha+-- +-- +-- * description : +-- +-- Cauchy distribution random number generator. This is an x-class+-- noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cauchy.html>+ +cauchyA :: (K k0) => k0 -> SideEffect Arate+cauchyA k0alpha = opcode "cauchy" args+ where args = [to k0alpha]+++-- | * opcode : cauchy+-- +-- +-- * syntax : +-- +-- > ares cauchy kalpha+-- > ires cauchy kalpha+-- > kres cauchy kalpha+-- +-- +-- * description : +-- +-- Cauchy distribution random number generator. This is an x-class+-- noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cauchy.html>+ +cauchyI' :: (K k0) => k0 -> Irate+cauchyI' k0alpha = opcode "cauchy" args+ where args = [to k0alpha]+++-- | * opcode : cauchy+-- +-- +-- * syntax : +-- +-- > ares cauchy kalpha+-- > ires cauchy kalpha+-- > kres cauchy kalpha+-- +-- +-- * description : +-- +-- Cauchy distribution random number generator. This is an x-class+-- noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cauchy.html>+ +cauchyI :: (K k0) => k0 -> SideEffect Irate+cauchyI k0alpha = opcode "cauchy" args+ where args = [to k0alpha]+++-- | * opcode : cauchy+-- +-- +-- * syntax : +-- +-- > ares cauchy kalpha+-- > ires cauchy kalpha+-- > kres cauchy kalpha+-- +-- +-- * description : +-- +-- Cauchy distribution random number generator. This is an x-class+-- noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cauchy.html>+ +cauchyK' :: (K k0) => k0 -> Krate+cauchyK' k0alpha = opcode "cauchy" args+ where args = [to k0alpha]+++-- | * opcode : cauchy+-- +-- +-- * syntax : +-- +-- > ares cauchy kalpha+-- > ires cauchy kalpha+-- > kres cauchy kalpha+-- +-- +-- * description : +-- +-- Cauchy distribution random number generator. This is an x-class+-- noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cauchy.html>+ +cauchyK :: (K k0) => k0 -> SideEffect Krate+cauchyK k0alpha = opcode "cauchy" args+ where args = [to k0alpha]+++-- | * opcode : cuserrnd+-- +-- +-- * syntax : +-- +-- > aout cuserrnd kmin, kmax, ktableNum+-- > iout cuserrnd imin, imax, itableNum+-- > kout cuserrnd kmin, kmax, ktableNum+-- +-- +-- * description : +-- +-- Continuous USER-defined-distribution RaNDom generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cuserrnd.html>+ +cuserrndA' :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Arate+cuserrndA' k0min k1max k2tableNum = opcode "cuserrnd" args+ where args = [to k0min, to k1max, to k2tableNum]+++-- | * opcode : cuserrnd+-- +-- +-- * syntax : +-- +-- > aout cuserrnd kmin, kmax, ktableNum+-- > iout cuserrnd imin, imax, itableNum+-- > kout cuserrnd kmin, kmax, ktableNum+-- +-- +-- * description : +-- +-- Continuous USER-defined-distribution RaNDom generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cuserrnd.html>+ +cuserrndA ::+ (K k0, K k1, K k2) => k0 -> k1 -> k2 -> SideEffect Arate+cuserrndA k0min k1max k2tableNum = opcode "cuserrnd" args+ where args = [to k0min, to k1max, to k2tableNum]+++-- | * opcode : cuserrnd+-- +-- +-- * syntax : +-- +-- > aout cuserrnd kmin, kmax, ktableNum+-- > iout cuserrnd imin, imax, itableNum+-- > kout cuserrnd kmin, kmax, ktableNum+-- +-- +-- * description : +-- +-- Continuous USER-defined-distribution RaNDom generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cuserrnd.html>+ +cuserrndI' :: Irate -> Irate -> Irate -> Irate+cuserrndI' i0min i1max i2tableNum = opcode "cuserrnd" args+ where args = [to i0min, to i1max, to i2tableNum]+++-- | * opcode : cuserrnd+-- +-- +-- * syntax : +-- +-- > aout cuserrnd kmin, kmax, ktableNum+-- > iout cuserrnd imin, imax, itableNum+-- > kout cuserrnd kmin, kmax, ktableNum+-- +-- +-- * description : +-- +-- Continuous USER-defined-distribution RaNDom generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cuserrnd.html>+ +cuserrndI :: Irate -> Irate -> Irate -> SideEffect Irate+cuserrndI i0min i1max i2tableNum = opcode "cuserrnd" args+ where args = [to i0min, to i1max, to i2tableNum]+++-- | * opcode : cuserrnd+-- +-- +-- * syntax : +-- +-- > aout cuserrnd kmin, kmax, ktableNum+-- > iout cuserrnd imin, imax, itableNum+-- > kout cuserrnd kmin, kmax, ktableNum+-- +-- +-- * description : +-- +-- Continuous USER-defined-distribution RaNDom generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cuserrnd.html>+ +cuserrndK' :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+cuserrndK' k0min k1max k2tableNum = opcode "cuserrnd" args+ where args = [to k0min, to k1max, to k2tableNum]+++-- | * opcode : cuserrnd+-- +-- +-- * syntax : +-- +-- > aout cuserrnd kmin, kmax, ktableNum+-- > iout cuserrnd imin, imax, itableNum+-- > kout cuserrnd kmin, kmax, ktableNum+-- +-- +-- * description : +-- +-- Continuous USER-defined-distribution RaNDom generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cuserrnd.html>+ +cuserrndK ::+ (K k0, K k1, K k2) => k0 -> k1 -> k2 -> SideEffect Krate+cuserrndK k0min k1max k2tableNum = opcode "cuserrnd" args+ where args = [to k0min, to k1max, to k2tableNum]+++-- | * opcode : duserrnd+-- +-- +-- * syntax : +-- +-- > aout duserrnd ktableNum+-- > iout duserrnd itableNum+-- > kout duserrnd ktableNum+-- +-- +-- * description : +-- +-- Discrete USER-defined-distribution RaNDom generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/duserrnd.html>+ +duserrndA' :: (K k0) => k0 -> Arate+duserrndA' k0tableNum = opcode "duserrnd" args+ where args = [to k0tableNum]+++-- | * opcode : duserrnd+-- +-- +-- * syntax : +-- +-- > aout duserrnd ktableNum+-- > iout duserrnd itableNum+-- > kout duserrnd ktableNum+-- +-- +-- * description : +-- +-- Discrete USER-defined-distribution RaNDom generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/duserrnd.html>+ +duserrndA :: (K k0) => k0 -> SideEffect Arate+duserrndA k0tableNum = opcode "duserrnd" args+ where args = [to k0tableNum]+++-- | * opcode : duserrnd+-- +-- +-- * syntax : +-- +-- > aout duserrnd ktableNum+-- > iout duserrnd itableNum+-- > kout duserrnd ktableNum+-- +-- +-- * description : +-- +-- Discrete USER-defined-distribution RaNDom generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/duserrnd.html>+ +duserrndI' :: Irate -> Irate+duserrndI' i0tableNum = opcode "duserrnd" args+ where args = [to i0tableNum]+++-- | * opcode : duserrnd+-- +-- +-- * syntax : +-- +-- > aout duserrnd ktableNum+-- > iout duserrnd itableNum+-- > kout duserrnd ktableNum+-- +-- +-- * description : +-- +-- Discrete USER-defined-distribution RaNDom generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/duserrnd.html>+ +duserrndI :: Irate -> SideEffect Irate+duserrndI i0tableNum = opcode "duserrnd" args+ where args = [to i0tableNum]+++-- | * opcode : duserrnd+-- +-- +-- * syntax : +-- +-- > aout duserrnd ktableNum+-- > iout duserrnd itableNum+-- > kout duserrnd ktableNum+-- +-- +-- * description : +-- +-- Discrete USER-defined-distribution RaNDom generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/duserrnd.html>+ +duserrndK' :: (K k0) => k0 -> Krate+duserrndK' k0tableNum = opcode "duserrnd" args+ where args = [to k0tableNum]+++-- | * opcode : duserrnd+-- +-- +-- * syntax : +-- +-- > aout duserrnd ktableNum+-- > iout duserrnd itableNum+-- > kout duserrnd ktableNum+-- +-- +-- * description : +-- +-- Discrete USER-defined-distribution RaNDom generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/duserrnd.html>+ +duserrndK :: (K k0) => k0 -> SideEffect Krate+duserrndK k0tableNum = opcode "duserrnd" args+ where args = [to k0tableNum]+++-- | * opcode : exprand+-- +-- +-- * syntax : +-- +-- > ares exprand klambda+-- > ires exprand klambda+-- > kres exprand klambda+-- +-- +-- * description : +-- +-- Exponential distribution random number generator (positive+-- values only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/exprand.html>+ +exprandA' :: (K k0) => k0 -> Arate+exprandA' k0lambda = opcode "exprand" args+ where args = [to k0lambda]+++-- | * opcode : exprand+-- +-- +-- * syntax : +-- +-- > ares exprand klambda+-- > ires exprand klambda+-- > kres exprand klambda+-- +-- +-- * description : +-- +-- Exponential distribution random number generator (positive+-- values only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/exprand.html>+ +exprandA :: (K k0) => k0 -> SideEffect Arate+exprandA k0lambda = opcode "exprand" args+ where args = [to k0lambda]+++-- | * opcode : exprand+-- +-- +-- * syntax : +-- +-- > ares exprand klambda+-- > ires exprand klambda+-- > kres exprand klambda+-- +-- +-- * description : +-- +-- Exponential distribution random number generator (positive+-- values only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/exprand.html>+ +exprandI' :: (K k0) => k0 -> Irate+exprandI' k0lambda = opcode "exprand" args+ where args = [to k0lambda]+++-- | * opcode : exprand+-- +-- +-- * syntax : +-- +-- > ares exprand klambda+-- > ires exprand klambda+-- > kres exprand klambda+-- +-- +-- * description : +-- +-- Exponential distribution random number generator (positive+-- values only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/exprand.html>+ +exprandI :: (K k0) => k0 -> SideEffect Irate+exprandI k0lambda = opcode "exprand" args+ where args = [to k0lambda]+++-- | * opcode : exprand+-- +-- +-- * syntax : +-- +-- > ares exprand klambda+-- > ires exprand klambda+-- > kres exprand klambda+-- +-- +-- * description : +-- +-- Exponential distribution random number generator (positive+-- values only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/exprand.html>+ +exprandK' :: (K k0) => k0 -> Krate+exprandK' k0lambda = opcode "exprand" args+ where args = [to k0lambda]+++-- | * opcode : exprand+-- +-- +-- * syntax : +-- +-- > ares exprand klambda+-- > ires exprand klambda+-- > kres exprand klambda+-- +-- +-- * description : +-- +-- Exponential distribution random number generator (positive+-- values only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/exprand.html>+ +exprandK :: (K k0) => k0 -> SideEffect Krate+exprandK k0lambda = opcode "exprand" args+ where args = [to k0lambda]+++-- | * opcode : gauss+-- +-- +-- * syntax : +-- +-- > ares gauss krange+-- > ires gauss krange+-- > kres gauss krange+-- +-- +-- * description : +-- +-- Gaussian distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/gauss.html>+ +gaussA' :: (K k0) => k0 -> Arate+gaussA' k0range = opcode "gauss" args+ where args = [to k0range]+++-- | * opcode : gauss+-- +-- +-- * syntax : +-- +-- > ares gauss krange+-- > ires gauss krange+-- > kres gauss krange+-- +-- +-- * description : +-- +-- Gaussian distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/gauss.html>+ +gaussA :: (K k0) => k0 -> SideEffect Arate+gaussA k0range = opcode "gauss" args+ where args = [to k0range]+++-- | * opcode : gauss+-- +-- +-- * syntax : +-- +-- > ares gauss krange+-- > ires gauss krange+-- > kres gauss krange+-- +-- +-- * description : +-- +-- Gaussian distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/gauss.html>+ +gaussI' :: (K k0) => k0 -> Irate+gaussI' k0range = opcode "gauss" args+ where args = [to k0range]+++-- | * opcode : gauss+-- +-- +-- * syntax : +-- +-- > ares gauss krange+-- > ires gauss krange+-- > kres gauss krange+-- +-- +-- * description : +-- +-- Gaussian distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/gauss.html>+ +gaussI :: (K k0) => k0 -> SideEffect Irate+gaussI k0range = opcode "gauss" args+ where args = [to k0range]+++-- | * opcode : gauss+-- +-- +-- * syntax : +-- +-- > ares gauss krange+-- > ires gauss krange+-- > kres gauss krange+-- +-- +-- * description : +-- +-- Gaussian distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/gauss.html>+ +gaussK' :: (K k0) => k0 -> Krate+gaussK' k0range = opcode "gauss" args+ where args = [to k0range]+++-- | * opcode : gauss+-- +-- +-- * syntax : +-- +-- > ares gauss krange+-- > ires gauss krange+-- > kres gauss krange+-- +-- +-- * description : +-- +-- Gaussian distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/gauss.html>+ +gaussK :: (K k0) => k0 -> SideEffect Krate+gaussK k0range = opcode "gauss" args+ where args = [to k0range]+++-- | * opcode : linrand+-- +-- +-- * syntax : +-- +-- > ares linrand krange+-- > ires linrand krange+-- > kres linrand krange+-- +-- +-- * description : +-- +-- Linear distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linrand.html>+ +linrandA' :: (K k0) => k0 -> Arate+linrandA' k0range = opcode "linrand" args+ where args = [to k0range]+++-- | * opcode : linrand+-- +-- +-- * syntax : +-- +-- > ares linrand krange+-- > ires linrand krange+-- > kres linrand krange+-- +-- +-- * description : +-- +-- Linear distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linrand.html>+ +linrandA :: (K k0) => k0 -> SideEffect Arate+linrandA k0range = opcode "linrand" args+ where args = [to k0range]+++-- | * opcode : linrand+-- +-- +-- * syntax : +-- +-- > ares linrand krange+-- > ires linrand krange+-- > kres linrand krange+-- +-- +-- * description : +-- +-- Linear distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linrand.html>+ +linrandI' :: (K k0) => k0 -> Irate+linrandI' k0range = opcode "linrand" args+ where args = [to k0range]+++-- | * opcode : linrand+-- +-- +-- * syntax : +-- +-- > ares linrand krange+-- > ires linrand krange+-- > kres linrand krange+-- +-- +-- * description : +-- +-- Linear distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linrand.html>+ +linrandI :: (K k0) => k0 -> SideEffect Irate+linrandI k0range = opcode "linrand" args+ where args = [to k0range]+++-- | * opcode : linrand+-- +-- +-- * syntax : +-- +-- > ares linrand krange+-- > ires linrand krange+-- > kres linrand krange+-- +-- +-- * description : +-- +-- Linear distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linrand.html>+ +linrandK' :: (K k0) => k0 -> Krate+linrandK' k0range = opcode "linrand" args+ where args = [to k0range]+++-- | * opcode : linrand+-- +-- +-- * syntax : +-- +-- > ares linrand krange+-- > ires linrand krange+-- > kres linrand krange+-- +-- +-- * description : +-- +-- Linear distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/linrand.html>+ +linrandK :: (K k0) => k0 -> SideEffect Krate+linrandK k0range = opcode "linrand" args+ where args = [to k0range]+++-- | * opcode : noise+-- +-- +-- * syntax : +-- +-- > ares noise xamp, kbeta+-- +-- +-- * description : +-- +-- A white noise generator with an IIR lowpass filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/noise.html>+ +noise' :: (X x0, K k0) => x0 -> k0 -> Arate+noise' x0amp k1beta = opcode "noise" args+ where args = [to x0amp, to k1beta]+++-- | * opcode : noise+-- +-- +-- * syntax : +-- +-- > ares noise xamp, kbeta+-- +-- +-- * description : +-- +-- A white noise generator with an IIR lowpass filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/noise.html>+ +noise :: (X x0, K k0) => x0 -> k0 -> SideEffect Arate+noise x0amp k1beta = opcode "noise" args+ where args = [to x0amp, to k1beta]+++-- | * opcode : pcauchy+-- +-- +-- * syntax : +-- +-- > ares pcauchy kalpha+-- > ires pcauchy kalpha+-- > kres pcauchy kalpha+-- +-- +-- * description : +-- +-- Cauchy distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pcauchy.html>+ +pcauchyA' :: (K k0) => k0 -> Arate+pcauchyA' k0alpha = opcode "pcauchy" args+ where args = [to k0alpha]+++-- | * opcode : pcauchy+-- +-- +-- * syntax : +-- +-- > ares pcauchy kalpha+-- > ires pcauchy kalpha+-- > kres pcauchy kalpha+-- +-- +-- * description : +-- +-- Cauchy distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pcauchy.html>+ +pcauchyA :: (K k0) => k0 -> SideEffect Arate+pcauchyA k0alpha = opcode "pcauchy" args+ where args = [to k0alpha]+++-- | * opcode : pcauchy+-- +-- +-- * syntax : +-- +-- > ares pcauchy kalpha+-- > ires pcauchy kalpha+-- > kres pcauchy kalpha+-- +-- +-- * description : +-- +-- Cauchy distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pcauchy.html>+ +pcauchyI' :: (K k0) => k0 -> Irate+pcauchyI' k0alpha = opcode "pcauchy" args+ where args = [to k0alpha]+++-- | * opcode : pcauchy+-- +-- +-- * syntax : +-- +-- > ares pcauchy kalpha+-- > ires pcauchy kalpha+-- > kres pcauchy kalpha+-- +-- +-- * description : +-- +-- Cauchy distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pcauchy.html>+ +pcauchyI :: (K k0) => k0 -> SideEffect Irate+pcauchyI k0alpha = opcode "pcauchy" args+ where args = [to k0alpha]+++-- | * opcode : pcauchy+-- +-- +-- * syntax : +-- +-- > ares pcauchy kalpha+-- > ires pcauchy kalpha+-- > kres pcauchy kalpha+-- +-- +-- * description : +-- +-- Cauchy distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pcauchy.html>+ +pcauchyK' :: (K k0) => k0 -> Krate+pcauchyK' k0alpha = opcode "pcauchy" args+ where args = [to k0alpha]+++-- | * opcode : pcauchy+-- +-- +-- * syntax : +-- +-- > ares pcauchy kalpha+-- > ires pcauchy kalpha+-- > kres pcauchy kalpha+-- +-- +-- * description : +-- +-- Cauchy distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pcauchy.html>+ +pcauchyK :: (K k0) => k0 -> SideEffect Krate+pcauchyK k0alpha = opcode "pcauchy" args+ where args = [to k0alpha]+++-- | * opcode : pinkish+-- +-- +-- * syntax : +-- +-- > ares pinkish xin [, imethod] [, inumbands] [, iseed] [, iskip]+-- +-- +-- * description : +-- +-- Generates approximate pink noise (-3dB/oct response) by one of+-- two different methods:+-- +-- +-- * url : <http://www.csounds.com/manual/html/pinkish.html>+ +pinkish' :: (X x0) => [Irate] -> x0 -> Arate+pinkish' i0init x1in = opcode "pinkish" args+ where args = [to x1in] ++ map to i0init+++-- | * opcode : pinkish+-- +-- +-- * syntax : +-- +-- > ares pinkish xin [, imethod] [, inumbands] [, iseed] [, iskip]+-- +-- +-- * description : +-- +-- Generates approximate pink noise (-3dB/oct response) by one of+-- two different methods:+-- +-- +-- * url : <http://www.csounds.com/manual/html/pinkish.html>+ +pinkish :: (X x0) => [Irate] -> x0 -> SideEffect Arate+pinkish i0init x1in = opcode "pinkish" args+ where args = [to x1in] ++ map to i0init+++-- | * opcode : poisson+-- +-- +-- * syntax : +-- +-- > ares poisson klambda+-- > ires poisson klambda+-- > kres poisson klambda+-- +-- +-- * description : +-- +-- Poisson distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poisson.html>+ +poissonA' :: (K k0) => k0 -> Arate+poissonA' k0lambda = opcode "poisson" args+ where args = [to k0lambda]+++-- | * opcode : poisson+-- +-- +-- * syntax : +-- +-- > ares poisson klambda+-- > ires poisson klambda+-- > kres poisson klambda+-- +-- +-- * description : +-- +-- Poisson distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poisson.html>+ +poissonA :: (K k0) => k0 -> SideEffect Arate+poissonA k0lambda = opcode "poisson" args+ where args = [to k0lambda]+++-- | * opcode : poisson+-- +-- +-- * syntax : +-- +-- > ares poisson klambda+-- > ires poisson klambda+-- > kres poisson klambda+-- +-- +-- * description : +-- +-- Poisson distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poisson.html>+ +poissonI' :: (K k0) => k0 -> Irate+poissonI' k0lambda = opcode "poisson" args+ where args = [to k0lambda]+++-- | * opcode : poisson+-- +-- +-- * syntax : +-- +-- > ares poisson klambda+-- > ires poisson klambda+-- > kres poisson klambda+-- +-- +-- * description : +-- +-- Poisson distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poisson.html>+ +poissonI :: (K k0) => k0 -> SideEffect Irate+poissonI k0lambda = opcode "poisson" args+ where args = [to k0lambda]+++-- | * opcode : poisson+-- +-- +-- * syntax : +-- +-- > ares poisson klambda+-- > ires poisson klambda+-- > kres poisson klambda+-- +-- +-- * description : +-- +-- Poisson distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poisson.html>+ +poissonK' :: (K k0) => k0 -> Krate+poissonK' k0lambda = opcode "poisson" args+ where args = [to k0lambda]+++-- | * opcode : poisson+-- +-- +-- * syntax : +-- +-- > ares poisson klambda+-- > ires poisson klambda+-- > kres poisson klambda+-- +-- +-- * description : +-- +-- Poisson distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/poisson.html>+ +poissonK :: (K k0) => k0 -> SideEffect Krate+poissonK k0lambda = opcode "poisson" args+ where args = [to k0lambda]+++-- | * opcode : rand+-- +-- +-- * syntax : +-- +-- > ares rand xamp [, iseed] [, isel] [, ioffset]+-- > kres rand xamp [, iseed] [, isel] [, ioffset]+-- +-- +-- * description : +-- +-- Output is a controlled random number series between -amp and+-- +amp+-- +-- +-- * url : <http://www.csounds.com/manual/html/rand.html>+ +randA :: (X x0) => [Irate] -> x0 -> Arate+randA i0init x1amp = opcode "rand" args+ where args = [to x1amp] ++ map to i0init+++-- | * opcode : rand+-- +-- +-- * syntax : +-- +-- > ares rand xamp [, iseed] [, isel] [, ioffset]+-- > kres rand xamp [, iseed] [, isel] [, ioffset]+-- +-- +-- * description : +-- +-- Output is a controlled random number series between -amp and+-- +amp+-- +-- +-- * url : <http://www.csounds.com/manual/html/rand.html>+ +randK :: (X x0) => [Irate] -> x0 -> Krate+randK i0init x1amp = opcode "rand" args+ where args = [to x1amp] ++ map to i0init+++-- | * opcode : randh+-- +-- +-- * syntax : +-- +-- > ares randh xamp, xcps [, iseed] [, isize] [, ioffset]+-- > kres randh kamp, kcps [, iseed] [, isize] [, ioffset]+-- +-- +-- * description : +-- +-- Generates random numbers and holds them for a period of time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/randh.html>+ +randhA :: (X x0, X x1) => [Irate] -> x0 -> x1 -> Arate+randhA i0init x1amp x2cps = opcode "randh" args+ where args = [to x1amp, to x2cps] ++ map to i0init+++-- | * opcode : randh+-- +-- +-- * syntax : +-- +-- > ares randh xamp, xcps [, iseed] [, isize] [, ioffset]+-- > kres randh kamp, kcps [, iseed] [, isize] [, ioffset]+-- +-- +-- * description : +-- +-- Generates random numbers and holds them for a period of time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/randh.html>+ +randhK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Krate+randhK i0init k1amp k2cps = opcode "randh" args+ where args = [to k1amp, to k2cps] ++ map to i0init+++-- | * opcode : randi+-- +-- +-- * syntax : +-- +-- > ares randi xamp, xcps [, iseed] [, isize] [, ioffset]+-- > kres randi kamp, kcps [, iseed] [, isize] [, ioffset]+-- +-- +-- * description : +-- +-- Generates a controlled random number series with interpolation+-- between each new number.+-- +-- +-- * url : <http://www.csounds.com/manual/html/randi.html>+ +randiA :: (X x0, X x1) => [Irate] -> x0 -> x1 -> Arate+randiA i0init x1amp x2cps = opcode "randi" args+ where args = [to x1amp, to x2cps] ++ map to i0init+++-- | * opcode : randi+-- +-- +-- * syntax : +-- +-- > ares randi xamp, xcps [, iseed] [, isize] [, ioffset]+-- > kres randi kamp, kcps [, iseed] [, isize] [, ioffset]+-- +-- +-- * description : +-- +-- Generates a controlled random number series with interpolation+-- between each new number.+-- +-- +-- * url : <http://www.csounds.com/manual/html/randi.html>+ +randiK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Krate+randiK i0init k1amp k2cps = opcode "randi" args+ where args = [to k1amp, to k2cps] ++ map to i0init+++-- | * opcode : rnd31+-- +-- +-- * syntax : +-- +-- > ax rnd31 kscl, krpow [, iseed]+-- > ix rnd31 iscl, irpow [, iseed]+-- > kx rnd31 kscl, krpow [, iseed]+-- +-- +-- * description : +-- +-- 31-bit bipolar random opcodes with controllable distribution.+-- These units are portable, i.e. using the same seed value will+-- generate the same random sequence on all systems. The+-- distribution of generated random numbers can be varied at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rnd31.html>+ +rnd31A' :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Arate+rnd31A' i0init k1scl k2rpow = opcode "rnd31" args+ where args = [to k1scl, to k2rpow] ++ map to i0init+++-- | * opcode : rnd31+-- +-- +-- * syntax : +-- +-- > ax rnd31 kscl, krpow [, iseed]+-- > ix rnd31 iscl, irpow [, iseed]+-- > kx rnd31 kscl, krpow [, iseed]+-- +-- +-- * description : +-- +-- 31-bit bipolar random opcodes with controllable distribution.+-- These units are portable, i.e. using the same seed value will+-- generate the same random sequence on all systems. The+-- distribution of generated random numbers can be varied at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rnd31.html>+ +rnd31A :: (K k0, K k1) => [Irate] -> k0 -> k1 -> SideEffect Arate+rnd31A i0init k1scl k2rpow = opcode "rnd31" args+ where args = [to k1scl, to k2rpow] ++ map to i0init+++-- | * opcode : rnd31+-- +-- +-- * syntax : +-- +-- > ax rnd31 kscl, krpow [, iseed]+-- > ix rnd31 iscl, irpow [, iseed]+-- > kx rnd31 kscl, krpow [, iseed]+-- +-- +-- * description : +-- +-- 31-bit bipolar random opcodes with controllable distribution.+-- These units are portable, i.e. using the same seed value will+-- generate the same random sequence on all systems. The+-- distribution of generated random numbers can be varied at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rnd31.html>+ +rnd31I' :: [Irate] -> Irate -> Irate -> Irate+rnd31I' i0init i1scl i2rpow = opcode "rnd31" args+ where args = [to i1scl, to i2rpow] ++ map to i0init+++-- | * opcode : rnd31+-- +-- +-- * syntax : +-- +-- > ax rnd31 kscl, krpow [, iseed]+-- > ix rnd31 iscl, irpow [, iseed]+-- > kx rnd31 kscl, krpow [, iseed]+-- +-- +-- * description : +-- +-- 31-bit bipolar random opcodes with controllable distribution.+-- These units are portable, i.e. using the same seed value will+-- generate the same random sequence on all systems. The+-- distribution of generated random numbers can be varied at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rnd31.html>+ +rnd31I :: [Irate] -> Irate -> Irate -> SideEffect Irate+rnd31I i0init i1scl i2rpow = opcode "rnd31" args+ where args = [to i1scl, to i2rpow] ++ map to i0init+++-- | * opcode : rnd31+-- +-- +-- * syntax : +-- +-- > ax rnd31 kscl, krpow [, iseed]+-- > ix rnd31 iscl, irpow [, iseed]+-- > kx rnd31 kscl, krpow [, iseed]+-- +-- +-- * description : +-- +-- 31-bit bipolar random opcodes with controllable distribution.+-- These units are portable, i.e. using the same seed value will+-- generate the same random sequence on all systems. The+-- distribution of generated random numbers can be varied at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rnd31.html>+ +rnd31K' :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Krate+rnd31K' i0init k1scl k2rpow = opcode "rnd31" args+ where args = [to k1scl, to k2rpow] ++ map to i0init+++-- | * opcode : rnd31+-- +-- +-- * syntax : +-- +-- > ax rnd31 kscl, krpow [, iseed]+-- > ix rnd31 iscl, irpow [, iseed]+-- > kx rnd31 kscl, krpow [, iseed]+-- +-- +-- * description : +-- +-- 31-bit bipolar random opcodes with controllable distribution.+-- These units are portable, i.e. using the same seed value will+-- generate the same random sequence on all systems. The+-- distribution of generated random numbers can be varied at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rnd31.html>+ +rnd31K :: (K k0, K k1) => [Irate] -> k0 -> k1 -> SideEffect Krate+rnd31K i0init k1scl k2rpow = opcode "rnd31" args+ where args = [to k1scl, to k2rpow] ++ map to i0init+++-- | * opcode : random+-- +-- +-- * syntax : +-- +-- > ares random kmin, kmax+-- > ires random imin, imax+-- > kres random kmin, kmax+-- +-- +-- * description : +-- +-- Generates is a controlled pseudo-random number series between+-- min and max values.+-- +-- +-- * url : <http://www.csounds.com/manual/html/random.html>+ +randomA' :: (K k0, K k1) => k0 -> k1 -> Arate+randomA' k0min k1max = opcode "random" args+ where args = [to k0min, to k1max]+++-- | * opcode : random+-- +-- +-- * syntax : +-- +-- > ares random kmin, kmax+-- > ires random imin, imax+-- > kres random kmin, kmax+-- +-- +-- * description : +-- +-- Generates is a controlled pseudo-random number series between+-- min and max values.+-- +-- +-- * url : <http://www.csounds.com/manual/html/random.html>+ +randomA :: (K k0, K k1) => k0 -> k1 -> SideEffect Arate+randomA k0min k1max = opcode "random" args+ where args = [to k0min, to k1max]+++-- | * opcode : random+-- +-- +-- * syntax : +-- +-- > ares random kmin, kmax+-- > ires random imin, imax+-- > kres random kmin, kmax+-- +-- +-- * description : +-- +-- Generates is a controlled pseudo-random number series between+-- min and max values.+-- +-- +-- * url : <http://www.csounds.com/manual/html/random.html>+ +randomI' :: Irate -> Irate -> Irate+randomI' i0min i1max = opcode "random" args+ where args = [to i0min, to i1max]+++-- | * opcode : random+-- +-- +-- * syntax : +-- +-- > ares random kmin, kmax+-- > ires random imin, imax+-- > kres random kmin, kmax+-- +-- +-- * description : +-- +-- Generates is a controlled pseudo-random number series between+-- min and max values.+-- +-- +-- * url : <http://www.csounds.com/manual/html/random.html>+ +randomI :: Irate -> Irate -> SideEffect Irate+randomI i0min i1max = opcode "random" args+ where args = [to i0min, to i1max]+++-- | * opcode : random+-- +-- +-- * syntax : +-- +-- > ares random kmin, kmax+-- > ires random imin, imax+-- > kres random kmin, kmax+-- +-- +-- * description : +-- +-- Generates is a controlled pseudo-random number series between+-- min and max values.+-- +-- +-- * url : <http://www.csounds.com/manual/html/random.html>+ +randomK' :: (K k0, K k1) => k0 -> k1 -> Krate+randomK' k0min k1max = opcode "random" args+ where args = [to k0min, to k1max]+++-- | * opcode : random+-- +-- +-- * syntax : +-- +-- > ares random kmin, kmax+-- > ires random imin, imax+-- > kres random kmin, kmax+-- +-- +-- * description : +-- +-- Generates is a controlled pseudo-random number series between+-- min and max values.+-- +-- +-- * url : <http://www.csounds.com/manual/html/random.html>+ +randomK :: (K k0, K k1) => k0 -> k1 -> SideEffect Krate+randomK k0min k1max = opcode "random" args+ where args = [to k0min, to k1max]+++-- | * opcode : randomh+-- +-- +-- * syntax : +-- +-- > ares randomh kmin, kmax, acps+-- > kres randomh kmin, kmax, kcps+-- +-- +-- * description : +-- +-- Generates random numbers with a user-defined limit and holds+-- them for a period of time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/randomh.html>+ +randomhA' :: (K k0, K k1) => k0 -> k1 -> Arate -> Arate+randomhA' k0min k1max a2cps = opcode "randomh" args+ where args = [to k0min, to k1max, to a2cps]+++-- | * opcode : randomh+-- +-- +-- * syntax : +-- +-- > ares randomh kmin, kmax, acps+-- > kres randomh kmin, kmax, kcps+-- +-- +-- * description : +-- +-- Generates random numbers with a user-defined limit and holds+-- them for a period of time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/randomh.html>+ +randomhA :: (K k0, K k1) => k0 -> k1 -> Arate -> SideEffect Arate+randomhA k0min k1max a2cps = opcode "randomh" args+ where args = [to k0min, to k1max, to a2cps]+++-- | * opcode : randomh+-- +-- +-- * syntax : +-- +-- > ares randomh kmin, kmax, acps+-- > kres randomh kmin, kmax, kcps+-- +-- +-- * description : +-- +-- Generates random numbers with a user-defined limit and holds+-- them for a period of time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/randomh.html>+ +randomhK' :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+randomhK' k0min k1max k2cps = opcode "randomh" args+ where args = [to k0min, to k1max, to k2cps]+++-- | * opcode : randomh+-- +-- +-- * syntax : +-- +-- > ares randomh kmin, kmax, acps+-- > kres randomh kmin, kmax, kcps+-- +-- +-- * description : +-- +-- Generates random numbers with a user-defined limit and holds+-- them for a period of time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/randomh.html>+ +randomhK ::+ (K k0, K k1, K k2) => k0 -> k1 -> k2 -> SideEffect Krate+randomhK k0min k1max k2cps = opcode "randomh" args+ where args = [to k0min, to k1max, to k2cps]+++-- | * opcode : randomi+-- +-- +-- * syntax : +-- +-- > ares randomi kmin, kmax, acps+-- > kres randomi kmin, kmax, kcps+-- +-- +-- * description : +-- +-- Generates a user-controlled random number series with+-- interpolation between each new number.+-- +-- +-- * url : <http://www.csounds.com/manual/html/randomi.html>+ +randomiA' :: (K k0, K k1) => k0 -> k1 -> Arate -> Arate+randomiA' k0min k1max a2cps = opcode "randomi" args+ where args = [to k0min, to k1max, to a2cps]+++-- | * opcode : randomi+-- +-- +-- * syntax : +-- +-- > ares randomi kmin, kmax, acps+-- > kres randomi kmin, kmax, kcps+-- +-- +-- * description : +-- +-- Generates a user-controlled random number series with+-- interpolation between each new number.+-- +-- +-- * url : <http://www.csounds.com/manual/html/randomi.html>+ +randomiA :: (K k0, K k1) => k0 -> k1 -> Arate -> SideEffect Arate+randomiA k0min k1max a2cps = opcode "randomi" args+ where args = [to k0min, to k1max, to a2cps]+++-- | * opcode : randomi+-- +-- +-- * syntax : +-- +-- > ares randomi kmin, kmax, acps+-- > kres randomi kmin, kmax, kcps+-- +-- +-- * description : +-- +-- Generates a user-controlled random number series with+-- interpolation between each new number.+-- +-- +-- * url : <http://www.csounds.com/manual/html/randomi.html>+ +randomiK' :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+randomiK' k0min k1max k2cps = opcode "randomi" args+ where args = [to k0min, to k1max, to k2cps]+++-- | * opcode : randomi+-- +-- +-- * syntax : +-- +-- > ares randomi kmin, kmax, acps+-- > kres randomi kmin, kmax, kcps+-- +-- +-- * description : +-- +-- Generates a user-controlled random number series with+-- interpolation between each new number.+-- +-- +-- * url : <http://www.csounds.com/manual/html/randomi.html>+ +randomiK ::+ (K k0, K k1, K k2) => k0 -> k1 -> k2 -> SideEffect Krate+randomiK k0min k1max k2cps = opcode "randomi" args+ where args = [to k0min, to k1max, to k2cps]+++-- | * opcode : trirand+-- +-- +-- * syntax : +-- +-- > ares trirand krange+-- > ires trirand krange+-- > kres trirand krange+-- +-- +-- * description : +-- +-- Triangular distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/trirand.html>+ +trirandA' :: (K k0) => k0 -> Arate+trirandA' k0range = opcode "trirand" args+ where args = [to k0range]+++-- | * opcode : trirand+-- +-- +-- * syntax : +-- +-- > ares trirand krange+-- > ires trirand krange+-- > kres trirand krange+-- +-- +-- * description : +-- +-- Triangular distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/trirand.html>+ +trirandA :: (K k0) => k0 -> SideEffect Arate+trirandA k0range = opcode "trirand" args+ where args = [to k0range]+++-- | * opcode : trirand+-- +-- +-- * syntax : +-- +-- > ares trirand krange+-- > ires trirand krange+-- > kres trirand krange+-- +-- +-- * description : +-- +-- Triangular distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/trirand.html>+ +trirandI' :: (K k0) => k0 -> Irate+trirandI' k0range = opcode "trirand" args+ where args = [to k0range]+++-- | * opcode : trirand+-- +-- +-- * syntax : +-- +-- > ares trirand krange+-- > ires trirand krange+-- > kres trirand krange+-- +-- +-- * description : +-- +-- Triangular distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/trirand.html>+ +trirandI :: (K k0) => k0 -> SideEffect Irate+trirandI k0range = opcode "trirand" args+ where args = [to k0range]+++-- | * opcode : trirand+-- +-- +-- * syntax : +-- +-- > ares trirand krange+-- > ires trirand krange+-- > kres trirand krange+-- +-- +-- * description : +-- +-- Triangular distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/trirand.html>+ +trirandK' :: (K k0) => k0 -> Krate+trirandK' k0range = opcode "trirand" args+ where args = [to k0range]+++-- | * opcode : trirand+-- +-- +-- * syntax : +-- +-- > ares trirand krange+-- > ires trirand krange+-- > kres trirand krange+-- +-- +-- * description : +-- +-- Triangular distribution random number generator. This is an+-- x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/trirand.html>+ +trirandK :: (K k0) => k0 -> SideEffect Krate+trirandK k0range = opcode "trirand" args+ where args = [to k0range]+++-- | * opcode : unirand+-- +-- +-- * syntax : +-- +-- > ares unirand krange+-- > ires unirand krange+-- > kres unirand krange+-- +-- +-- * description : +-- +-- Uniform distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/unirand.html>+ +unirandA' :: (K k0) => k0 -> Arate+unirandA' k0range = opcode "unirand" args+ where args = [to k0range]+++-- | * opcode : unirand+-- +-- +-- * syntax : +-- +-- > ares unirand krange+-- > ires unirand krange+-- > kres unirand krange+-- +-- +-- * description : +-- +-- Uniform distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/unirand.html>+ +unirandA :: (K k0) => k0 -> SideEffect Arate+unirandA k0range = opcode "unirand" args+ where args = [to k0range]+++-- | * opcode : unirand+-- +-- +-- * syntax : +-- +-- > ares unirand krange+-- > ires unirand krange+-- > kres unirand krange+-- +-- +-- * description : +-- +-- Uniform distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/unirand.html>+ +unirandI' :: (K k0) => k0 -> Irate+unirandI' k0range = opcode "unirand" args+ where args = [to k0range]+++-- | * opcode : unirand+-- +-- +-- * syntax : +-- +-- > ares unirand krange+-- > ires unirand krange+-- > kres unirand krange+-- +-- +-- * description : +-- +-- Uniform distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/unirand.html>+ +unirandI :: (K k0) => k0 -> SideEffect Irate+unirandI k0range = opcode "unirand" args+ where args = [to k0range]+++-- | * opcode : unirand+-- +-- +-- * syntax : +-- +-- > ares unirand krange+-- > ires unirand krange+-- > kres unirand krange+-- +-- +-- * description : +-- +-- Uniform distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/unirand.html>+ +unirandK' :: (K k0) => k0 -> Krate+unirandK' k0range = opcode "unirand" args+ where args = [to k0range]+++-- | * opcode : unirand+-- +-- +-- * syntax : +-- +-- > ares unirand krange+-- > ires unirand krange+-- > kres unirand krange+-- +-- +-- * description : +-- +-- Uniform distribution random number generator (positive values+-- only). This is an x-class noise generator.+-- +-- +-- * url : <http://www.csounds.com/manual/html/unirand.html>+ +unirandK :: (K k0) => k0 -> SideEffect Krate+unirandK k0range = opcode "unirand" args+ where args = [to k0range]+++-- | * opcode : urd+-- +-- +-- * syntax : +-- +-- > aout = urd(ktableNum)+-- > iout = urd(itableNum)+-- > kout = urd(ktableNum)+-- +-- +-- * description : +-- +-- A discrete user-defined-distribution random generator that can+-- be used as a function.+-- +-- +-- * url : <http://www.csounds.com/manual/html/urd.html>+ +urdA' :: (X x0) => x0 -> x0+urdA' x0sig = prefixOperation "urd" args+ where args = [to x0sig]+++-- | * opcode : urd+-- +-- +-- * syntax : +-- +-- > aout = urd(ktableNum)+-- > iout = urd(itableNum)+-- > kout = urd(ktableNum)+-- +-- +-- * description : +-- +-- A discrete user-defined-distribution random generator that can+-- be used as a function.+-- +-- +-- * url : <http://www.csounds.com/manual/html/urd.html>+ +urdA :: (X x0) => x0 -> x0+urdA x0sig = prefixOperation "urd" args+ where args = [to x0sig]+++-- | * opcode : urd+-- +-- +-- * syntax : +-- +-- > aout = urd(ktableNum)+-- > iout = urd(itableNum)+-- > kout = urd(ktableNum)+-- +-- +-- * description : +-- +-- A discrete user-defined-distribution random generator that can+-- be used as a function.+-- +-- +-- * url : <http://www.csounds.com/manual/html/urd.html>+ +urdI' :: (X x0) => x0 -> x0+urdI' x0sig = prefixOperation "urd" args+ where args = [to x0sig]+++-- | * opcode : urd+-- +-- +-- * syntax : +-- +-- > aout = urd(ktableNum)+-- > iout = urd(itableNum)+-- > kout = urd(ktableNum)+-- +-- +-- * description : +-- +-- A discrete user-defined-distribution random generator that can+-- be used as a function.+-- +-- +-- * url : <http://www.csounds.com/manual/html/urd.html>+ +urdI :: (X x0) => x0 -> x0+urdI x0sig = prefixOperation "urd" args+ where args = [to x0sig]+++-- | * opcode : urd+-- +-- +-- * syntax : +-- +-- > aout = urd(ktableNum)+-- > iout = urd(itableNum)+-- > kout = urd(ktableNum)+-- +-- +-- * description : +-- +-- A discrete user-defined-distribution random generator that can+-- be used as a function.+-- +-- +-- * url : <http://www.csounds.com/manual/html/urd.html>+ +urdK' :: (X x0) => x0 -> x0+urdK' x0sig = prefixOperation "urd" args+ where args = [to x0sig]+++-- | * opcode : urd+-- +-- +-- * syntax : +-- +-- > aout = urd(ktableNum)+-- > iout = urd(itableNum)+-- > kout = urd(ktableNum)+-- +-- +-- * description : +-- +-- A discrete user-defined-distribution random generator that can+-- be used as a function.+-- +-- +-- * url : <http://www.csounds.com/manual/html/urd.html>+ +urdK :: (X x0) => x0 -> x0+urdK x0sig = prefixOperation "urd" args+ where args = [to x0sig]+++-- | * opcode : weibull+-- +-- +-- * syntax : +-- +-- > ares weibull ksigma, ktau+-- > ires weibull ksigma, ktau+-- > kres weibull ksigma, ktau+-- +-- +-- * description : +-- +-- Weibull distribution random number generator (positive values+-- only). This is an x-class noise generator+-- +-- +-- * url : <http://www.csounds.com/manual/html/weibull.html>+ +weibullA' :: (K k0, K k1) => k0 -> k1 -> Arate+weibullA' k0sigma k1tau = opcode "weibull" args+ where args = [to k0sigma, to k1tau]+++-- | * opcode : weibull+-- +-- +-- * syntax : +-- +-- > ares weibull ksigma, ktau+-- > ires weibull ksigma, ktau+-- > kres weibull ksigma, ktau+-- +-- +-- * description : +-- +-- Weibull distribution random number generator (positive values+-- only). This is an x-class noise generator+-- +-- +-- * url : <http://www.csounds.com/manual/html/weibull.html>+ +weibullA :: (K k0, K k1) => k0 -> k1 -> SideEffect Arate+weibullA k0sigma k1tau = opcode "weibull" args+ where args = [to k0sigma, to k1tau]+++-- | * opcode : weibull+-- +-- +-- * syntax : +-- +-- > ares weibull ksigma, ktau+-- > ires weibull ksigma, ktau+-- > kres weibull ksigma, ktau+-- +-- +-- * description : +-- +-- Weibull distribution random number generator (positive values+-- only). This is an x-class noise generator+-- +-- +-- * url : <http://www.csounds.com/manual/html/weibull.html>+ +weibullI' :: (K k0, K k1) => k0 -> k1 -> Irate+weibullI' k0sigma k1tau = opcode "weibull" args+ where args = [to k0sigma, to k1tau]+++-- | * opcode : weibull+-- +-- +-- * syntax : +-- +-- > ares weibull ksigma, ktau+-- > ires weibull ksigma, ktau+-- > kres weibull ksigma, ktau+-- +-- +-- * description : +-- +-- Weibull distribution random number generator (positive values+-- only). This is an x-class noise generator+-- +-- +-- * url : <http://www.csounds.com/manual/html/weibull.html>+ +weibullI :: (K k0, K k1) => k0 -> k1 -> SideEffect Irate+weibullI k0sigma k1tau = opcode "weibull" args+ where args = [to k0sigma, to k1tau]+++-- | * opcode : weibull+-- +-- +-- * syntax : +-- +-- > ares weibull ksigma, ktau+-- > ires weibull ksigma, ktau+-- > kres weibull ksigma, ktau+-- +-- +-- * description : +-- +-- Weibull distribution random number generator (positive values+-- only). This is an x-class noise generator+-- +-- +-- * url : <http://www.csounds.com/manual/html/weibull.html>+ +weibullK' :: (K k0, K k1) => k0 -> k1 -> Krate+weibullK' k0sigma k1tau = opcode "weibull" args+ where args = [to k0sigma, to k1tau]+++-- | * opcode : weibull+-- +-- +-- * syntax : +-- +-- > ares weibull ksigma, ktau+-- > ires weibull ksigma, ktau+-- > kres weibull ksigma, ktau+-- +-- +-- * description : +-- +-- Weibull distribution random number generator (positive values+-- only). This is an x-class noise generator+-- +-- +-- * url : <http://www.csounds.com/manual/html/weibull.html>+ +weibullK :: (K k0, K k1) => k0 -> k1 -> SideEffect Krate+weibullK k0sigma k1tau = opcode "weibull" args+ where args = [to k0sigma, to k1tau]+++-- | * opcode : jitter+-- +-- +-- * syntax : +-- +-- > kout jitter kamp, kcpsMin, kcpsMax+-- +-- +-- * description : +-- +-- Generates a segmented line whose segments are randomly+-- generated.+-- +-- +-- * url : <http://www.csounds.com/manual/html/jitter.html>+ +jitter' :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+jitter' k0amp k1cpsMin k2cpsMax = opcode "jitter" args+ where args = [to k0amp, to k1cpsMin, to k2cpsMax]+++-- | * opcode : jitter+-- +-- +-- * syntax : +-- +-- > kout jitter kamp, kcpsMin, kcpsMax+-- +-- +-- * description : +-- +-- Generates a segmented line whose segments are randomly+-- generated.+-- +-- +-- * url : <http://www.csounds.com/manual/html/jitter.html>+ +jitter :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> SideEffect Krate+jitter k0amp k1cpsMin k2cpsMax = opcode "jitter" args+ where args = [to k0amp, to k1cpsMin, to k2cpsMax]+++-- | * opcode : jitter2+-- +-- +-- * syntax : +-- +-- > kout jitter2 ktotamp, kamp1, kcps1, kamp2, kcps2, kamp3, kcps3+-- +-- +-- * description : +-- +-- Generates a segmented line with user-controllable random+-- segments.+-- +-- +-- * url : <http://www.csounds.com/manual/html/jitter2.html>+ +jitter2' ::+ (K k0, K k1, K k2, K k3, K k4, K k5, K k6) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> Krate+jitter2' k0totamp k1amp1 k2cps1 k3amp2 k4cps2 k5amp3 k6cps3+ = opcode "jitter2" args+ where args+ = [to k0totamp, to k1amp1, to k2cps1, to k3amp2, to k4cps2,+ to k5amp3, to k6cps3]+++-- | * opcode : jitter2+-- +-- +-- * syntax : +-- +-- > kout jitter2 ktotamp, kamp1, kcps1, kamp2, kcps2, kamp3, kcps3+-- +-- +-- * description : +-- +-- Generates a segmented line with user-controllable random+-- segments.+-- +-- +-- * url : <http://www.csounds.com/manual/html/jitter2.html>+ +jitter2 ::+ (K k0, K k1, K k2, K k3, K k4, K k5, K k6) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> SideEffect Krate+jitter2 k0totamp k1amp1 k2cps1 k3amp2 k4cps2 k5amp3 k6cps3+ = opcode "jitter2" args+ where args+ = [to k0totamp, to k1amp1, to k2cps1, to k3amp2, to k4cps2,+ to k5amp3, to k6cps3]+++-- | * opcode : trandom+-- +-- +-- * syntax : +-- +-- > kout trandom ktrig, kmin, kmax+-- +-- +-- * description : +-- +-- Generates a controlled pseudo-random number series between min+-- and max values at k-rate whenever the trigger parameter is+-- different to 0.+-- +-- +-- * url : <http://www.csounds.com/manual/html/trandom.html>+ +trandom' :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+trandom' k0trig k1min k2max = opcode "trandom" args+ where args = [to k0trig, to k1min, to k2max]+++-- | * opcode : trandom+-- +-- +-- * syntax : +-- +-- > kout trandom ktrig, kmin, kmax+-- +-- +-- * description : +-- +-- Generates a controlled pseudo-random number series between min+-- and max values at k-rate whenever the trigger parameter is+-- different to 0.+-- +-- +-- * url : <http://www.csounds.com/manual/html/trandom.html>+ +trandom :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> SideEffect Krate+trandom k0trig k1min k2max = opcode "trandom" args+ where args = [to k0trig, to k1min, to k2max]
+ src/CsoundExpr/Opcodes/Siggen/Phasors.hs view
@@ -0,0 +1,125 @@+-- | Phasors+module CsoundExpr.Opcodes.Siggen.Phasors+ (phasorA,+ phasorK,+ phasorbnkA,+ phasorbnkK,+ syncphasor)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : phasor+-- +-- +-- * syntax : +-- +-- > ares phasor xcps [, iphs]+-- > kres phasor kcps [, iphs]+-- +-- +-- * description : +-- +-- Produce a normalized moving phase value.+-- +-- +-- * url : <http://www.csounds.com/manual/html/phasor.html>+ +phasorA :: (X x0) => [Irate] -> x0 -> Arate+phasorA i0init x1cps = opcode "phasor" args+ where args = [to x1cps] ++ map to i0init+++-- | * opcode : phasor+-- +-- +-- * syntax : +-- +-- > ares phasor xcps [, iphs]+-- > kres phasor kcps [, iphs]+-- +-- +-- * description : +-- +-- Produce a normalized moving phase value.+-- +-- +-- * url : <http://www.csounds.com/manual/html/phasor.html>+ +phasorK :: (K k0) => [Irate] -> k0 -> Krate+phasorK i0init k1cps = opcode "phasor" args+ where args = [to k1cps] ++ map to i0init+++-- | * opcode : phasorbnk+-- +-- +-- * syntax : +-- +-- > ares phasorbnk xcps, kndx, icnt [, iphs]+-- > kres phasorbnk kcps, kndx, icnt [, iphs]+-- +-- +-- * description : +-- +-- Produce an arbitrary number of normalized moving phase values,+-- accessable by an index.+-- +-- +-- * url : <http://www.csounds.com/manual/html/phasorbnk.html>+ +phasorbnkA :: (X x0, K k0) => [Irate] -> x0 -> k0 -> Irate -> Arate+phasorbnkA i0init x1cps k2ndx i3cnt = opcode "phasorbnk" args+ where args = [to x1cps, to k2ndx, to i3cnt] ++ map to i0init+++-- | * opcode : phasorbnk+-- +-- +-- * syntax : +-- +-- > ares phasorbnk xcps, kndx, icnt [, iphs]+-- > kres phasorbnk kcps, kndx, icnt [, iphs]+-- +-- +-- * description : +-- +-- Produce an arbitrary number of normalized moving phase values,+-- accessable by an index.+-- +-- +-- * url : <http://www.csounds.com/manual/html/phasorbnk.html>+ +phasorbnkK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Krate+phasorbnkK i0init k1cps k2ndx i3cnt = opcode "phasorbnk" args+ where args = [to k1cps, to k2ndx, to i3cnt] ++ map to i0init+++-- | * opcode : syncphasor+-- +-- +-- * syntax : +-- +-- > aphase, asyncout syncphasor xcps, asyncin, [, iphs]+-- +-- +-- * description : +-- +-- Produces a moving phase value between zero and one and an extra+-- impulse output ("sync out") whenever its phase value crosses or+-- is reset to zero. The phase can be reset at any time by an+-- impulse on the "sync in" parameter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/syncphasor.html>+ +syncphasor :: (X x0) => [Irate] -> x0 -> Arate -> MultiOut+syncphasor i0init x1cps a2syncin = opcode "syncphasor" args+ where args = [to x1cps, to a2syncin] ++ map to i0init
+ src/CsoundExpr/Opcodes/Siggen/Sample.hs view
@@ -0,0 +1,1076 @@+-- | Sample Playback+module CsoundExpr.Opcodes.Siggen.Sample+ (bbcutm,+ bbcuts,+ flooper,+ flooper2,+ loscil,+ loscil3,+ loscilx,+ lphasor,+ lposcil,+ lposcil3,+ lposcila,+ lposcilsa,+ lposcilsa2,+ sndloop,+ waveset,+ fluidAllOut,+ fluidCCi,+ fluidCCk,+ fluidControl,+ fluidEngine,+ fluidLoad,+ fluidNote,+ fluidOut,+ fluidProgramSelect,+ fluidSetInterpMethod,+ sfilist,+ sfinstr,+ sfinstr3,+ sfinstr3m,+ sfinstrm,+ sfload,+ sfpassign,+ sfplay,+ sfplay3,+ sfplay3m,+ sfplaym,+ sflooper,+ sfplist,+ sfpreset)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : bbcutm+-- +-- +-- * syntax : +-- +-- > a1 bbcutm asource, ibps, isubdiv, ibarlength, iphrasebars, inumrepeats +-- > [, istutterspeed] [, istutterchance] [, ienvchoice ]+-- +-- +-- * description : +-- +-- The BreakBeat Cutter automatically generates cut-ups of a source+-- audio stream in the style of drum and bass/jungle breakbeat+-- manipulations. There are two versions, for mono (bbcutm) or+-- stereo (bbcuts) sources. Whilst originally based on breakbeat+-- cutting, the opcode can be applied to any type of source audio.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bbcutm.html>+ +bbcutm ::+ [Irate] ->+ Arate -> Irate -> Irate -> Irate -> Irate -> Irate -> Arate+bbcutm i0init a1source i2bps i3subdiv i4barlength i5phrasebars+ i6numrepeats = opcode "bbcutm" args+ where args+ = [to a1source, to i2bps, to i3subdiv, to i4barlength,+ to i5phrasebars, to i6numrepeats]+ ++ map to i0init+++-- | * opcode : bbcuts+-- +-- +-- * syntax : +-- +-- > a1,a2 bbcuts asource1, asource2, ibps, isubdiv, ibarlength, iphrasebars, +-- > inumrepeats [, istutterspeed] [, istutterchance] [, ienvchoice]+-- +-- +-- * description : +-- +-- The BreakBeat Cutter automatically generates cut-ups of a source+-- audio stream in the style of drum and bass/jungle breakbeat+-- manipulations. There are two versions, for mono (bbcutm) or+-- stereo (bbcuts) sources. Whilst originally based on breakbeat+-- cutting, the opcode can be applied to any type of source audio.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bbcuts.html>+ +bbcuts ::+ [Irate] ->+ Arate ->+ Arate -> Irate -> Irate -> Irate -> Irate -> Irate -> MultiOut+bbcuts i0init a1source1 a2source2 i3bps i4subdiv i5barlength+ i6phrasebars i7numrepeats = opcode "bbcuts" args+ where args+ = [to a1source1, to a2source2, to i3bps, to i4subdiv,+ to i5barlength, to i6phrasebars, to i7numrepeats]+ ++ map to i0init+++-- | * opcode : flooper+-- +-- +-- * syntax : +-- +-- > asig flooper kamp, kpitch, istart, idur, ifad, ifn+-- +-- +-- * description : +-- +-- This opcode reads audio from a function table and plays it back+-- in a loop with user-defined start time, duration and crossfade+-- time. It also allows the pitch of the loop to be controlled,+-- including reversed playback. It accepts non-power-of-two tables,+-- such as deferred-allocation GEN01 tables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/flooper.html>+ +flooper ::+ (K k0, K k1) =>+ k0 -> k1 -> Irate -> Irate -> Irate -> Irate -> Arate+flooper k0amp k1pitch i2start i3dur i4fad i5fn+ = opcode "flooper" args+ where args+ = [to k0amp, to k1pitch, to i2start, to i3dur, to i4fad, to i5fn]+++-- | * opcode : flooper2+-- +-- +-- * syntax : +-- +-- > asig flooper2 kamp, kpitch, kloopstart, kloopend, kcrossfade, ifn +-- > [, istart, imode, ifenv, iskip]+-- +-- +-- * description : +-- +-- This opcode implements a crossfading looper with variable loop+-- parameters and three looping modes, optionally using a table for+-- its crossfade shape. It accepts non-power-of-two tables for its+-- source sounds, such as deferred-allocation GEN01 tables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/flooper2.html>+ +flooper2 ::+ (K k0, K k1, K k2, K k3, K k4) =>+ [Irate] -> k0 -> k1 -> k2 -> k3 -> k4 -> Irate -> Arate+flooper2 i0init k1amp k2pitch k3loopstart k4loopend k5crossfade+ i6fn = opcode "flooper2" args+ where args+ = [to k1amp, to k2pitch, to k3loopstart, to k4loopend,+ to k5crossfade, to i6fn]+ ++ map to i0init+++-- | * opcode : loscil+-- +-- +-- * syntax : +-- +-- > ar1 [,ar2] loscil xamp, kcps, ifn [, ibas] [, imod1] [, ibeg1] [, iend1] +-- > [, imod2] [, ibeg2] [, iend2]+-- +-- +-- * description : +-- +-- Read sampled sound (mono or stereo) from a table, with optional+-- sustain and release looping.+-- +-- +-- * url : <http://www.csounds.com/manual/html/loscil.html>+ +loscil :: (X x0, K k0) => [Irate] -> x0 -> k0 -> Irate -> MultiOut+loscil i0init x1amp k2cps i3fn = opcode "loscil" args+ where args = [to x1amp, to k2cps, to i3fn] ++ map to i0init+++-- | * opcode : loscil3+-- +-- +-- * syntax : +-- +-- > ar1 [,ar2] loscil3 xamp, kcps, ifn [, ibas] [, imod1] [, ibeg1] [, iend1] +-- > [, imod2] [, ibeg2] [, iend2]+-- +-- +-- * description : +-- +-- Read sampled sound (mono or stereo) from a table, with optional+-- sustain and release looping, using cubic interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/loscil3.html>+ +loscil3 :: (X x0, K k0) => [Irate] -> x0 -> k0 -> Irate -> MultiOut+loscil3 i0init x1amp k2cps i3fn = opcode "loscil3" args+ where args = [to x1amp, to k2cps, to i3fn] ++ map to i0init+++-- | * opcode : loscilx+-- +-- +-- * syntax : +-- +-- > ar1 [, ar2, ar3, ar4, ar5, ar6, ar7, ar8, ar9, ar10, ar11, ar12, ar13, ar14, +-- > ar15, ar16] loscilx xamp, kcps, ifn +-- > [, iwsize, ibas, istrt, imod1, ibeg1, iend1]+-- +-- +-- * description : +-- +-- This file is currently a stub, but the syntax should be correct.+-- +-- +-- * url : <http://www.csounds.com/manual/html/loscilx.html>+ +loscilx :: (X x0, K k0) => [Irate] -> x0 -> k0 -> Irate -> MultiOut+loscilx i0init x1amp k2cps i3fn = opcode "loscilx" args+ where args = [to x1amp, to k2cps, to i3fn] ++ map to i0init+++-- | * opcode : lphasor+-- +-- +-- * syntax : +-- +-- > ares lphasor xtrns [, ilps] [, ilpe] [, imode] [, istrt] [, istor]+-- +-- +-- * description : +-- +-- This opcode can be used to generate table index for sample+-- playback (e.g. tablexkt).+-- +-- +-- * url : <http://www.csounds.com/manual/html/lphasor.html>+ +lphasor :: (X x0) => [Irate] -> x0 -> Arate+lphasor i0init x1trns = opcode "lphasor" args+ where args = [to x1trns] ++ map to i0init+++-- | * opcode : lposcil+-- +-- +-- * syntax : +-- +-- > ares lposcil kamp, kfreqratio, kloop, kend, ifn [, iphs]+-- +-- +-- * description : +-- +-- Read sampled sound (mono or stereo) from a table, with optional+-- sustain and release looping, and high precision.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lposcil.html>+ +lposcil ::+ (K k0, K k1, K k2, K k3) =>+ [Irate] -> k0 -> k1 -> k2 -> k3 -> Irate -> Arate+lposcil i0init k1amp k2freqratio k3loop k4end i5fn+ = opcode "lposcil" args+ where args+ = [to k1amp, to k2freqratio, to k3loop, to k4end, to i5fn] +++ map to i0init+++-- | * opcode : lposcil3+-- +-- +-- * syntax : +-- +-- > ares lposcil3 kamp, kfreqratio, kloop, kend, ifn [, iphs]+-- +-- +-- * description : +-- +-- Read sampled sound (mono or stereo) from a table, with optional+-- sustain and release looping, and high precision. lposcil3 uses+-- cubic interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lposcil3.html>+ +lposcil3 ::+ (K k0, K k1, K k2, K k3) =>+ [Irate] -> k0 -> k1 -> k2 -> k3 -> Irate -> Arate+lposcil3 i0init k1amp k2freqratio k3loop k4end i5fn+ = opcode "lposcil3" args+ where args+ = [to k1amp, to k2freqratio, to k3loop, to k4end, to i5fn] +++ map to i0init+++-- | * opcode : lposcila+-- +-- +-- * syntax : +-- +-- > ar lposcila aamp, kfreqratio, kloop, kend, ift [,iphs]+-- +-- +-- * description : +-- +-- lposcila reads sampled sound from a table with optional looping+-- and high precision.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lposcila.html>+ +lposcila ::+ (K k0, K k1, K k2) =>+ [Irate] -> Arate -> k0 -> k1 -> k2 -> Irate -> Arate+lposcila i0init a1amp k2freqratio k3loop k4end i5ft+ = opcode "lposcila" args+ where args+ = [to a1amp, to k2freqratio, to k3loop, to k4end, to i5ft] +++ map to i0init+++-- | * opcode : lposcilsa+-- +-- +-- * syntax : +-- +-- > ar1, ar2 lposcilsa aamp, kfreqratio, kloop, kend, ift [,iphs]+-- +-- +-- * description : +-- +-- lposcilsa reads stereo sampled sound from a table with optional+-- looping and high precision.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lposcilsa.html>+ +lposcilsa ::+ (K k0, K k1, K k2) =>+ [Irate] -> Arate -> k0 -> k1 -> k2 -> Irate -> MultiOut+lposcilsa i0init a1amp k2freqratio k3loop k4end i5ft+ = opcode "lposcilsa" args+ where args+ = [to a1amp, to k2freqratio, to k3loop, to k4end, to i5ft] +++ map to i0init+++-- | * opcode : lposcilsa2+-- +-- +-- * syntax : +-- +-- > ar1, ar2 lposcilsa2 aamp, kfreqratio, kloop, kend, ift [,iphs]+-- +-- +-- * description : +-- +-- lposcilsa2 reads stereo sampled sound from a table with optional+-- looping and high precision.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lposcilsa2.html>+ +lposcilsa2 ::+ (K k0, K k1, K k2) =>+ [Irate] -> Arate -> k0 -> k1 -> k2 -> Irate -> MultiOut+lposcilsa2 i0init a1amp k2freqratio k3loop k4end i5ft+ = opcode "lposcilsa2" args+ where args+ = [to a1amp, to k2freqratio, to k3loop, to k4end, to i5ft] +++ map to i0init+++-- | * opcode : sndloop+-- +-- +-- * syntax : +-- +-- > asig, krec sndloop ain, kpitch, ktrig, idur, ifad+-- +-- +-- * description : +-- +-- This opcode records input audio and plays it back in a loop with+-- user-defined duration and crossfade time. It also allows the+-- pitch of the loop to be controlled, including reversed playback.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sndloop.html>+ +sndloop ::+ (K k0, K k1) =>+ Arate -> k0 -> k1 -> Irate -> Irate -> (Arate, Krate)+sndloop a0in k1pitch k2trig i3dur i4fad+ = mo2 $ opcode "sndloop" args+ where args = [to a0in, to k1pitch, to k2trig, to i3dur, to i4fad]+++-- | * opcode : waveset+-- +-- +-- * syntax : +-- +-- > ares waveset ain, krep [, ilen]+-- +-- +-- * description : +-- +-- A simple time stretch by repeating cycles.+-- +-- +-- * url : <http://www.csounds.com/manual/html/waveset.html>+ +waveset :: (K k0) => [Irate] -> Arate -> k0 -> Arate+waveset i0init a1in k2rep = opcode "waveset" args+ where args = [to a1in, to k2rep] ++ map to i0init+++-- | * opcode : fluidAllOut+-- +-- +-- * syntax : +-- +-- > aleft, aright fluidAllOut+-- +-- +-- * description : +-- +-- Collects all audio from all Fluidsynth engines in a performance+-- +-- +-- * url : <http://www.csounds.com/manual/html/fluidAllOut.html>+ +fluidAllOut :: MultiOut+fluidAllOut = opcode "fluidAllOut" args+ where args = []+++-- | * opcode : fluidCCi+-- +-- +-- * syntax : +-- +-- > fluidCCi iEngineNumber, iChannelNumber, iControllerNumber, iValue+-- +-- +-- * description : +-- +-- Sends a MIDI controller data (MIDI controller number and value+-- to use) message to a fluid engine by number on the user specified+-- MIDI channel number.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fluidCCi.html>+ +fluidCCi :: Irate -> Irate -> Irate -> Irate -> SignalOut+fluidCCi i0EngineNumber i1ChannelNumber i2ControllerNumber i3Value+ = outOpcode "fluidCCi" args+ where args+ = [to i0EngineNumber, to i1ChannelNumber, to i2ControllerNumber,+ to i3Value]+++-- | * opcode : fluidCCk+-- +-- +-- * syntax : +-- +-- > fluidCCk iEngineNumber, iChannelNumber, iControllerNumber, kValue+-- +-- +-- * description : +-- +-- Sends a MIDI controller data (MIDI controller number and value+-- to use) message to a fluid engine by number on the user specified+-- MIDI channel number.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fluidCCk.html>+ +fluidCCk :: (K k0) => Irate -> Irate -> Irate -> k0 -> SignalOut+fluidCCk i0EngineNumber i1ChannelNumber i2ControllerNumber k3Value+ = outOpcode "fluidCCk" args+ where args+ = [to i0EngineNumber, to i1ChannelNumber, to i2ControllerNumber,+ to k3Value]+++-- | * opcode : fluidControl+-- +-- +-- * syntax : +-- +-- > fluidControl ienginenum, kstatus, kchannel, kdata1, kdata2+-- +-- +-- * description : +-- +-- The fluid opcodes provide a simple Csound opcode wrapper around+-- Peter Hanappe's Fluidsynth SoundFont2 synthesizer. This+-- implementation accepts any MIDI note on, note off, controller,+-- pitch bend, or program change message at k-rate. Maximum+-- polyphony is 4096 simultaneously sounding voices. Any number of+-- SoundFonts may be loaded and played simultaneously.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fluidControl.html>+ +fluidControl ::+ (K k0, K k1, K k2, K k3) =>+ Irate -> k0 -> k1 -> k2 -> k3 -> SignalOut+fluidControl i0enginenum k1status k2channel k3data1 k4data2+ = outOpcode "fluidControl" args+ where args+ = [to i0enginenum, to k1status, to k2channel, to k3data1,+ to k4data2]+++-- | * opcode : fluidEngine+-- +-- +-- * syntax : +-- +-- > ienginenum fluidEngine [iReverbEnabled] [, iChorusEnabled] [,iNumChannels] [, iPolyphony]+-- +-- +-- * description : +-- +-- Instantiates a fluidsynth engine, and returns ienginenum to+-- identify the engine. ienginenum is passed to other other opcodes+-- for loading and playing SoundFonts and gathering the generated+-- sound.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fluidEngine.html>+ +fluidEngine :: [Irate] -> Irate+fluidEngine i0init = opcode "fluidEngine" args+ where args = map to i0init+++-- | * opcode : fluidLoad+-- +-- +-- * syntax : +-- +-- > isfnum fluidLoad soundfont, ienginenum[, ilistpresets]+-- +-- +-- * description : +-- +-- Loads a SoundFont into an instance of a fluidEngine, optionally+-- listing banks and presets for SoundFont.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fluidLoad.html>+ +fluidLoad :: [Irate] -> String -> Irate -> Irate+fluidLoad i0init s1soundfont i2enginenum = opcode "fluidLoad" args+ where args = [to s1soundfont, to i2enginenum] ++ map to i0init+++-- | * opcode : fluidNote+-- +-- +-- * syntax : +-- +-- > fluidNote ienginenum, ichannelnum, imidikey, imidivel+-- +-- +-- * description : +-- +-- Plays a note at imidikey pitch and imidivel velocity on+-- ichannelnum channel of number ienginenum fluidEngine.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fluidNote.html>+ +fluidNote :: Irate -> Irate -> Irate -> Irate -> SignalOut+fluidNote i0enginenum i1channelnum i2midikey i3midivel+ = outOpcode "fluidNote" args+ where args+ = [to i0enginenum, to i1channelnum, to i2midikey, to i3midivel]+++-- | * opcode : fluidOut+-- +-- +-- * syntax : +-- +-- > aleft, aright fluidOut ienginenum+-- +-- +-- * description : +-- +-- Outputs the sound from a fluidEngine.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fluidOut.html>+ +fluidOut :: Irate -> MultiOut+fluidOut i0enginenum = opcode "fluidOut" args+ where args = [to i0enginenum]+++-- | * opcode : fluidProgramSelect+-- +-- +-- * syntax : +-- +-- > fluidProgramSelect ienginenum, ichannelnum, isfnum, ibanknum, ipresetnum+-- +-- +-- * description : +-- +-- Assigns a preset from a SoundFont to a channel on a fluidEngine.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fluidProgramSelect.html>+ +fluidProgramSelect ::+ Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+fluidProgramSelect i0enginenum i1channelnum i2sfnum i3banknum+ i4presetnum = outOpcode "fluidProgramSelect" args+ where args+ = [to i0enginenum, to i1channelnum, to i2sfnum, to i3banknum,+ to i4presetnum]+++-- | * opcode : fluidSetInterpMethod+-- +-- +-- * syntax : +-- +-- > fluidSetInterpMethod ienginenum, ichannelnum, iInterpMethod+-- +-- +-- * description : +-- +-- Set interpolation method for channel in Fluid Engine. Lower+-- order interpolation methods will render faster at lower fidelity+-- while higher order interpolation methods will render slower at+-- higher fidelity. Default interpolation for a channel is 4th order+-- interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fluidSetInterpMethod.html>+ +fluidSetInterpMethod :: Irate -> Irate -> Irate -> SignalOut+fluidSetInterpMethod i0enginenum i1channelnum i2InterpMethod+ = outOpcode "fluidSetInterpMethod" args+ where args = [to i0enginenum, to i1channelnum, to i2InterpMethod]+++-- | * opcode : sfilist+-- +-- +-- * syntax : +-- +-- > sfilist ifilhandle+-- +-- +-- * description : +-- +-- Prints a list of all instruments of a previously loaded+-- SoundFont2 (SF2) sample file. These opcodes allow management the+-- sample-structure of SF2 files. In order to understand the usage+-- of these opcodes, the user must have some knowledge of the SF2+-- format, so a brief description of this format can be found in the+-- SoundFont2 File Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfilist.html>+ +sfilist :: Irate -> SignalOut+sfilist i0filhandle = outOpcode "sfilist" args+ where args = [to i0filhandle]+++-- | * opcode : sfinstr+-- +-- +-- * syntax : +-- +-- > ar1, ar2 sfinstr ivel, inotenum, xamp, xfreq, instrnum, ifilhandle +-- > [, iflag] [, ioffset]+-- +-- +-- * description : +-- +-- Plays a SoundFont2 (SF2) sample instrument, generating a stereo+-- sound. These opcodes allow management the sample-structure of SF2+-- files. In order to understand the usage of these opcodes, the+-- user must have some knowledge of the SF2 format, so a brief+-- description of this format can be found in the SoundFont2 File+-- Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfinstr.html>+ +sfinstr ::+ (X x0, X x1) =>+ [Irate] -> Irate -> Irate -> x0 -> x1 -> Irate -> Irate -> MultiOut+sfinstr i0init i1vel i2notenum x3amp x4freq i5nstrnum i6filhandle+ = opcode "sfinstr" args+ where args+ = [to i1vel, to i2notenum, to x3amp, to x4freq, to i5nstrnum,+ to i6filhandle]+ ++ map to i0init+++-- | * opcode : sfinstr3+-- +-- +-- * syntax : +-- +-- > ar1, ar2 sfinstr3 ivel, inotenum, xamp, xfreq, instrnum, ifilhandle +-- > [, iflag] [, ioffset]+-- +-- +-- * description : +-- +-- Plays a SoundFont2 (SF2) sample instrument, generating a stereo+-- sound with cubic interpolation. These opcodes allow management+-- the sample-structure of SF2 files. In order to understand the+-- usage of these opcodes, the user must have some knowledge of the+-- SF2 format, so a brief description of this format can be found in+-- the SoundFont2 File Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfinstr3.html>+ +sfinstr3 ::+ (X x0, X x1) =>+ [Irate] -> Irate -> Irate -> x0 -> x1 -> Irate -> Irate -> MultiOut+sfinstr3 i0init i1vel i2notenum x3amp x4freq i5nstrnum i6filhandle+ = opcode "sfinstr3" args+ where args+ = [to i1vel, to i2notenum, to x3amp, to x4freq, to i5nstrnum,+ to i6filhandle]+ ++ map to i0init+++-- | * opcode : sfinstr3m+-- +-- +-- * syntax : +-- +-- > ares sfinstr3m ivel, inotenum, xamp, xfreq, instrnum, ifilhandle +-- > [, iflag] [, ioffset]+-- +-- +-- * description : +-- +-- Plays a SoundFont2 (SF2) sample instrument, generating a mono+-- sound with cubic interpolation. These opcodes allow management+-- the sample-structure of SF2 files. In order to understand the+-- usage of these opcodes, the user must have some knowledge of the+-- SF2 format, so a brief description of this format can be found in+-- the SoundFont2 File Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfinstr3m.html>+ +sfinstr3m ::+ (X x0, X x1) =>+ [Irate] -> Irate -> Irate -> x0 -> x1 -> Irate -> Irate -> Arate+sfinstr3m i0init i1vel i2notenum x3amp x4freq i5nstrnum i6filhandle+ = opcode "sfinstr3m" args+ where args+ = [to i1vel, to i2notenum, to x3amp, to x4freq, to i5nstrnum,+ to i6filhandle]+ ++ map to i0init+++-- | * opcode : sfinstrm+-- +-- +-- * syntax : +-- +-- > ares sfinstrm ivel, inotenum, xamp, xfreq, instrnum, ifilhandle +-- > [, iflag] [, ioffset]+-- +-- +-- * description : +-- +-- Plays a SoundFont2 (SF2) sample instrument, generating a mono+-- sound. These opcodes allow management the sample-structure of SF2+-- files. In order to understand the usage of these opcodes, the+-- user must have some knowledge of the SF2 format, so a brief+-- description of this format can be found in the SoundFont2 File+-- Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfinstrm.html>+ +sfinstrm ::+ (X x0, X x1) =>+ [Irate] -> Irate -> Irate -> x0 -> x1 -> Irate -> Irate -> Arate+sfinstrm i0init i1vel i2notenum x3amp x4freq i5nstrnum i6filhandle+ = opcode "sfinstrm" args+ where args+ = [to i1vel, to i2notenum, to x3amp, to x4freq, to i5nstrnum,+ to i6filhandle]+ ++ map to i0init+++-- | * opcode : sfload+-- +-- +-- * syntax : +-- +-- > ir sfload "filename"+-- +-- +-- * description : +-- +-- Loads an entire SoundFont2 (SF2) sample file into memory. These+-- opcodes allow management the sample-structure of SF2 files. In+-- order to understand the usage of these opcodes, the user must+-- have some knowledge of the SF2 format, so a brief description of+-- this format can be found in the SoundFont2 File Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfload.html>+ +sfload :: String -> Irate+sfload s0filename = opcode "sfload" args+ where args = [to s0filename]+++-- | * opcode : sfpassign+-- +-- +-- * syntax : +-- +-- > sfpassign istartindex, ifilhandle[, imsgs]+-- +-- +-- * description : +-- +-- Assigns all presets of a previously loaded SoundFont2 (SF2)+-- sample file to a sequence of progressive index numbers. These+-- opcodes allow management the sample-structure of SF2 files. In+-- order to understand the usage of these opcodes, the user must+-- have some knowledge of the SF2 format, so a brief description of+-- this format can be found in the SoundFont2 File Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfpassign.html>+ +sfpassign :: [Irate] -> Irate -> Irate -> SignalOut+sfpassign i0init i1startindex i2filhandle+ = outOpcode "sfpassign" args+ where args = [to i1startindex, to i2filhandle] ++ map to i0init+++-- | * opcode : sfplay+-- +-- +-- * syntax : +-- +-- > ar1, ar2 sfplay ivel, inotenum, xamp, xfreq, ipreindex [, iflag] [, ioffset] [, ienv]+-- +-- +-- * description : +-- +-- Plays a SoundFont2 (SF2) sample preset, generating a stereo+-- sound. These opcodes allow management the sample-structure of SF2+-- files. In order to understand the usage of these opcodes, the+-- user must have some knowledge of the SF2 format, so a brief+-- description of this format can be found in the SoundFont2 File+-- Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfplay.html>+ +sfplay ::+ (X x0, X x1) =>+ [Irate] -> Irate -> Irate -> x0 -> x1 -> Irate -> MultiOut+sfplay i0init i1vel i2notenum x3amp x4freq i5preindex+ = opcode "sfplay" args+ where args+ = [to i1vel, to i2notenum, to x3amp, to x4freq, to i5preindex] +++ map to i0init+++-- | * opcode : sfplay3+-- +-- +-- * syntax : +-- +-- > ar1, ar2 sfplay3 ivel, inotenum, xamp, xfreq, ipreindex [, iflag] [, ioffset] [, ienv]+-- +-- +-- * description : +-- +-- Plays a SoundFont2 (SF2) sample preset, generating a stereo+-- sound with cubic interpolation. These opcodes allow management+-- the sample-structure of SF2 files. In order to understand the+-- usage of these opcodes, the user must have some knowledge of the+-- SF2 format, so a brief description of this format can be found in+-- the SoundFont2 File Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfplay3.html>+ +sfplay3 ::+ (X x0, X x1) =>+ [Irate] -> Irate -> Irate -> x0 -> x1 -> Irate -> MultiOut+sfplay3 i0init i1vel i2notenum x3amp x4freq i5preindex+ = opcode "sfplay3" args+ where args+ = [to i1vel, to i2notenum, to x3amp, to x4freq, to i5preindex] +++ map to i0init+++-- | * opcode : sfplay3m+-- +-- +-- * syntax : +-- +-- > ares sfplay3m ivel, inotenum, xamp, xfreq, ipreindex [, iflag] [, ioffset] [, ienv]+-- +-- +-- * description : +-- +-- Plays a SoundFont2 (SF2) sample preset, generating a mono sound+-- with cubic interpolation. These opcodes allow management the+-- sample-structure of SF2 files. In order to understand the usage+-- of these opcodes, the user must have some knowledge of the SF2+-- format, so a brief description of this format can be found in the+-- SoundFont2 File Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfplay3m.html>+ +sfplay3m ::+ (X x0, X x1) =>+ [Irate] -> Irate -> Irate -> x0 -> x1 -> Irate -> Arate+sfplay3m i0init i1vel i2notenum x3amp x4freq i5preindex+ = opcode "sfplay3m" args+ where args+ = [to i1vel, to i2notenum, to x3amp, to x4freq, to i5preindex] +++ map to i0init+++-- | * opcode : sfplaym+-- +-- +-- * syntax : +-- +-- > ares sfplaym ivel, inotenum, xamp, xfreq, ipreindex [, iflag] [, ioffset] [, ienv]+-- +-- +-- * description : +-- +-- Plays a SoundFont2 (SF2) sample preset, generating a mono sound.+-- These opcodes allow management the sample-structure of SF2 files.+-- In order to understand the usage of these opcodes, the user must+-- have some knowledge of the SF2 format, so a brief description of+-- this format can be found in the SoundFont2 File Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfplaym.html>+ +sfplaym ::+ (X x0, X x1) =>+ [Irate] -> Irate -> Irate -> x0 -> x1 -> Irate -> Arate+sfplaym i0init i1vel i2notenum x3amp x4freq i5preindex+ = opcode "sfplaym" args+ where args+ = [to i1vel, to i2notenum, to x3amp, to x4freq, to i5preindex] +++ map to i0init+++-- | * opcode : sflooper+-- +-- +-- * syntax : +-- +-- > ar1, ar2 sflooper ivel, inotenum, kamp, kpitch, ipreindex, kloopstart, kloopend, kcrossfade, ifn +-- > [, istart, imode, ifenv, iskip]+-- +-- +-- * description : +-- +-- Plays a SoundFont2 (SF2) sample preset, generating a stereo+-- sound, similarly to sfplay. Unlike that opcode, though, it+-- ignores the looping points set in the SF2 file and substitutes+-- them for a user-defined crossfade loop. It is a cross between+-- sfplay and flooper2.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sflooper.html>+ +sflooper ::+ (K k0, K k1, K k2, K k3, K k4) =>+ [Irate] ->+ Irate ->+ Irate -> k0 -> k1 -> Irate -> k2 -> k3 -> k4 -> Irate -> MultiOut+sflooper i0init i1vel i2notenum k3amp k4pitch i5preindex+ k6loopstart k7loopend k8crossfade i9fn = opcode "sflooper" args+ where args+ = [to i1vel, to i2notenum, to k3amp, to k4pitch, to i5preindex,+ to k6loopstart, to k7loopend, to k8crossfade, to i9fn]+ ++ map to i0init+++-- | * opcode : sfplist+-- +-- +-- * syntax : +-- +-- > sfplist ifilhandle+-- +-- +-- * description : +-- +-- Prints a list of all presets of a previously loaded SoundFont2+-- (SF2) sample file. These opcodes allow management the+-- sample-structure of SF2 files. In order to understand the usage+-- of these opcodes, the user must have some knowledge of the SF2+-- format, so a brief description of this format can be found in the+-- SoundFont2 File Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfplist.html>+ +sfplist :: Irate -> SignalOut+sfplist i0filhandle = outOpcode "sfplist" args+ where args = [to i0filhandle]+++-- | * opcode : sfpreset+-- +-- +-- * syntax : +-- +-- > ir sfpreset iprog, ibank, ifilhandle, ipreindex+-- +-- +-- * description : +-- +-- Assigns an existing preset of a previously loaded SoundFont2+-- (SF2) sample file to an index number. These opcodes allow+-- management the sample-structure of SF2 files. In order to+-- understand the usage of these opcodes, the user must have some+-- knowledge of the SF2 format, so a brief description of this+-- format can be found in the SoundFont2 File Format Appendix.+-- +-- +-- * url : <http://www.csounds.com/manual/html/sfpreset.html>+ +sfpreset :: Irate -> Irate -> Irate -> Irate -> Irate+sfpreset i0prog i1bank i2filhandle i3preindex+ = opcode "sfpreset" args+ where args = [to i0prog, to i1bank, to i2filhandle, to i3preindex]
+ src/CsoundExpr/Opcodes/Siggen/ScanTop.hs view
@@ -0,0 +1,250 @@+-- | Scanned Synthesis+module CsoundExpr.Opcodes.Siggen.ScanTop+ (scanhammer,+ scans,+ scantable,+ scanu,+ xscanmap,+ xscans,+ xscansmap,+ xscanu)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : scanhammer+-- +-- +-- * syntax : +-- +-- > scanhammer isrc, idst, ipos, imult+-- +-- +-- * description : +-- +-- This is is a variant of tablecopy, copying from one table to+-- another, starting at ipos, and with a gain control. The number of+-- points copied is determined by the length of the source. Other+-- points are not changed. This opcode can be used to hit a string+-- in the scanned synthesis code.+-- +-- +-- * url : <http://www.csounds.com/manual/html/scanhammer.html>+ +scanhammer :: Irate -> Irate -> Irate -> Irate -> SignalOut+scanhammer i0src i1dst i2pos i3mult = outOpcode "scanhammer" args+ where args = [to i0src, to i1dst, to i2pos, to i3mult]+++-- | * opcode : scans+-- +-- +-- * syntax : +-- +-- > ares scans kamp, kfreq, ifn, id [, iorder]+-- +-- +-- * description : +-- +-- Generate audio output using scanned synthesis.+-- +-- +-- * url : <http://www.csounds.com/manual/html/scans.html>+ +scans ::+ (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Irate -> Arate+scans i0init k1amp k2freq i3fn i4d = opcode "scans" args+ where args+ = [to k1amp, to k2freq, to i3fn, to i4d] ++ map to i0init+++-- | * opcode : scantable+-- +-- +-- * syntax : +-- +-- > aout scantable kamp, kpch, ipos, imass, istiff, idamp, ivel+-- +-- +-- * description : +-- +-- A simpler scanned synthesis implementation. This is an+-- implementation of a circular string scanned using external+-- tables. This opcode will allow direct modification and reading of+-- values with the table opcodes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/scantable.html>+ +scantable ::+ (K k0, K k1) =>+ k0 -> k1 -> Irate -> Irate -> Irate -> Irate -> Irate -> Arate+scantable k0amp k1pch i2pos i3mass i4stiff i5damp i6vel+ = opcode "scantable" args+ where args+ = [to k0amp, to k1pch, to i2pos, to i3mass, to i4stiff, to i5damp,+ to i6vel]+++-- | * opcode : scanu+-- +-- +-- * syntax : +-- +-- > scanu init, irate, ifnvel, ifnmass, ifnstif, ifncentr, ifndamp, kmass, +-- > kstif, kcentr, kdamp, ileft, iright, kpos, kstrngth, ain, idisp, id+-- +-- +-- * description : +-- +-- Compute the waveform and the wavetable for use in scanned+-- synthesis.+-- +-- +-- * url : <http://www.csounds.com/manual/html/scanu.html>+ +scanu ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ k0 ->+ k1 ->+ k2 ->+ k3 ->+ Irate -> Irate -> k4 -> k5 -> Arate -> Irate -> Irate -> SignalOut+scanu i0nit i1rate i2fnvel i3fnmass i4fnstif i5fncentr i6fndamp+ k7mass k8stif k9centr k10damp i11left i12right k13pos k14strngth+ a15in i16disp i17d = outOpcode "scanu" args+ where args+ = [to i0nit, to i1rate, to i2fnvel, to i3fnmass, to i4fnstif,+ to i5fncentr, to i6fndamp, to k7mass, to k8stif, to k9centr,+ to k10damp, to i11left, to i12right, to k13pos, to k14strngth,+ to a15in, to i16disp, to i17d]+++-- | * opcode : xscanmap+-- +-- +-- * syntax : +-- +-- > kpos, kvel xscanmap iscan, kamp, kvamp [, iwhich]+-- +-- +-- * description : +-- +-- Allows the position and velocity of a node in a scanned process+-- to be read.+-- +-- +-- * url : <http://www.csounds.com/manual/html/xscanmap.html>+ +xscanmap ::+ (K k0, K k1) => [Irate] -> Irate -> k0 -> k1 -> MultiOut+xscanmap i0init i1scan k2amp k3vamp = opcode "xscanmap" args+ where args = [to i1scan, to k2amp, to k3vamp] ++ map to i0init+++-- | * opcode : xscans+-- +-- +-- * syntax : +-- +-- > ares xscans kamp, kfreq, ifntraj, id [, iorder]+-- +-- +-- * description : +-- +-- Experimental version of scans. Allows much larger matrices and+-- is faster and smaller but removes some (unused?) flexibility. If+-- liked, it will replace the older opcode as it is syntax+-- compatible but extended.+-- +-- +-- * url : <http://www.csounds.com/manual/html/xscans.html>+ +xscans ::+ (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Irate -> Arate+xscans i0init k1amp k2freq i3fntraj i4d = opcode "xscans" args+ where args+ = [to k1amp, to k2freq, to i3fntraj, to i4d] ++ map to i0init+++-- | * opcode : xscansmap+-- +-- +-- * syntax : +-- +-- > xscansmap kpos, kvel, iscan, kamp, kvamp [, iwhich]+-- +-- +-- * description : +-- +-- Allows the position and velocity of a node in a scanned process+-- to be read.+-- +-- +-- * url : <http://www.csounds.com/manual/html/xscansmap.html>+ +xscansmap ::+ (K k0, K k1, K k2, K k3) =>+ [Irate] -> k0 -> k1 -> Irate -> k2 -> k3 -> SignalOut+xscansmap i0init k1pos k2vel i3scan k4amp k5vamp+ = outOpcode "xscansmap" args+ where args+ = [to k1pos, to k2vel, to i3scan, to k4amp, to k5vamp] +++ map to i0init+++-- | * opcode : xscanu+-- +-- +-- * syntax : +-- +-- > xscanu init, irate, ifnvel, ifnmass, ifnstif, ifncentr, ifndamp, kmass, +-- > kstif, kcentr, kdamp, ileft, iright, kpos, kstrngth, ain, idisp, id+-- +-- +-- * description : +-- +-- Experimental version of scanu. Allows much larger matrices and+-- is faster and smaller but removes some (unused?) flexibility. If+-- liked, it will replace the older opcode as it is syntax+-- compatible but extended.+-- +-- +-- * url : <http://www.csounds.com/manual/html/xscanu.html>+ +xscanu ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ Irate ->+ k0 ->+ k1 ->+ k2 ->+ k3 ->+ Irate -> Irate -> k4 -> k5 -> Arate -> Irate -> Irate -> SignalOut+xscanu i0nit i1rate i2fnvel i3fnmass i4fnstif i5fncentr i6fndamp+ k7mass k8stif k9centr k10damp i11left i12right k13pos k14strngth+ a15in i16disp i17d = outOpcode "xscanu" args+ where args+ = [to i0nit, to i1rate, to i2fnvel, to i3fnmass, to i4fnstif,+ to i5fncentr, to i6fndamp, to k7mass, to k8stif, to k9centr,+ to k10damp, to i11left, to i12right, to k13pos, to k14strngth,+ to a15in, to i16disp, to i17d]
+ src/CsoundExpr/Opcodes/Siggen/Tableacc.hs view
@@ -0,0 +1,447 @@+-- | Table Access+module CsoundExpr.Opcodes.Siggen.Tableacc+ (oscil1,+ oscil1i,+ tableA,+ tableI,+ tableK,+ table3A,+ table3I,+ table3K,+ tableiA,+ tableiI,+ tableiK,+ tabA,+ tabK,+ tab_i,+ tabwA,+ tabwK,+ tabw_i)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : oscil1+-- +-- +-- * syntax : +-- +-- > kres oscil1 idel, kamp, idur, ifn+-- +-- +-- * description : +-- +-- Accesses table values by incremental sampling.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscil1.html>+ +oscil1 :: (K k0) => Irate -> k0 -> Irate -> Irate -> Krate+oscil1 i0del k1amp i2dur i3fn = opcode "oscil1" args+ where args = [to i0del, to k1amp, to i2dur, to i3fn]+++-- | * opcode : oscil1i+-- +-- +-- * syntax : +-- +-- > kres oscil1i idel, kamp, idur, ifn+-- +-- +-- * description : +-- +-- Accesses table values by incremental sampling with linear+-- interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/oscil1i.html>+ +oscil1i :: (K k0) => Irate -> k0 -> Irate -> Irate -> Krate+oscil1i i0del k1amp i2dur i3fn = opcode "oscil1i" args+ where args = [to i0del, to k1amp, to i2dur, to i3fn]+++-- | * opcode : table+-- +-- +-- * syntax : +-- +-- > ares table andx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > ires table indx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > kres table kndx, ifn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- Accesses table values by direct indexing.+-- +-- +-- * url : <http://www.csounds.com/manual/html/table.html>+ +tableA :: [Irate] -> Arate -> Irate -> Arate+tableA i0init a1ndx i2fn = opcode "table" args+ where args = [to a1ndx, to i2fn] ++ map to i0init+++-- | * opcode : table+-- +-- +-- * syntax : +-- +-- > ares table andx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > ires table indx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > kres table kndx, ifn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- Accesses table values by direct indexing.+-- +-- +-- * url : <http://www.csounds.com/manual/html/table.html>+ +tableI :: [Irate] -> Irate -> Irate -> Irate+tableI i0init i1ndx i2fn = opcode "table" args+ where args = [to i1ndx, to i2fn] ++ map to i0init+++-- | * opcode : table+-- +-- +-- * syntax : +-- +-- > ares table andx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > ires table indx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > kres table kndx, ifn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- Accesses table values by direct indexing.+-- +-- +-- * url : <http://www.csounds.com/manual/html/table.html>+ +tableK :: (K k0) => [Irate] -> k0 -> Irate -> Krate+tableK i0init k1ndx i2fn = opcode "table" args+ where args = [to k1ndx, to i2fn] ++ map to i0init+++-- | * opcode : table3+-- +-- +-- * syntax : +-- +-- > ares table3 andx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > ires table3 indx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > kres table3 kndx, ifn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- Accesses table values by direct indexing with cubic+-- interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/table3.html>+ +table3A :: [Irate] -> Arate -> Irate -> Arate+table3A i0init a1ndx i2fn = opcode "table3" args+ where args = [to a1ndx, to i2fn] ++ map to i0init+++-- | * opcode : table3+-- +-- +-- * syntax : +-- +-- > ares table3 andx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > ires table3 indx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > kres table3 kndx, ifn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- Accesses table values by direct indexing with cubic+-- interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/table3.html>+ +table3I :: [Irate] -> Irate -> Irate -> Irate+table3I i0init i1ndx i2fn = opcode "table3" args+ where args = [to i1ndx, to i2fn] ++ map to i0init+++-- | * opcode : table3+-- +-- +-- * syntax : +-- +-- > ares table3 andx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > ires table3 indx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > kres table3 kndx, ifn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- Accesses table values by direct indexing with cubic+-- interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/table3.html>+ +table3K :: (K k0) => [Irate] -> k0 -> Irate -> Krate+table3K i0init k1ndx i2fn = opcode "table3" args+ where args = [to k1ndx, to i2fn] ++ map to i0init+++-- | * opcode : tablei+-- +-- +-- * syntax : +-- +-- > ares tablei andx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > ires tablei indx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > kres tablei kndx, ifn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- Accesses table values by direct indexing with linear+-- interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablei.html>+ +tableiA :: [Irate] -> Arate -> Irate -> Arate+tableiA i0init a1ndx i2fn = opcode "tablei" args+ where args = [to a1ndx, to i2fn] ++ map to i0init+++-- | * opcode : tablei+-- +-- +-- * syntax : +-- +-- > ares tablei andx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > ires tablei indx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > kres tablei kndx, ifn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- Accesses table values by direct indexing with linear+-- interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablei.html>+ +tableiI :: [Irate] -> Irate -> Irate -> Irate+tableiI i0init i1ndx i2fn = opcode "tablei" args+ where args = [to i1ndx, to i2fn] ++ map to i0init+++-- | * opcode : tablei+-- +-- +-- * syntax : +-- +-- > ares tablei andx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > ires tablei indx, ifn [, ixmode] [, ixoff] [, iwrap]+-- > kres tablei kndx, ifn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- Accesses table values by direct indexing with linear+-- interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablei.html>+ +tableiK :: (K k0) => [Irate] -> k0 -> Irate -> Krate+tableiK i0init k1ndx i2fn = opcode "tablei" args+ where args = [to k1ndx, to i2fn] ++ map to i0init+++-- | * opcode : tab+-- +-- +-- * syntax : +-- +-- > ir tab_i indx, ifn[, ixmode]+-- > kr tab kndx, ifn[, ixmode]+-- > ar tab xndx, ifn[, ixmode]+-- > tabw_i isig, indx, ifn [,ixmode]+-- > tabw ksig, kndx, ifn [,ixmode]+-- > tabw asig, andx, ifn [,ixmode]+-- +-- +-- * description : +-- +-- Fast table opcodes. Faster than table and tablew because don't+-- allow wrap-around and limit and don't check index validity. Have+-- been implemented in order to provide fast access to arrays.+-- Support non-power of two tables (can be generated by any GEN+-- function by giving a negative length value).+-- +-- +-- * url : <http://www.csounds.com/manual/html/tab.html>+ +tabA :: (X x0) => [Irate] -> x0 -> Irate -> Arate+tabA i0init x1ndx i2fn = opcode "tab" args+ where args = [to x1ndx, to i2fn] ++ map to i0init+++-- | * opcode : tab+-- +-- +-- * syntax : +-- +-- > ir tab_i indx, ifn[, ixmode]+-- > kr tab kndx, ifn[, ixmode]+-- > ar tab xndx, ifn[, ixmode]+-- > tabw_i isig, indx, ifn [,ixmode]+-- > tabw ksig, kndx, ifn [,ixmode]+-- > tabw asig, andx, ifn [,ixmode]+-- +-- +-- * description : +-- +-- Fast table opcodes. Faster than table and tablew because don't+-- allow wrap-around and limit and don't check index validity. Have+-- been implemented in order to provide fast access to arrays.+-- Support non-power of two tables (can be generated by any GEN+-- function by giving a negative length value).+-- +-- +-- * url : <http://www.csounds.com/manual/html/tab.html>+ +tabK :: (K k0) => [Irate] -> k0 -> Irate -> Krate+tabK i0init k1ndx i2fn = opcode "tab" args+ where args = [to k1ndx, to i2fn] ++ map to i0init+++-- | * opcode : tab_i+-- +-- +-- * syntax : +-- +-- > ir tab_i indx, ifn[, ixmode]+-- > kr tab kndx, ifn[, ixmode]+-- > ar tab xndx, ifn[, ixmode]+-- > tabw_i isig, indx, ifn [,ixmode]+-- > tabw ksig, kndx, ifn [,ixmode]+-- > tabw asig, andx, ifn [,ixmode]+-- +-- +-- * description : +-- +-- Fast table opcodes. Faster than table and tablew because don't+-- allow wrap-around and limit and don't check index validity. Have+-- been implemented in order to provide fast access to arrays.+-- Support non-power of two tables (can be generated by any GEN+-- function by giving a negative length value).+-- +-- +-- * url : <http://www.csounds.com/manual/html/tab.html>+ +tab_i :: [Irate] -> Irate -> Irate -> Irate+tab_i i0init i1ndx i2fn = opcode "tab_i" args+ where args = [to i1ndx, to i2fn] ++ map to i0init+++-- | * opcode : tabw+-- +-- +-- * syntax : +-- +-- > ir tab_i indx, ifn[, ixmode]+-- > kr tab kndx, ifn[, ixmode]+-- > ar tab xndx, ifn[, ixmode]+-- > tabw_i isig, indx, ifn [,ixmode]+-- > tabw ksig, kndx, ifn [,ixmode]+-- > tabw asig, andx, ifn [,ixmode]+-- +-- +-- * description : +-- +-- Fast table opcodes. Faster than table and tablew because don't+-- allow wrap-around and limit and don't check index validity. Have+-- been implemented in order to provide fast access to arrays.+-- Support non-power of two tables (can be generated by any GEN+-- function by giving a negative length value).+-- +-- +-- * url : <http://www.csounds.com/manual/html/tab.html>+ +tabwA :: [Irate] -> Arate -> Arate -> Irate -> SignalOut+tabwA i0init a1sig a2ndx i3fn = outOpcode "tabw" args+ where args = [to a1sig, to a2ndx, to i3fn] ++ map to i0init+++-- | * opcode : tabw+-- +-- +-- * syntax : +-- +-- > ir tab_i indx, ifn[, ixmode]+-- > kr tab kndx, ifn[, ixmode]+-- > ar tab xndx, ifn[, ixmode]+-- > tabw_i isig, indx, ifn [,ixmode]+-- > tabw ksig, kndx, ifn [,ixmode]+-- > tabw asig, andx, ifn [,ixmode]+-- +-- +-- * description : +-- +-- Fast table opcodes. Faster than table and tablew because don't+-- allow wrap-around and limit and don't check index validity. Have+-- been implemented in order to provide fast access to arrays.+-- Support non-power of two tables (can be generated by any GEN+-- function by giving a negative length value).+-- +-- +-- * url : <http://www.csounds.com/manual/html/tab.html>+ +tabwK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> SignalOut+tabwK i0init k1sig k2ndx i3fn = outOpcode "tabw" args+ where args = [to k1sig, to k2ndx, to i3fn] ++ map to i0init+++-- | * opcode : tabw_i+-- +-- +-- * syntax : +-- +-- > ir tab_i indx, ifn[, ixmode]+-- > kr tab kndx, ifn[, ixmode]+-- > ar tab xndx, ifn[, ixmode]+-- > tabw_i isig, indx, ifn [,ixmode]+-- > tabw ksig, kndx, ifn [,ixmode]+-- > tabw asig, andx, ifn [,ixmode]+-- +-- +-- * description : +-- +-- Fast table opcodes. Faster than table and tablew because don't+-- allow wrap-around and limit and don't check index validity. Have+-- been implemented in order to provide fast access to arrays.+-- Support non-power of two tables (can be generated by any GEN+-- function by giving a negative length value).+-- +-- +-- * url : <http://www.csounds.com/manual/html/tab.html>+ +tabw_i :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+tabw_i i0init i1sig i2ndx i3fn = outOpcode "tabw_i" args+ where args = [to i1sig, to i2ndx, to i3fn] ++ map to i0init
+ src/CsoundExpr/Opcodes/Siggen/Waveterr.hs view
@@ -0,0 +1,38 @@+-- | Wave Terrain Synthesis+module CsoundExpr.Opcodes.Siggen.Waveterr+ (wterrain)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : wterrain+-- +-- +-- * syntax : +-- +-- > aout wterrain kamp, kpch, k_xcenter, k_ycenter, k_xradius, k_yradius, +-- > itabx, itaby+-- +-- +-- * description : +-- +-- A simple wave-terrain synthesis opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wterrain.html>+ +wterrain ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> Irate -> Irate -> Arate+wterrain k0amp k1pch k2_xcenter k3_ycenter k4_xradius k5_yradius+ i6tabx i7taby = opcode "wterrain" args+ where args+ = [to k0amp, to k1pch, to k2_xcenter, to k3_ycenter, to k4_xradius,+ to k5_yradius, to i6tabx, to i7taby]
+ src/CsoundExpr/Opcodes/Siggen/Wavguide.hs view
@@ -0,0 +1,315 @@+-- | Waveguide Physical Modeling+module CsoundExpr.Opcodes.Siggen.Wavguide+ (pluck,+ repluck,+ wgbow,+ wgbowedbar,+ wgbrass,+ wgclar,+ wgflute,+ wgpluck,+ wgpluck2,+ wguide1,+ wguide2)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : pluck+-- +-- +-- * syntax : +-- +-- > ares pluck kamp, kcps, icps, ifn, imeth [, iparm1] [, iparm2]+-- +-- +-- * description : +-- +-- Audio output is a naturally decaying plucked string or drum+-- sound based on the Karplus-Strong algorithms.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pluck.html>+ +pluck ::+ (K k0, K k1) =>+ [Irate] -> k0 -> k1 -> Irate -> Irate -> Irate -> Arate+pluck i0init k1amp k2cps i3cps i4fn i5meth = opcode "pluck" args+ where args+ = [to k1amp, to k2cps, to i3cps, to i4fn, to i5meth] +++ map to i0init+++-- | * opcode : repluck+-- +-- +-- * syntax : +-- +-- > ares repluck iplk, kamp, icps, kpick, krefl, axcite+-- +-- +-- * description : +-- +-- repluck is an implementation of the physical model of the+-- plucked string. A user can control the pluck point, the pickup+-- point, the filter, and an additional audio signal, axcite. axcite+-- is used to excite the 'string'. Based on the Karplus-Strong+-- algorithm.+-- +-- +-- * url : <http://www.csounds.com/manual/html/repluck.html>+ +repluck ::+ (K k0, K k1, K k2) =>+ Irate -> k0 -> Irate -> k1 -> k2 -> Arate -> Arate+repluck i0plk k1amp i2cps k3pick k4refl a5xcite+ = opcode "repluck" args+ where args+ = [to i0plk, to k1amp, to i2cps, to k3pick, to k4refl, to a5xcite]+++-- | * opcode : wgbow+-- +-- +-- * syntax : +-- +-- > ares wgbow kamp, kfreq, kpres, krat, kvibf, kvamp, ifn [, iminfreq]+-- +-- +-- * description : +-- +-- Audio output is a tone similar to a bowed string, using a+-- physical model developed from Perry Cook, but re-coded for+-- Csound.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wgbow.html>+ +wgbow ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ [Irate] -> k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> Irate -> Arate+wgbow i0init k1amp k2freq k3pres k4rat k5vibf k6vamp i7fn+ = opcode "wgbow" args+ where args+ = [to k1amp, to k2freq, to k3pres, to k4rat, to k5vibf, to k6vamp,+ to i7fn]+ ++ map to i0init+++-- | * opcode : wgbowedbar+-- +-- +-- * syntax : +-- +-- > ares wgbowedbar kamp, kfreq, kpos, kbowpres, kgain [, iconst] [, itvel] +-- > [, ibowpos] [, ilow]+-- +-- +-- * description : +-- +-- A physical model of a bowed bar, belonging to the Perry Cook+-- family of waveguide instruments.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wgbowedbar.html>+ +wgbowedbar ::+ (K k0, K k1, K k2, K k3, K k4) =>+ [Irate] -> k0 -> k1 -> k2 -> k3 -> k4 -> Arate+wgbowedbar i0init k1amp k2freq k3pos k4bowpres k5gain+ = opcode "wgbowedbar" args+ where args+ = [to k1amp, to k2freq, to k3pos, to k4bowpres, to k5gain] +++ map to i0init+++-- | * opcode : wgbrass+-- +-- +-- * syntax : +-- +-- > ares wgbrass kamp, kfreq, ktens, iatt, kvibf, kvamp, ifn [, iminfreq]+-- +-- +-- * description : +-- +-- Audio output is a tone related to a brass instrument, using a+-- physical model developed from Perry Cook, but re-coded for+-- Csound.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wgbrass.html>+ +wgbrass ::+ (K k0, K k1, K k2, K k3, K k4) =>+ [Irate] -> k0 -> k1 -> k2 -> Irate -> k3 -> k4 -> Irate -> Arate+wgbrass i0init k1amp k2freq k3tens i4att k5vibf k6vamp i7fn+ = opcode "wgbrass" args+ where args+ = [to k1amp, to k2freq, to k3tens, to i4att, to k5vibf, to k6vamp,+ to i7fn]+ ++ map to i0init+++-- | * opcode : wgclar+-- +-- +-- * syntax : +-- +-- > ares wgclar kamp, kfreq, kstiff, iatt, idetk, kngain, kvibf, kvamp, ifn +-- > [, iminfreq]+-- +-- +-- * description : +-- +-- Audio output is a tone similar to a clarinet, using a physical+-- model developed from Perry Cook, but re-coded for Csound.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wgclar.html>+ +wgclar ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ [Irate] ->+ k0 ->+ k1 -> k2 -> Irate -> Irate -> k3 -> k4 -> k5 -> Irate -> Arate+wgclar i0init k1amp k2freq k3stiff i4att i5detk k6ngain k7vibf+ k8vamp i9fn = opcode "wgclar" args+ where args+ = [to k1amp, to k2freq, to k3stiff, to i4att, to i5detk,+ to k6ngain, to k7vibf, to k8vamp, to i9fn]+ ++ map to i0init+++-- | * opcode : wgflute+-- +-- +-- * syntax : +-- +-- > ares wgflute kamp, kfreq, kjet, iatt, idetk, kngain, kvibf, kvamp, ifn +-- > [, iminfreq] [, ijetrf] [, iendrf]+-- +-- +-- * description : +-- +-- Audio output is a tone similar to a flute, using a physical+-- model developed from Perry Cook, but re-coded for Csound.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wgflute.html>+ +wgflute ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ [Irate] ->+ k0 ->+ k1 -> k2 -> Irate -> Irate -> k3 -> k4 -> k5 -> Irate -> Arate+wgflute i0init k1amp k2freq k3jet i4att i5detk k6ngain k7vibf+ k8vamp i9fn = opcode "wgflute" args+ where args+ = [to k1amp, to k2freq, to k3jet, to i4att, to i5detk, to k6ngain,+ to k7vibf, to k8vamp, to i9fn]+ ++ map to i0init+++-- | * opcode : wgpluck+-- +-- +-- * syntax : +-- +-- > ares wgpluck icps, iamp, kpick, iplk, idamp, ifilt, axcite+-- +-- +-- * description : +-- +-- A high fidelity simulation of a plucked string, using+-- interpolating delay-lines.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wgpluck.html>+ +wgpluck ::+ (K k0) =>+ Irate -> Irate -> k0 -> Irate -> Irate -> Irate -> Arate -> Arate+wgpluck i0cps i1amp k2pick i3plk i4damp i5filt a6xcite+ = opcode "wgpluck" args+ where args+ = [to i0cps, to i1amp, to k2pick, to i3plk, to i4damp, to i5filt,+ to a6xcite]+++-- | * opcode : wgpluck2+-- +-- +-- * syntax : +-- +-- > ares wgpluck2 iplk, kamp, icps, kpick, krefl+-- +-- +-- * description : +-- +-- wgpluck2 is an implementation of the physical model of the+-- plucked string, with control over the pluck point, the pickup+-- point and the filter. Based on the Karplus-Strong algorithm.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wgpluck2.html>+ +wgpluck2 ::+ (K k0, K k1, K k2) => Irate -> k0 -> Irate -> k1 -> k2 -> Arate+wgpluck2 i0plk k1amp i2cps k3pick k4refl = opcode "wgpluck2" args+ where args = [to i0plk, to k1amp, to i2cps, to k3pick, to k4refl]+++-- | * opcode : wguide1+-- +-- +-- * syntax : +-- +-- > ares wguide1 asig, xfreq, kcutoff, kfeedback+-- +-- +-- * description : +-- +-- A simple waveguide model consisting of one delay-line and one+-- first-order lowpass filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wguide1.html>+ +wguide1 :: (X x0, K k0, K k1) => Arate -> x0 -> k0 -> k1 -> Arate+wguide1 a0sig x1freq k2cutoff k3feedback = opcode "wguide1" args+ where args = [to a0sig, to x1freq, to k2cutoff, to k3feedback]+++-- | * opcode : wguide2+-- +-- +-- * syntax : +-- +-- > ares wguide2 asig, xfreq1, xfreq2, kcutoff1, kcutoff2, +-- > kfeedback1, kfeedback2+-- +-- +-- * description : +-- +-- A model of beaten plate consisting of two parallel delay-lines+-- and two first-order lowpass filters.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wguide2.html>+ +wguide2 ::+ (X x0, X x1, K k0, K k1, K k2, K k3) =>+ Arate -> x0 -> x1 -> k0 -> k1 -> k2 -> k3 -> Arate+wguide2 a0sig x1freq1 x2freq2 k3cutoff1 k4cutoff2 k5feedback1+ k6feedback2 = opcode "wguide2" args+ where args+ = [to a0sig, to x1freq1, to x2freq2, to k3cutoff1, to k4cutoff2,+ to k5feedback1, to k6feedback2]
+ src/CsoundExpr/Opcodes/Sigio.hs view
@@ -0,0 +1,18 @@+-- | Signal Input and Output+module CsoundExpr.Opcodes.Sigio+ (module CsoundExpr.Opcodes.Sigio.FileIO,+ module CsoundExpr.Opcodes.Sigio.Input,+ module CsoundExpr.Opcodes.Sigio.Output,+ module CsoundExpr.Opcodes.Sigio.SoftwareBus,+ module CsoundExpr.Opcodes.Sigio.Pdisplay,+ module CsoundExpr.Opcodes.Sigio.Queries)+where++++import CsoundExpr.Opcodes.Sigio.FileIO+import CsoundExpr.Opcodes.Sigio.Input+import CsoundExpr.Opcodes.Sigio.Output+import CsoundExpr.Opcodes.Sigio.SoftwareBus+import CsoundExpr.Opcodes.Sigio.Pdisplay+import CsoundExpr.Opcodes.Sigio.Queries
+ src/CsoundExpr/Opcodes/Sigio/FileIO.hs view
@@ -0,0 +1,506 @@+-- | File Input and Output+module CsoundExpr.Opcodes.Sigio.FileIO+ (fiopen,+ ficloseI,+ ficloseS,+ dumpk,+ dumpk2,+ dumpk3,+ dumpk4,+ fout,+ fouti,+ foutir,+ foutk,+ readk,+ readk2,+ readk3,+ readk4,+ fin,+ fini,+ fink,+ clear,+ vincr,+ fprints,+ fprintks)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : fiopen+-- +-- +-- * syntax : +-- +-- > ihandle fiopen ifilename, imode+-- +-- +-- * description : +-- +-- fiopen can be used to open a file in one of the specified modes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fiopen.html>+ +fiopen :: Irate -> Irate -> Irate+fiopen i0filename i1mode = opcode "fiopen" args+ where args = [to i0filename, to i1mode]+++-- | * opcode : ficlose+-- +-- +-- * syntax : +-- +-- > ficlose ihandle+-- > ficlose Sfilename+-- +-- +-- * description : +-- +-- ficlose can be used to close a file which was opened with+-- fiopen.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ficlose.html>+ +ficloseI :: Irate -> SignalOut+ficloseI i0handle = outOpcode "ficlose" args+ where args = [to i0handle]+++-- | * opcode : ficlose+-- +-- +-- * syntax : +-- +-- > ficlose ihandle+-- > ficlose Sfilename+-- +-- +-- * description : +-- +-- ficlose can be used to close a file which was opened with+-- fiopen.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ficlose.html>+ +ficloseS :: String -> SignalOut+ficloseS s0filename = outOpcode "ficlose" args+ where args = [to s0filename]+++-- | * opcode : dumpk+-- +-- +-- * syntax : +-- +-- > dumpk ksig, ifilname, iformat, iprd+-- +-- +-- * description : +-- +-- Periodically writes an orchestra control-signal value to a named+-- external file in a specific format.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dumpk.html>+ +dumpk :: (K k0) => k0 -> Irate -> Irate -> Irate -> SignalOut+dumpk k0sig i1filname i2format i3prd = outOpcode "dumpk" args+ where args = [to k0sig, to i1filname, to i2format, to i3prd]+++-- | * opcode : dumpk2+-- +-- +-- * syntax : +-- +-- > dumpk2 ksig1, ksig2, ifilname, iformat, iprd+-- +-- +-- * description : +-- +-- Periodically writes two orchestra control-signal values to a+-- named external file in a specific format.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dumpk2.html>+ +dumpk2 ::+ (K k0, K k1) => k0 -> k1 -> Irate -> Irate -> Irate -> SignalOut+dumpk2 k0sig1 k1sig2 i2filname i3format i4prd+ = outOpcode "dumpk2" args+ where args+ = [to k0sig1, to k1sig2, to i2filname, to i3format, to i4prd]+++-- | * opcode : dumpk3+-- +-- +-- * syntax : +-- +-- > dumpk3 ksig1, ksig2, ksig3, ifilname, iformat, iprd+-- +-- +-- * description : +-- +-- Periodically writes three orchestra control-signal values to a+-- named external file in a specific format.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dumpk3.html>+ +dumpk3 ::+ (K k0, K k1, K k2) =>+ k0 -> k1 -> k2 -> Irate -> Irate -> Irate -> SignalOut+dumpk3 k0sig1 k1sig2 k2sig3 i3filname i4format i5prd+ = outOpcode "dumpk3" args+ where args+ = [to k0sig1, to k1sig2, to k2sig3, to i3filname, to i4format,+ to i5prd]+++-- | * opcode : dumpk4+-- +-- +-- * syntax : +-- +-- > dumpk4 ksig1, ksig2, ksig3, ksig4, ifilname, iformat, iprd+-- +-- +-- * description : +-- +-- Periodically writes four orchestra control-signal values to a+-- named external file in a specific format.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dumpk4.html>+ +dumpk4 ::+ (K k0, K k1, K k2, K k3) =>+ k0 -> k1 -> k2 -> k3 -> Irate -> Irate -> Irate -> SignalOut+dumpk4 k0sig1 k1sig2 k2sig3 k3sig4 i4filname i5format i6prd+ = outOpcode "dumpk4" args+ where args+ = [to k0sig1, to k1sig2, to k2sig3, to k3sig4, to i4filname,+ to i5format, to i6prd]+++-- | * opcode : fout+-- +-- +-- * syntax : +-- +-- > fout ifilename, iformat, aout1 [, aout2, aout3,...,aoutN]+-- +-- +-- * description : +-- +-- fout outputs N a-rate signals to a specified file of N channels.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fout.html>+ +fout :: String -> Irate -> [Arate] -> SignalOut+fout s0filename i1format a2outN = outOpcode "fout" args+ where args = [to s0filename, to i1format] ++ map to a2outN+++-- | * opcode : fouti+-- +-- +-- * syntax : +-- +-- > fouti ihandle, iformat, iflag, iout1 [, iout2, iout3,....,ioutN]+-- +-- +-- * description : +-- +-- fouti output N i-rate signals to a specified file of N channels.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fouti.html>+ +fouti :: Irate -> Irate -> Irate -> [Irate] -> SignalOut+fouti i0handle i1format i2flag i3outN = outOpcode "fouti" args+ where args = [to i0handle, to i1format, to i2flag] ++ map to i3outN+++-- | * opcode : foutir+-- +-- +-- * syntax : +-- +-- > foutir ihandle, iformat, iflag, iout1 [, iout2, iout3,....,ioutN]+-- +-- +-- * description : +-- +-- foutir output N i-rate signals to a specified file of N+-- channels.+-- +-- +-- * url : <http://www.csounds.com/manual/html/foutir.html>+ +foutir :: Irate -> Irate -> Irate -> [Irate] -> SignalOut+foutir i0handle i1format i2flag i3outN = outOpcode "foutir" args+ where args = [to i0handle, to i1format, to i2flag] ++ map to i3outN+++-- | * opcode : foutk+-- +-- +-- * syntax : +-- +-- > foutk ifilename, iformat, kout1 [, kout2, kout3,....,koutN]+-- +-- +-- * description : +-- +-- foutk outputs N k-rate signals to a specified file of N+-- channels.+-- +-- +-- * url : <http://www.csounds.com/manual/html/foutk.html>+ +foutk :: (K k0) => String -> Irate -> [k0] -> SignalOut+foutk s0filename i1format k2outN = outOpcode "foutk" args+ where args = [to s0filename, to i1format] ++ map to k2outN+++-- | * opcode : readk+-- +-- +-- * syntax : +-- +-- > kres readk ifilname, iformat, iprd+-- +-- +-- * description : +-- +-- Periodically reads an orchestra control-signal value from a+-- named external file in a specific format.+-- +-- +-- * url : <http://www.csounds.com/manual/html/readk.html>+ +readk :: Irate -> Irate -> Irate -> Krate+readk i0filname i1format i2prd = opcode "readk" args+ where args = [to i0filname, to i1format, to i2prd]+++-- | * opcode : readk2+-- +-- +-- * syntax : +-- +-- > kr1, kr2 readk2 ifilname, iformat, iprd+-- +-- +-- * description : +-- +-- Periodically reads two orchestra control-signal values from an+-- external file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/readk2.html>+ +readk2 :: Irate -> Irate -> Irate -> MultiOut+readk2 i0filname i1format i2prd = opcode "readk2" args+ where args = [to i0filname, to i1format, to i2prd]+++-- | * opcode : readk3+-- +-- +-- * syntax : +-- +-- > kr1, kr2, kr3 readk3 ifilname, iformat, iprd+-- +-- +-- * description : +-- +-- Periodically reads three orchestra control-signal values from an+-- external file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/readk3.html>+ +readk3 :: Irate -> Irate -> Irate -> MultiOut+readk3 i0filname i1format i2prd = opcode "readk3" args+ where args = [to i0filname, to i1format, to i2prd]+++-- | * opcode : readk4+-- +-- +-- * syntax : +-- +-- > kr1, kr2, kr3, kr4 readk4 ifilname, iformat, iprd+-- +-- +-- * description : +-- +-- Periodically reads four orchestra control-signal values from an+-- external file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/readk4.html>+ +readk4 :: Irate -> Irate -> Irate -> MultiOut+readk4 i0filname i1format i2prd = opcode "readk4" args+ where args = [to i0filname, to i1format, to i2prd]+++-- | * opcode : fin+-- +-- +-- * syntax : +-- +-- > fin ifilename, iskipframes, iformat, ain1 [, ain2] [, ain3] [,...]+-- +-- +-- * description : +-- +-- Read signals from a file at a-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fin.html>+ +fin :: String -> Irate -> Irate -> [Arate] -> SignalOut+fin s0filename i1skipframes i2format a3outN = outOpcode "fin" args+ where args+ = [to s0filename, to i1skipframes, to i2format] ++ map to a3outN+++-- | * opcode : fini+-- +-- +-- * syntax : +-- +-- > fini ifilename, iskipframes, iformat, in1 [, in2] [, in3] [,...]+-- +-- +-- * description : +-- +-- Read signals from a file at i-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fini.html>+ +fini :: String -> Irate -> Irate -> [Irate] -> SignalOut+fini s0filename i1skipframes i2format i3outN+ = outOpcode "fini" args+ where args+ = [to s0filename, to i1skipframes, to i2format] ++ map to i3outN+++-- | * opcode : fink+-- +-- +-- * syntax : +-- +-- > fink ifilename, iskipframes, iformat, kin1 [, kin2] [, kin3] [,...]+-- +-- +-- * description : +-- +-- Read signals from a file at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fink.html>+ +fink :: (K k0) => String -> Irate -> Irate -> [k0] -> SignalOut+fink s0filename i1skipframes i2format k3outN+ = outOpcode "fink" args+ where args+ = [to s0filename, to i1skipframes, to i2format] ++ map to k3outN+++-- | * opcode : clear+-- +-- +-- * syntax : +-- +-- > clear avar1 [, avar2] [, avar3] [...]+-- +-- +-- * description : +-- +-- clear zeroes a list of audio signals.+-- +-- +-- * url : <http://www.csounds.com/manual/html/clear.html>+ +clear :: [Arate] -> SignalOut+clear a0var = outOpcode "clear" args+ where args = map to a0var+++-- | * opcode : vincr+-- +-- +-- * syntax : +-- +-- > vincr accum, aincr+-- +-- +-- * description : +-- +-- vincr increments one audio variable with another signal, i.e. it+-- accumulates output.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vincr.html>+ +vincr :: Arate -> Arate -> SignalOut+vincr a0ccum a1incr = outOpcode "vincr" args+ where args = [to a0ccum, to a1incr]+++-- | * opcode : fprints+-- +-- +-- * syntax : +-- +-- > fprints "filename", "string" [, ival1] [, ival2] [...]+-- +-- +-- * description : +-- +-- Similar to prints but prints to a file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fprints.html>+ +fprints :: String -> String -> [Irate] -> SignalOut+fprints s0filename s1string i2valN = outOpcode "fprints" args+ where args = [to s0filename, to s1string] ++ map to i2valN+++-- | * opcode : fprintks+-- +-- +-- * syntax : +-- +-- > fprintks "filename", "string", [, kval1] [, kval2] [...]+-- +-- +-- * description : +-- +-- Similar to printks but prints to a file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fprintks.html>+ +fprintks :: (K k0) => String -> String -> [k0] -> SignalOut+fprintks s0filename s1string k2valN = outOpcode "fprintks" args+ where args = [to s0filename, to s1string] ++ map to k2valN
+ src/CsoundExpr/Opcodes/Sigio/Input.hs view
@@ -0,0 +1,348 @@+-- | Signal Input+module CsoundExpr.Opcodes.Sigio.Input+ (in',+ in32,+ inch,+ inh,+ ino,+ inq,+ inrg,+ ins,+ inx,+ diskin,+ diskin2,+ soundin,+ invalueK,+ invalueS,+ inz)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : in+-- +-- +-- * syntax : +-- +-- > ar1 in+-- +-- +-- * description : +-- +-- Reads mono audio data from an external device or stream.+-- +-- +-- * url : <http://www.csounds.com/manual/html/in.html>+ +in' :: Arate+in' = opcode "in" args+ where args = []+++-- | * opcode : in32+-- +-- +-- * syntax : +-- +-- > ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8, ar9, ar10, ar11, ar12, ar13, ar14, +-- > ar15, ar16, ar17, ar18, ar19, ar20, ar21, ar22, ar23, ar24, ar25, ar26, +-- > ar27, ar28, ar29, ar30, ar31, ar32 in32+-- +-- +-- * description : +-- +-- Reads a 32-channel audio signal from an external device or+-- stream.+-- +-- +-- * url : <http://www.csounds.com/manual/html/in32.html>+ +in32 :: MultiOut+in32 = opcode "in32" args+ where args = []+++-- | * opcode : inch+-- +-- +-- * syntax : +-- +-- > ain inch kchan+-- +-- +-- * description : +-- +-- Reads from a numbered channel in an external audio signal or+-- stream.+-- +-- +-- * url : <http://www.csounds.com/manual/html/inch.html>+ +inch :: (K k0) => k0 -> Arate+inch k0chan = opcode "inch" args+ where args = [to k0chan]+++-- | * opcode : inh+-- +-- +-- * syntax : +-- +-- > ar1, ar2, ar3, ar4, ar5, ar6 inh+-- +-- +-- * description : +-- +-- Reads six-channel audio data from an external device or stream.+-- +-- +-- * url : <http://www.csounds.com/manual/html/inh.html>+ +inh :: MultiOut+inh = opcode "inh" args+ where args = []+++-- | * opcode : ino+-- +-- +-- * syntax : +-- +-- > ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8 ino+-- +-- +-- * description : +-- +-- Reads eight-channel audio data from an external device or+-- stream.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ino.html>+ +ino :: MultiOut+ino = opcode "ino" args+ where args = []+++-- | * opcode : inq+-- +-- +-- * syntax : +-- +-- > ar1, ar2, ar3, a4 inq+-- +-- +-- * description : +-- +-- Reads quad audio data from an external device or stream.+-- +-- +-- * url : <http://www.csounds.com/manual/html/inq.html>+ +inq :: MultiOut+inq = opcode "inq" args+ where args = []+++-- | * opcode : inrg+-- +-- +-- * syntax : +-- +-- > inrg kstart, ain1 [,ain2, ain3,..., ainN]+-- +-- +-- * description : +-- +-- inrg reads audio from a range of adjacent audio channels from+-- the audio input device.+-- +-- +-- * url : <http://www.csounds.com/manual/html/inrg.html>+ +inrg :: (K k0) => k0 -> [Arate] -> SignalOut+inrg k0start a1ins = outOpcode "inrg" args+ where args = [to k0start] ++ map to a1ins+++-- | * opcode : ins+-- +-- +-- * syntax : +-- +-- > ar1, ar2 ins+-- +-- +-- * description : +-- +-- Reads stereo audio data from an external device or stream.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ins.html>+ +ins :: MultiOut+ins = opcode "ins" args+ where args = []+++-- | * opcode : inx+-- +-- +-- * syntax : +-- +-- > ar1, ar2, ar3, ar4, ar5, ar6, ar7, ar8, ar9, ar10, ar11, ar12, +-- > ar13, ar14, ar15, ar16 inx+-- +-- +-- * description : +-- +-- Reads a 16-channel audio signal from an external device or+-- stream.+-- +-- +-- * url : <http://www.csounds.com/manual/html/inx.html>+ +inx :: MultiOut+inx = opcode "inx" args+ where args = []+++-- | * opcode : diskin+-- +-- +-- * syntax : +-- +-- > ar1 [, ar2 [, ar3 [,... ar24]]] diskin ifilcod, kpitch [, iskiptim] +-- > [, iwraparound] [, iformat] [, iskipinit]+-- +-- +-- * description : +-- +-- Deprecated. Reads audio data from an external device or stream+-- and can alter its pitch.+-- +-- +-- * url : <http://www.csounds.com/manual/html/diskin.html>+ +diskin :: (K k0) => [Irate] -> String -> k0 -> MultiOut+diskin i0init s1file k2pitch = opcode "diskin" args+ where args = [to s1file, to k2pitch] ++ map to i0init+++-- | * opcode : diskin2+-- +-- +-- * syntax : +-- +-- > a1[, a2[,... a24]] diskin2 ifilcod, kpitch[, iskiptim +-- > [, iwrap[, iformat [, iwsize[, ibufsize[, iskipinit]]]]]]+-- +-- +-- * description : +-- +-- Reads audio data from a file, and can alter its pitch using one+-- of several available interpolation types, as well as convert the+-- sample rate to match the orchestra sr setting. diskin2 can also+-- read multichannel files with any number of channels in the range+-- 1 to 24. diskin2 allows more control and higher sound quality+-- than diskin, but there is also the disadvantage of higher CPU+-- usage.+-- +-- +-- * url : <http://www.csounds.com/manual/html/diskin2.html>+ +diskin2 :: (K k0) => [Irate] -> String -> k0 -> MultiOut+diskin2 i0init s1file k2pitch = opcode "diskin2" args+ where args = [to s1file, to k2pitch] ++ map to i0init+++-- | * opcode : soundin+-- +-- +-- * syntax : +-- +-- > ar1[, ar2[, ar3[,... a24]]] soundin ifilcod [, iskptim] [, iformat] +-- > [, iskipinit] [, ibufsize]+-- +-- +-- * description : +-- +-- Reads audio data from an external device or stream. Up to 24+-- channels may be read.+-- +-- +-- * url : <http://www.csounds.com/manual/html/soundin.html>+ +soundin :: [Irate] -> String -> MultiOut+soundin i0init s1file = opcode "soundin" args+ where args = [to s1file] ++ map to i0init+++-- | * opcode : invalue+-- +-- +-- * syntax : +-- +-- > kvalue invalue "channel name"+-- > Sname invalue "channel name"+-- +-- +-- * description : +-- +-- Reads a k-rate signal or string from a user-defined channel.+-- +-- +-- * url : <http://www.csounds.com/manual/html/invalue.html>+ +invalueK :: String -> Krate+invalueK s0channelname = opcode "invalue" args+ where args = [to s0channelname]+++-- | * opcode : invalue+-- +-- +-- * syntax : +-- +-- > kvalue invalue "channel name"+-- > Sname invalue "channel name"+-- +-- +-- * description : +-- +-- Reads a k-rate signal or string from a user-defined channel.+-- +-- +-- * url : <http://www.csounds.com/manual/html/invalue.html>+ +invalueS :: String -> String+invalueS s0channelname = opcode "invalue" args+ where args = [to s0channelname]+++-- | * opcode : inz+-- +-- +-- * syntax : +-- +-- > inz ksig1+-- +-- +-- * description : +-- +-- Reads multi-channel audio samples into a ZAK array from an+-- external device or stream.+-- +-- +-- * url : <http://www.csounds.com/manual/html/inz.html>+ +inz :: (K k0) => k0 -> SignalOut+inz k0sig1 = outOpcode "inz" args+ where args = [to k0sig1]
+ src/CsoundExpr/Opcodes/Sigio/Output.hs view
@@ -0,0 +1,535 @@+-- | 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]
+ src/CsoundExpr/Opcodes/Sigio/Pdisplay.hs view
@@ -0,0 +1,234 @@+-- | Printing and Display+module CsoundExpr.Opcodes.Sigio.Pdisplay+ (dispfft,+ display,+ flashtxt,+ print',+ printf,+ printf_i,+ printk,+ printk2,+ printks,+ prints)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : dispfft+-- +-- +-- * syntax : +-- +-- > dispfft xsig, iprd, iwsiz [, iwtyp] [, idbout] [, iwtflg]+-- +-- +-- * description : +-- +-- These units will print orchestra init-values, or produce graphic+-- display of orchestra control signals and audio signals. Uses X11+-- windows if enabled, else (or if -g flag is set) displays are+-- approximated in ASCII characters.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dispfft.html>+ +dispfft :: (X x0) => [Irate] -> x0 -> Irate -> Irate -> SignalOut+dispfft i0init x1sig i2prd i3wsiz = outOpcode "dispfft" args+ where args = [to x1sig, to i2prd, to i3wsiz] ++ map to i0init+++-- | * opcode : display+-- +-- +-- * syntax : +-- +-- > display xsig, iprd [, inprds] [, iwtflg]+-- +-- +-- * description : +-- +-- These units will print orchestra init-values, or produce graphic+-- display of orchestra control signals and audio signals. Uses X11+-- windows if enabled, else (or if -g flag is set) displays are+-- approximated in ASCII characters.+-- +-- +-- * url : <http://www.csounds.com/manual/html/display.html>+ +display :: (X x0) => [Irate] -> x0 -> Irate -> SignalOut+display i0init x1sig i2prd = outOpcode "display" args+ where args = [to x1sig, to i2prd] ++ map to i0init+++-- | * opcode : flashtxt+-- +-- +-- * syntax : +-- +-- > flashtxt iwhich, String+-- +-- +-- * description : +-- +-- Allows text to be displayed from instruments like sliders etc.+-- (only on Unix and Windows at present)+-- +-- +-- * url : <http://www.csounds.com/manual/html/flashtxt.html>+ +flashtxt :: Irate -> String -> SignalOut+flashtxt i0which s1tring = outOpcode "flashtxt" args+ where args = [to i0which, to s1tring]+++-- | * opcode : print+-- +-- +-- * syntax : +-- +-- > print iarg [, iarg1] [, iarg2] [...]+-- +-- +-- * description : +-- +-- These units will print orchestra init-values.+-- +-- +-- * url : <http://www.csounds.com/manual/html/print.html>+ +print' :: [Irate] -> SignalOut+print' i0argN = outOpcode "print" args+ where args = map to i0argN+++-- | * opcode : printf+-- +-- +-- * syntax : +-- +-- > printf_i Sfmt, itrig, [iarg1[, iarg2[,... ]]]+-- > printf Sfmt, ktrig, [xarg1[, xarg2[,... ]]]+-- +-- +-- * description : +-- +-- printf and printf_i write formatted output, similarly to the C+-- function printf(). printf_i runs at i-time only, while printf+-- runs both at initialization and performance time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/printf.html>+ +printf :: (K k0, X x0) => String -> k0 -> [x0] -> SignalOut+printf s0fmt k1trig x2argN = outOpcode "printf" args+ where args = [to s0fmt, to k1trig] ++ map to x2argN+++-- | * opcode : printf_i+-- +-- +-- * syntax : +-- +-- > printf_i Sfmt, itrig, [iarg1[, iarg2[,... ]]]+-- > printf Sfmt, ktrig, [xarg1[, xarg2[,... ]]]+-- +-- +-- * description : +-- +-- printf and printf_i write formatted output, similarly to the C+-- function printf(). printf_i runs at i-time only, while printf+-- runs both at initialization and performance time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/printf.html>+ +printf_i :: String -> Irate -> [Irate] -> SignalOut+printf_i s0fmt i1trig i2argN = outOpcode "printf_i" args+ where args = [to s0fmt, to i1trig] ++ map to i2argN+++-- | * opcode : printk+-- +-- +-- * syntax : +-- +-- > printk itime, kval [, ispace]+-- +-- +-- * description : +-- +-- Prints one k-rate value at specified intervals.+-- +-- +-- * url : <http://www.csounds.com/manual/html/printk.html>+ +printk :: (K k0) => [Irate] -> Irate -> k0 -> SignalOut+printk i0init i1time k2val = outOpcode "printk" args+ where args = [to i1time, to k2val] ++ map to i0init+++-- | * opcode : printk2+-- +-- +-- * syntax : +-- +-- > printk2 kvar [, inumspaces]+-- +-- +-- * description : +-- +-- Prints a new value every time a control variable changes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/printk2.html>+ +printk2 :: (K k0) => [Irate] -> k0 -> SignalOut+printk2 i0init k1var = outOpcode "printk2" args+ where args = [to k1var] ++ map to i0init+++-- | * opcode : printks+-- +-- +-- * syntax : +-- +-- > printks "string", itime [, kval1] [, kval2] [...]+-- +-- +-- * description : +-- +-- Prints at k-rate using a printf() style syntax.+-- +-- +-- * url : <http://www.csounds.com/manual/html/printks.html>+ +printks :: (K k0) => String -> Irate -> [k0] -> SignalOut+printks s0string i1time k2argN = outOpcode "printks" args+ where args = [to s0string, to i1time] ++ map to k2argN+++-- | * opcode : prints+-- +-- +-- * syntax : +-- +-- > prints "string" [, kval1] [, kval2] [...]+-- +-- +-- * description : +-- +-- Prints at init-time using a printf() style syntax.+-- +-- +-- * url : <http://www.csounds.com/manual/html/prints.html>+ +prints :: (K k0) => String -> [k0] -> SignalOut+prints s0string k1argN = outOpcode "prints" args+ where args = [to s0string] ++ map to k1argN
+ src/CsoundExpr/Opcodes/Sigio/Queries.hs view
@@ -0,0 +1,95 @@+-- | Sound File Queries+module CsoundExpr.Opcodes.Sigio.Queries+ (filelen,+ filenchnls,+ filepeak,+ filesr)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : filelen+-- +-- +-- * syntax : +-- +-- > ir filelen ifilcod, [iallowraw]+-- +-- +-- * description : +-- +-- Returns the length of a sound file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/filelen.html>+ +filelen :: [Irate] -> String -> Irate+filelen i0init s1file = opcode "filelen" args+ where args = [to s1file] ++ map to i0init+++-- | * opcode : filenchnls+-- +-- +-- * syntax : +-- +-- > ir filenchnls ifilcod [, iallowraw]+-- +-- +-- * description : +-- +-- Returns the number of channels in a sound file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/filenchnls.html>+ +filenchnls :: [Irate] -> String -> Irate+filenchnls i0init s1file = opcode "filenchnls" args+ where args = [to s1file] ++ map to i0init+++-- | * opcode : filepeak+-- +-- +-- * syntax : +-- +-- > ir filepeak ifilcod [, ichnl]+-- +-- +-- * description : +-- +-- Returns the peak absolute value of a sound file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/filepeak.html>+ +filepeak :: [Irate] -> String -> Irate+filepeak i0init s1file = opcode "filepeak" args+ where args = [to s1file] ++ map to i0init+++-- | * opcode : filesr+-- +-- +-- * syntax : +-- +-- > ir filesr ifilcod [, iallowraw]+-- +-- +-- * description : +-- +-- Returns the sample rate of a sound file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/filesr.html>+ +filesr :: [Irate] -> String -> Irate+filesr i0init s1file = opcode "filesr" args+ where args = [to s1file] ++ map to i0init
+ src/CsoundExpr/Opcodes/Sigio/SoftwareBus.hs view
@@ -0,0 +1,575 @@+-- | Software Bus+module CsoundExpr.Opcodes.Sigio.SoftwareBus+ (chn_k,+ chn_a,+ chn_S,+ chngetA,+ chngetI,+ chngetK,+ chngetS,+ chnsetA,+ chnsetI,+ chnsetK,+ chnsetS,+ chnsendA,+ chnsendI,+ chnsendK,+ chnsendS,+ chnrecvA,+ chnrecvI,+ chnrecvK,+ chnrecvS,+ chnclear,+ chnmix,+ chnparams)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : chn_k+-- +-- +-- * syntax : +-- +-- > chn_k Sname, imode[, itype, idflt, imin, imax]+-- > chn_a Sname, imode+-- > chn_S Sname, imode+-- +-- +-- * description : +-- +-- Declare a channel of the named software bus, with setting+-- optional parameters in the case of a control channel. If the+-- channel does not exist yet, it is created, with an inital value+-- of zero or empty string. Otherwise, the type (control, audio, or+-- string) of the existing channel must match the declaration, or an+-- init error occurs. The input/output mode of an existing channel+-- is updated so that it becomes the bitwise OR of the previous and+-- the newly specified value.+-- +-- +-- * url : <http://www.csounds.com/manual/html/chn.html>+ +chn_k :: [Irate] -> String -> Irate -> SignalOut+chn_k i0init s1name i2mode = outOpcode "chn_k" args+ where args = [to s1name, to i2mode] ++ map to i0init+++-- | * opcode : chn_a+-- +-- +-- * syntax : +-- +-- > chn_k Sname, imode[, itype, idflt, imin, imax]+-- > chn_a Sname, imode+-- > chn_S Sname, imode+-- +-- +-- * description : +-- +-- Declare a channel of the named software bus, with setting+-- optional parameters in the case of a control channel. If the+-- channel does not exist yet, it is created, with an inital value+-- of zero or empty string. Otherwise, the type (control, audio, or+-- string) of the existing channel must match the declaration, or an+-- init error occurs. The input/output mode of an existing channel+-- is updated so that it becomes the bitwise OR of the previous and+-- the newly specified value.+-- +-- +-- * url : <http://www.csounds.com/manual/html/chn.html>+ +chn_a :: String -> Irate -> SignalOut+chn_a s0name i1mode = outOpcode "chn_a" args+ where args = [to s0name, to i1mode]+++-- | * opcode : chn_S+-- +-- +-- * syntax : +-- +-- > chn_k Sname, imode[, itype, idflt, imin, imax]+-- > chn_a Sname, imode+-- > chn_S Sname, imode+-- +-- +-- * description : +-- +-- Declare a channel of the named software bus, with setting+-- optional parameters in the case of a control channel. If the+-- channel does not exist yet, it is created, with an inital value+-- of zero or empty string. Otherwise, the type (control, audio, or+-- string) of the existing channel must match the declaration, or an+-- init error occurs. The input/output mode of an existing channel+-- is updated so that it becomes the bitwise OR of the previous and+-- the newly specified value.+-- +-- +-- * url : <http://www.csounds.com/manual/html/chn.html>+ +chn_S :: String -> Irate -> SignalOut+chn_S s0name i1mode = outOpcode "chn_S" args+ where args = [to s0name, to i1mode]+++-- | * opcode : chnget+-- +-- +-- * syntax : +-- +-- > ival chnget Sname+-- > kval chnget Sname+-- > aval chnget Sname+-- > Sval chnget Sname+-- +-- +-- * description : +-- +-- Reads data from a channel of the inward named software bus.+-- Implies declaring the channel with imode=1 (see also chn_k,+-- chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnget.html>+ +chngetA :: String -> Arate+chngetA s0name = opcode "chnget" args+ where args = [to s0name]+++-- | * opcode : chnget+-- +-- +-- * syntax : +-- +-- > ival chnget Sname+-- > kval chnget Sname+-- > aval chnget Sname+-- > Sval chnget Sname+-- +-- +-- * description : +-- +-- Reads data from a channel of the inward named software bus.+-- Implies declaring the channel with imode=1 (see also chn_k,+-- chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnget.html>+ +chngetI :: String -> Irate+chngetI s0name = opcode "chnget" args+ where args = [to s0name]+++-- | * opcode : chnget+-- +-- +-- * syntax : +-- +-- > ival chnget Sname+-- > kval chnget Sname+-- > aval chnget Sname+-- > Sval chnget Sname+-- +-- +-- * description : +-- +-- Reads data from a channel of the inward named software bus.+-- Implies declaring the channel with imode=1 (see also chn_k,+-- chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnget.html>+ +chngetK :: String -> Krate+chngetK s0name = opcode "chnget" args+ where args = [to s0name]+++-- | * opcode : chnget+-- +-- +-- * syntax : +-- +-- > ival chnget Sname+-- > kval chnget Sname+-- > aval chnget Sname+-- > Sval chnget Sname+-- +-- +-- * description : +-- +-- Reads data from a channel of the inward named software bus.+-- Implies declaring the channel with imode=1 (see also chn_k,+-- chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnget.html>+ +chngetS :: String -> String+chngetS s0name = opcode "chnget" args+ where args = [to s0name]+++-- | * opcode : chnset+-- +-- +-- * syntax : +-- +-- > chnset ival, Sname+-- > chnset kval, Sname+-- > chnset aval, Sname+-- > chnset Sval, Sname+-- +-- +-- * description : +-- +-- Write to a channel of the named software bus. Implies declaring+-- the channel with imod=2 (see also chn_k, chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnset.html>+ +chnsetA :: Arate -> String -> SignalOut+chnsetA a0val s1name = outOpcode "chnset" args+ where args = [to a0val, to s1name]+++-- | * opcode : chnset+-- +-- +-- * syntax : +-- +-- > chnset ival, Sname+-- > chnset kval, Sname+-- > chnset aval, Sname+-- > chnset Sval, Sname+-- +-- +-- * description : +-- +-- Write to a channel of the named software bus. Implies declaring+-- the channel with imod=2 (see also chn_k, chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnset.html>+ +chnsetI :: Irate -> String -> SignalOut+chnsetI i0val s1name = outOpcode "chnset" args+ where args = [to i0val, to s1name]+++-- | * opcode : chnset+-- +-- +-- * syntax : +-- +-- > chnset ival, Sname+-- > chnset kval, Sname+-- > chnset aval, Sname+-- > chnset Sval, Sname+-- +-- +-- * description : +-- +-- Write to a channel of the named software bus. Implies declaring+-- the channel with imod=2 (see also chn_k, chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnset.html>+ +chnsetK :: (K k0) => k0 -> String -> SignalOut+chnsetK k0val s1name = outOpcode "chnset" args+ where args = [to k0val, to s1name]+++-- | * opcode : chnset+-- +-- +-- * syntax : +-- +-- > chnset ival, Sname+-- > chnset kval, Sname+-- > chnset aval, Sname+-- > chnset Sval, Sname+-- +-- +-- * description : +-- +-- Write to a channel of the named software bus. Implies declaring+-- the channel with imod=2 (see also chn_k, chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnset.html>+ +chnsetS :: String -> String -> SignalOut+chnsetS s0val s1name = outOpcode "chnset" args+ where args = [to s0val, to s1name]+++-- | * opcode : chnsend+-- +-- +-- * syntax : +-- +-- > chnsend ival, Sname+-- > chnsend kval, Sname+-- > chnsend aval, Sname+-- > chnsend Sval, Sname+-- +-- +-- * description : +-- +-- Send to a channel of the named software bus. Implies declaring+-- the channel with imode=2 (see also chn_k, chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnsend.html>+ +chnsendA :: Arate -> String -> SignalOut+chnsendA a0val s1name = outOpcode "chnsend" args+ where args = [to a0val, to s1name]+++-- | * opcode : chnsend+-- +-- +-- * syntax : +-- +-- > chnsend ival, Sname+-- > chnsend kval, Sname+-- > chnsend aval, Sname+-- > chnsend Sval, Sname+-- +-- +-- * description : +-- +-- Send to a channel of the named software bus. Implies declaring+-- the channel with imode=2 (see also chn_k, chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnsend.html>+ +chnsendI :: Irate -> String -> SignalOut+chnsendI i0val s1name = outOpcode "chnsend" args+ where args = [to i0val, to s1name]+++-- | * opcode : chnsend+-- +-- +-- * syntax : +-- +-- > chnsend ival, Sname+-- > chnsend kval, Sname+-- > chnsend aval, Sname+-- > chnsend Sval, Sname+-- +-- +-- * description : +-- +-- Send to a channel of the named software bus. Implies declaring+-- the channel with imode=2 (see also chn_k, chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnsend.html>+ +chnsendK :: (K k0) => k0 -> String -> SignalOut+chnsendK k0val s1name = outOpcode "chnsend" args+ where args = [to k0val, to s1name]+++-- | * opcode : chnsend+-- +-- +-- * syntax : +-- +-- > chnsend ival, Sname+-- > chnsend kval, Sname+-- > chnsend aval, Sname+-- > chnsend Sval, Sname+-- +-- +-- * description : +-- +-- Send to a channel of the named software bus. Implies declaring+-- the channel with imode=2 (see also chn_k, chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnsend.html>+ +chnsendS :: String -> String -> SignalOut+chnsendS s0val s1name = outOpcode "chnsend" args+ where args = [to s0val, to s1name]+++-- | * opcode : chnrecv+-- +-- +-- * syntax : +-- +-- > ival chnrecv Sname+-- > kval chnrecv Sname+-- > aval chnrecv Sname+-- > Sval chnrecv Sname+-- +-- +-- * description : +-- +-- Receives data from a channel of the inward named software bus.+-- Implies declaring the channel with imode=1 (see also chn_k,+-- chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnrecv.html>+ +chnrecvA :: String -> Arate+chnrecvA s0name = opcode "chnrecv" args+ where args = [to s0name]+++-- | * opcode : chnrecv+-- +-- +-- * syntax : +-- +-- > ival chnrecv Sname+-- > kval chnrecv Sname+-- > aval chnrecv Sname+-- > Sval chnrecv Sname+-- +-- +-- * description : +-- +-- Receives data from a channel of the inward named software bus.+-- Implies declaring the channel with imode=1 (see also chn_k,+-- chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnrecv.html>+ +chnrecvI :: String -> Irate+chnrecvI s0name = opcode "chnrecv" args+ where args = [to s0name]+++-- | * opcode : chnrecv+-- +-- +-- * syntax : +-- +-- > ival chnrecv Sname+-- > kval chnrecv Sname+-- > aval chnrecv Sname+-- > Sval chnrecv Sname+-- +-- +-- * description : +-- +-- Receives data from a channel of the inward named software bus.+-- Implies declaring the channel with imode=1 (see also chn_k,+-- chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnrecv.html>+ +chnrecvK :: String -> Krate+chnrecvK s0name = opcode "chnrecv" args+ where args = [to s0name]+++-- | * opcode : chnrecv+-- +-- +-- * syntax : +-- +-- > ival chnrecv Sname+-- > kval chnrecv Sname+-- > aval chnrecv Sname+-- > Sval chnrecv Sname+-- +-- +-- * description : +-- +-- Receives data from a channel of the inward named software bus.+-- Implies declaring the channel with imode=1 (see also chn_k,+-- chn_a, and chn_S).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnrecv.html>+ +chnrecvS :: String -> String+chnrecvS s0name = opcode "chnrecv" args+ where args = [to s0name]+++-- | * opcode : chnclear+-- +-- +-- * syntax : +-- +-- > chnclear Sname+-- +-- +-- * description : +-- +-- Clears an audio channel of the named software bus to zero.+-- Implies declaring the channel with imode=2 (see also chn_a).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnclear.html>+ +chnclear :: String -> SignalOut+chnclear s0name = outOpcode "chnclear" args+ where args = [to s0name]+++-- | * opcode : chnmix+-- +-- +-- * syntax : +-- +-- > chnmix aval, Sname+-- +-- +-- * description : +-- +-- Adds an audio signal to a channel of the named software bus.+-- Implies declaring the channel with imode=2 (see also chn_a).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnmix.html>+ +chnmix :: Arate -> String -> SignalOut+chnmix a0val s1name = outOpcode "chnmix" args+ where args = [to a0val, to s1name]+++-- | * opcode : chnparams+-- +-- +-- * syntax : +-- +-- > itype, imode, ictltype, idflt, imin, imax chnparams+-- +-- +-- * description : +-- +-- Query parameters of a channel (if it does not exist, all+-- returned values are zero).+-- +-- +-- * url : <http://www.csounds.com/manual/html/chnparams.html>+ +chnparams :: MultiOut+chnparams = opcode "chnparams" args+ where args = []
+ src/CsoundExpr/Opcodes/Sigmod.hs view
@@ -0,0 +1,30 @@+-- | Signal Modifiers+module CsoundExpr.Opcodes.Sigmod+ (module CsoundExpr.Opcodes.Sigmod.SigProcAmpMod,+ module CsoundExpr.Opcodes.Sigmod.SigProcConmorph,+ module CsoundExpr.Opcodes.Sigmod.Delay,+ module CsoundExpr.Opcodes.Sigmod.Panspatl,+ module CsoundExpr.Opcodes.Sigmod.Reverbtn,+ module CsoundExpr.Opcodes.Sigmod.Sample,+ module CsoundExpr.Opcodes.Sigmod.Siglimit,+ module CsoundExpr.Opcodes.Sigmod.Speciale,+ module CsoundExpr.Opcodes.Sigmod.Standard,+ module CsoundExpr.Opcodes.Sigmod.Speciali,+ module CsoundExpr.Opcodes.Sigmod.Wavguide,+ module CsoundExpr.Opcodes.Sigmod.Wavshape)+where++++import CsoundExpr.Opcodes.Sigmod.SigProcAmpMod+import CsoundExpr.Opcodes.Sigmod.SigProcConmorph+import CsoundExpr.Opcodes.Sigmod.Delay+import CsoundExpr.Opcodes.Sigmod.Panspatl+import CsoundExpr.Opcodes.Sigmod.Reverbtn+import CsoundExpr.Opcodes.Sigmod.Sample+import CsoundExpr.Opcodes.Sigmod.Siglimit+import CsoundExpr.Opcodes.Sigmod.Speciale+import CsoundExpr.Opcodes.Sigmod.Standard+import CsoundExpr.Opcodes.Sigmod.Speciali+import CsoundExpr.Opcodes.Sigmod.Wavguide+import CsoundExpr.Opcodes.Sigmod.Wavshape
+ src/CsoundExpr/Opcodes/Sigmod/Delay.hs view
@@ -0,0 +1,464 @@+-- | Delay+module CsoundExpr.Opcodes.Sigmod.Delay+ (delay,+ delay1,+ delayk,+ delayr,+ delayw,+ deltap,+ deltap3,+ deltapi,+ deltapn,+ deltapx,+ deltapxw,+ vdelay,+ vdelay3,+ vdelayx,+ vdelayxs,+ vdelayxq,+ vdelayxw,+ vdelayxwq,+ vdelayxws,+ multitap)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : delay+-- +-- +-- * syntax : +-- +-- > ares delay asig, idlt [, iskip]+-- +-- +-- * description : +-- +-- A signal can be read from or written into a delay path, or it+-- can be automatically delayed by some time interval.+-- +-- +-- * url : <http://www.csounds.com/manual/html/delay.html>+ +delay :: [Irate] -> Arate -> Irate -> Arate+delay i0init a1sig i2dlt = opcode "delay" args+ where args = [to a1sig, to i2dlt] ++ map to i0init+++-- | * opcode : delay1+-- +-- +-- * syntax : +-- +-- > ares delay1 asig [, iskip]+-- +-- +-- * description : +-- +-- Delays an input signal by one sample.+-- +-- +-- * url : <http://www.csounds.com/manual/html/delay1.html>+ +delay1 :: [Irate] -> Arate -> Arate+delay1 i0init a1sig = opcode "delay1" args+ where args = [to a1sig] ++ map to i0init+++-- | * opcode : delayk+-- +-- +-- * syntax : +-- +-- > kr delayk ksig, idel[, imode]+-- > kr vdel_k ksig, kdel, imdel[, imode]+-- +-- +-- * description : +-- +-- k-rate delay opcodes+-- +-- +-- * url : <http://www.csounds.com/manual/html/delayk.html>+ +delayk :: (K k0) => [Irate] -> k0 -> Irate -> Krate+delayk i0init k1sig i2del = opcode "delayk" args+ where args = [to k1sig, to i2del] ++ map to i0init+++-- | * opcode : delayr+-- +-- +-- * syntax : +-- +-- > ares delayr idlt [, iskip]+-- +-- +-- * description : +-- +-- Reads from an automatically established digital delay line.+-- +-- +-- * url : <http://www.csounds.com/manual/html/delayr.html>+ +delayr :: [Irate] -> Irate -> Arate+delayr i0init i1dlt = opcode "delayr" args+ where args = [to i1dlt] ++ map to i0init+++-- | * opcode : delayw+-- +-- +-- * syntax : +-- +-- > delayw asig+-- +-- +-- * description : +-- +-- Writes the audio signal to a digital delay line.+-- +-- +-- * url : <http://www.csounds.com/manual/html/delayw.html>+ +delayw :: Arate -> SignalOut+delayw a0sig = outOpcode "delayw" args+ where args = [to a0sig]+++-- | * opcode : deltap+-- +-- +-- * syntax : +-- +-- > ares deltap kdlt+-- +-- +-- * description : +-- +-- Tap a delay line at variable offset times.+-- +-- +-- * url : <http://www.csounds.com/manual/html/deltap.html>+ +deltap :: (K k0) => k0 -> Arate+deltap k0dlt = opcode "deltap" args+ where args = [to k0dlt]+++-- | * opcode : deltap3+-- +-- +-- * syntax : +-- +-- > ares deltap3 xdlt+-- +-- +-- * description : +-- +-- Taps a delay line at variable offset times, uses cubic+-- interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/deltap3.html>+ +deltap3 :: (X x0) => x0 -> Arate+deltap3 x0dlt = opcode "deltap3" args+ where args = [to x0dlt]+++-- | * opcode : deltapi+-- +-- +-- * syntax : +-- +-- > ares deltapi xdlt+-- +-- +-- * description : +-- +-- Taps a delay line at variable offset times, uses interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/deltapi.html>+ +deltapi :: (X x0) => x0 -> Arate+deltapi x0dlt = opcode "deltapi" args+ where args = [to x0dlt]+++-- | * opcode : deltapn+-- +-- +-- * syntax : +-- +-- > ares deltapn xnumsamps+-- +-- +-- * description : +-- +-- Tap a delay line at variable offset times.+-- +-- +-- * url : <http://www.csounds.com/manual/html/deltapn.html>+ +deltapn :: (X x0) => x0 -> Arate+deltapn x0numsamps = opcode "deltapn" args+ where args = [to x0numsamps]+++-- | * opcode : deltapx+-- +-- +-- * syntax : +-- +-- > aout deltapx adel, iwsize+-- +-- +-- * description : +-- +-- deltapx is similar to deltapi or deltap3. However, it allows+-- higher quality interpolation. This opcode can read from and write+-- to a delayr/delayw delay line with interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/deltapx.html>+ +deltapx :: Arate -> Irate -> Arate+deltapx a0del i1wsize = opcode "deltapx" args+ where args = [to a0del, to i1wsize]+++-- | * opcode : deltapxw+-- +-- +-- * syntax : +-- +-- > deltapxw ain, adel, iwsize+-- +-- +-- * description : +-- +-- deltapxw mixes the input signal to a delay line. This opcode can+-- be mixed with reading units (deltap, deltapn, deltapi, deltap3,+-- and deltapx) in any order; the actual delay time is the+-- difference of the read and write time. This opcode can read from+-- and write to a delayr/delayw delay line with interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/deltapxw.html>+ +deltapxw :: Arate -> Arate -> Irate -> SignalOut+deltapxw a0in a1del i2wsize = outOpcode "deltapxw" args+ where args = [to a0in, to a1del, to i2wsize]+++-- | * opcode : vdelay+-- +-- +-- * syntax : +-- +-- > ares vdelay asig, adel, imaxdel [, iskip]+-- +-- +-- * description : +-- +-- This is an interpolating variable time delay, it is not very+-- different from the existing implementation (deltapi), it is only+-- easier to use.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vdelay.html>+ +vdelay :: [Irate] -> Arate -> Arate -> Irate -> Arate+vdelay i0init a1sig a2del i3maxdel = opcode "vdelay" args+ where args = [to a1sig, to a2del, to i3maxdel] ++ map to i0init+++-- | * opcode : vdelay3+-- +-- +-- * syntax : +-- +-- > ares vdelay3 asig, adel, imaxdel [, iskip]+-- +-- +-- * description : +-- +-- vdelay3 is experimental. It is the same as vdelay except that it+-- uses cubic interpolation. (New in Version 3.50.)+-- +-- +-- * url : <http://www.csounds.com/manual/html/vdelay3.html>+ +vdelay3 :: [Irate] -> Arate -> Arate -> Irate -> Arate+vdelay3 i0init a1sig a2del i3maxdel = opcode "vdelay3" args+ where args = [to a1sig, to a2del, to i3maxdel] ++ map to i0init+++-- | * opcode : vdelayx+-- +-- +-- * syntax : +-- +-- > aout vdelayx ain, adl, imd, iws [, ist]+-- +-- +-- * description : +-- +-- A variable delay opcode with high quality interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vdelayx.html>+ +vdelayx :: [Irate] -> Arate -> Arate -> Irate -> Irate -> Arate+vdelayx i0init a1in a2dl i3md i4ws = opcode "vdelayx" args+ where args = [to a1in, to a2dl, to i3md, to i4ws] ++ map to i0init+++-- | * opcode : vdelayxs+-- +-- +-- * syntax : +-- +-- > aout1, aout2 vdelayxs ain1, ain2, adl, imd, iws [, ist]+-- +-- +-- * description : +-- +-- A stereo variable delay opcode with high quality interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vdelayxs.html>+ +vdelayxs ::+ [Irate] -> Arate -> Arate -> Arate -> Irate -> Irate -> MultiOut+vdelayxs i0init a1in1 a2in2 a3dl i4md i5ws = opcode "vdelayxs" args+ where args+ = [to a1in1, to a2in2, to a3dl, to i4md, to i5ws] ++ map to i0init+++-- | * opcode : vdelayxq+-- +-- +-- * syntax : +-- +-- > aout1, aout2, aout3, aout4 vdelayxq ain1, ain2, ain3, ain4, adl, imd, iws [, ist]+-- +-- +-- * description : +-- +-- A 4-channel variable delay opcode with high quality+-- interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vdelayxq.html>+ +vdelayxq ::+ [Irate] ->+ Arate ->+ Arate -> Arate -> Arate -> Arate -> Irate -> Irate -> MultiOut+vdelayxq i0init a1in1 a2in2 a3in3 a4in4 a5dl i6md i7ws+ = opcode "vdelayxq" args+ where args+ = [to a1in1, to a2in2, to a3in3, to a4in4, to a5dl, to i6md,+ to i7ws]+ ++ map to i0init+++-- | * opcode : vdelayxw+-- +-- +-- * syntax : +-- +-- > aout vdelayxw ain, adl, imd, iws [, ist]+-- +-- +-- * description : +-- +-- Variable delay opcodes with high quality interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vdelayxw.html>+ +vdelayxw :: [Irate] -> Arate -> Arate -> Irate -> Irate -> Arate+vdelayxw i0init a1in a2dl i3md i4ws = opcode "vdelayxw" args+ where args = [to a1in, to a2dl, to i3md, to i4ws] ++ map to i0init+++-- | * opcode : vdelayxwq+-- +-- +-- * syntax : +-- +-- > aout1, aout2, aout3, aout4 vdelayxwq ain1, ain2, ain3, ain4, adl, +-- > imd, iws [, ist]+-- +-- +-- * description : +-- +-- Variable delay opcodes with high quality interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vdelayxwq.html>+ +vdelayxwq ::+ [Irate] ->+ Arate ->+ Arate -> Arate -> Arate -> Arate -> Irate -> Irate -> MultiOut+vdelayxwq i0init a1in1 a2in2 a3in3 a4in4 a5dl i6md i7ws+ = opcode "vdelayxwq" args+ where args+ = [to a1in1, to a2in2, to a3in3, to a4in4, to a5dl, to i6md,+ to i7ws]+ ++ map to i0init+++-- | * opcode : vdelayxws+-- +-- +-- * syntax : +-- +-- > aout1, aout2 vdelayxws ain1, ain2, adl, imd, iws [, ist]+-- +-- +-- * description : +-- +-- Variable delay opcodes with high quality interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vdelayxws.html>+ +vdelayxws ::+ [Irate] -> Arate -> Arate -> Arate -> Irate -> Irate -> MultiOut+vdelayxws i0init a1in1 a2in2 a3dl i4md i5ws+ = opcode "vdelayxws" args+ where args+ = [to a1in1, to a2in2, to a3dl, to i4md, to i5ws] ++ map to i0init+++-- | * opcode : multitap+-- +-- +-- * syntax : +-- +-- > ares multitap asig [, itime1] [, igain1] [, itime2] [, igain2] [...]+-- +-- +-- * description : +-- +-- Multitap delay line implementation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/multitap.html>+ +multitap :: Arate -> [Irate] -> Arate+multitap a0sig i1vals = opcode "multitap" args+ where args = [to a0sig] ++ map to i1vals
+ src/CsoundExpr/Opcodes/Sigmod/Panspatl.hs view
@@ -0,0 +1,711 @@+-- | Panning and Spatialization+module CsoundExpr.Opcodes.Sigmod.Panspatl+ (locsend,+ locsig,+ pan,+ pan2,+ space,+ spdist,+ spsend,+ spat3d,+ spat3di,+ spat3dt,+ vbap16,+ vbap16move,+ vbap4,+ vbap4move,+ vbap8,+ vbap8move,+ vbaplsinit,+ vbapz,+ vbapzmove,+ hrtfer,+ hrtfmove,+ hrtfmove2,+ hrtfstat,+ bformdec,+ bformenc,+ bformencK)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : locsend+-- +-- +-- * syntax : +-- +-- > a1, a2 locsend+-- > a1, a2, a3, a4 locsend+-- +-- +-- * description : +-- +-- locsend depends upon the existence of a previously defined+-- locsig. The number of output signals must match the number in the+-- previous locsig. The output signals from locsend are derived from+-- the values given for distance and reverb in the locsig and are+-- ready to be sent to local or global reverb units (see example+-- below). The reverb amount and the balance between the 2 or 4+-- channels are calculated in the same way as described in the Dodge+-- book (an essential text!).+-- +-- +-- * url : <http://www.csounds.com/manual/html/locsend.html>+ +locsend :: MultiOut+locsend = opcode "locsend" args+ where args = []+++-- | * opcode : locsig+-- +-- +-- * syntax : +-- +-- > a1, a2 locsig asig, kdegree, kdistance, kreverbsend+-- > a1, a2, a3, a4 locsig asig, kdegree, kdistance, kreverbsend+-- +-- +-- * description : +-- +-- locsig takes an input signal and distributes it among 2 or 4+-- channels using values in degrees to calculate the balance between+-- adjacent channels. It also takes arguments for distance (used to+-- attenuate signals that are to sound as if they are some distance+-- further than the loudspeaker itself), and for the amount the+-- signal that will be sent to reverberators. This unit is based+-- upon the example in the Charles Dodge/Thomas Jerse book, Computer+-- Music, page 320.+-- +-- +-- * url : <http://www.csounds.com/manual/html/locsig.html>+ +locsig :: (K k0, K k1, K k2) => Arate -> k0 -> k1 -> k2 -> MultiOut+locsig a0sig k1degree k2distance k3reverbsend+ = opcode "locsig" args+ where args+ = [to a0sig, to k1degree, to k2distance, to k3reverbsend]+++-- | * opcode : pan+-- +-- +-- * syntax : +-- +-- > a1, a2, a3, a4 pan asig, kx, ky, ifn [, imode] [, ioffset]+-- +-- +-- * description : +-- +-- Distribute an audio signal amongst four channels with+-- localization control.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pan.html>+ +pan ::+ (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Irate -> MultiOut+pan i0init a1sig k2x k3y i4fn = opcode "pan" args+ where args = [to a1sig, to k2x, to k3y, to i4fn] ++ map to i0init+++-- | * opcode : pan2+-- +-- +-- * syntax : +-- +-- > a1, a2 pan2 asig, xp [, imode]+-- +-- +-- * description : +-- +-- Distribute an audio signal across two channels with a choice of+-- methods.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pan2.html>+ +pan2 :: (X x0) => [Irate] -> Arate -> x0 -> MultiOut+pan2 i0init a1sig x2p = opcode "pan2" args+ where args = [to a1sig, to x2p] ++ map to i0init+++-- | * opcode : space+-- +-- +-- * syntax : +-- +-- > a1, a2, a3, a4 space asig, ifn, ktime, kreverbsend, kx, ky+-- +-- +-- * description : +-- +-- space takes an input signal and distributes it among 4 channels+-- using Cartesian xy coordinates to calculate the balance of the+-- outputs. The xy coordinates can be defined in a separate text+-- file and accessed through a Function statement in the score using+-- Gen28, or they can be specified using the optional kx, ky+-- arguments. The advantages to the former are:+-- +-- +-- * url : <http://www.csounds.com/manual/html/space.html>+ +space ::+ (K k0, K k1, K k2, K k3) =>+ Arate -> Irate -> k0 -> k1 -> k2 -> k3 -> MultiOut+space a0sig i1fn k2time k3reverbsend k4x k5y = opcode "space" args+ where args+ = [to a0sig, to i1fn, to k2time, to k3reverbsend, to k4x, to k5y]+++-- | * opcode : spdist+-- +-- +-- * syntax : +-- +-- > k1 spdist ifn, ktime, kx, ky+-- +-- +-- * description : +-- +-- spdist uses the same xy data as space, also either from a text+-- file using Gen28 or from x and y arguments given to the unit+-- directly. The purpose of this unit is to make available the+-- values for distance that are calculated from the xy coordinates.+-- +-- +-- * url : <http://www.csounds.com/manual/html/spdist.html>+ +spdist :: (K k0, K k1, K k2) => Irate -> k0 -> k1 -> k2 -> Krate+spdist i0fn k1time k2x k3y = opcode "spdist" args+ where args = [to i0fn, to k1time, to k2x, to k3y]+++-- | * opcode : spsend+-- +-- +-- * syntax : +-- +-- > a1, a2, a3, a4 spsend+-- +-- +-- * description : +-- +-- spsend depends upon the existence of a previously defined space.+-- The output signals from spsend are derived from the values given+-- for xy and reverb in the space and are ready to be sent to local+-- or global reverb units (see example below).+-- +-- +-- * url : <http://www.csounds.com/manual/html/spsend.html>+ +spsend :: MultiOut+spsend = opcode "spsend" args+ where args = []+++-- | * opcode : spat3d+-- +-- +-- * syntax : +-- +-- > aW, aX, aY, aZ spat3d ain, kX, kY, kZ, idist, ift, imode, imdel, iovr [, istor]+-- +-- +-- * description : +-- +-- This opcode positions the input sound in a 3D space, with+-- optional simulation of room acoustics, in various output formats.+-- spat3d allows moving the sound at k-rate (this movement is+-- interpolated internally to eliminate "zipper noise" if sr not+-- equal to kr).+-- +-- +-- * url : <http://www.csounds.com/manual/html/spat3d.html>+ +spat3d ::+ (K k0, K k1, K k2) =>+ [Irate] ->+ Arate ->+ k0 ->+ k1 -> k2 -> Irate -> Irate -> Irate -> Irate -> Irate -> MultiOut+spat3d i0init a1in k2X k3Y k4Z i5dist i6ft i7mode i8mdel i9ovr+ = opcode "spat3d" args+ where args+ = [to a1in, to k2X, to k3Y, to k4Z, to i5dist, to i6ft, to i7mode,+ to i8mdel, to i9ovr]+ ++ map to i0init+++-- | * opcode : spat3di+-- +-- +-- * syntax : +-- +-- > aW, aX, aY, aZ spat3di ain, iX, iY, iZ, idist, ift, imode [, istor]+-- +-- +-- * description : +-- +-- This opcode positions the input sound in a 3D space, with+-- optional simulation of room acoustics, in various output formats.+-- With spat3di, sound source position is set at i-time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/spat3di.html>+ +spat3di ::+ [Irate] ->+ Arate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> MultiOut+spat3di i0init a1in i2X i3Y i4Z i5dist i6ft i7mode+ = opcode "spat3di" args+ where args+ = [to a1in, to i2X, to i3Y, to i4Z, to i5dist, to i6ft, to i7mode]+ ++ map to i0init+++-- | * opcode : spat3dt+-- +-- +-- * syntax : +-- +-- > spat3dt ioutft, iX, iY, iZ, idist, ift, imode, irlen [, iftnocl]+-- +-- +-- * description : +-- +-- This opcode positions the input sound in a 3D space, with+-- optional simulation of room acoustics, in various output formats.+-- spat3dt can be used to render the impulse response at i-time,+-- storing output in a function table, suitable for convolution.+-- +-- +-- * url : <http://www.csounds.com/manual/html/spat3dt.html>+ +spat3dt ::+ [Irate] ->+ Irate ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+spat3dt i0init i1outft i2X i3Y i4Z i5dist i6ft i7mode i8rlen+ = outOpcode "spat3dt" args+ where args+ = [to i1outft, to i2X, to i3Y, to i4Z, to i5dist, to i6ft,+ to i7mode, to i8rlen]+ ++ map to i0init+++-- | * opcode : vbap16+-- +-- +-- * syntax : +-- +-- > ar1,..., ar16 vbap16 asig, kazim [, kelev] [, kspread]+-- +-- +-- * description : +-- +-- Distributes an audio signal among 16 channels.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vbap16.html>+ +vbap16 :: (K k0, K k1) => [k0] -> Arate -> k1 -> MultiOut+vbap16 k0init a1sig k2azim = opcode "vbap16" args+ where args = [to a1sig, to k2azim] ++ map to k0init+++-- | * opcode : vbap16move+-- +-- +-- * syntax : +-- +-- > ar1,..., ar16 vbap16move asig, idur, ispread, ifldnum, ifld1 +-- > [, ifld2] [...]+-- +-- +-- * description : +-- +-- Distribute an audio signal among 16 channels with moving virtual+-- sources.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vbap16move.html>+ +vbap16move ::+ Arate -> Irate -> Irate -> Irate -> [Irate] -> MultiOut+vbap16move a0sig i1dur i2spread i3fldnum i4fldN+ = opcode "vbap16move" args+ where args+ = [to a0sig, to i1dur, to i2spread, to i3fldnum] ++ map to i4fldN+++-- | * opcode : vbap4+-- +-- +-- * syntax : +-- +-- > ar1, ar2, ar3, ar4 vbap4 asig, kazim [, kelev] [, kspread]+-- +-- +-- * description : +-- +-- Distributes an audio signal among 4 channels.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vbap4.html>+ +vbap4 :: (K k0, K k1) => [k0] -> Arate -> k1 -> MultiOut+vbap4 k0init a1sig k2azim = opcode "vbap4" args+ where args = [to a1sig, to k2azim] ++ map to k0init+++-- | * opcode : vbap4move+-- +-- +-- * syntax : +-- +-- > ar1, ar2, ar3, ar4 vbap4move asig, idur, ispread, ifldnum, ifld1 +-- > [, ifld2] [...]+-- +-- +-- * description : +-- +-- Distributes an audio signal among 4 channels with moving virtual+-- sources.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vbap4move.html>+ +vbap4move ::+ Arate -> Irate -> Irate -> Irate -> [Irate] -> MultiOut+vbap4move a0sig i1dur i2spread i3fldnum i4fldN+ = opcode "vbap4move" args+ where args+ = [to a0sig, to i1dur, to i2spread, to i3fldnum] ++ map to i4fldN+++-- | * opcode : vbap8+-- +-- +-- * syntax : +-- +-- > ar1,..., ar8 vbap8 asig, kazim [, kelev] [, kspread]+-- +-- +-- * description : +-- +-- Distributes an audio signal among 8 channels.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vbap8.html>+ +vbap8 :: (K k0, K k1) => [k0] -> Arate -> k1 -> MultiOut+vbap8 k0init a1sig k2azim = opcode "vbap8" args+ where args = [to a1sig, to k2azim] ++ map to k0init+++-- | * opcode : vbap8move+-- +-- +-- * syntax : +-- +-- > ar1,..., ar8 vbap8move asig, idur, ispread, ifldnum, ifld1 +-- > [, ifld2] [...]+-- +-- +-- * description : +-- +-- Distributes an audio signal among 8 channels with moving virtual+-- sources.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vbap8move.html>+ +vbap8move ::+ Arate -> Irate -> Irate -> Irate -> [Irate] -> MultiOut+vbap8move a0sig i1dur i2spread i3fldnum i4fldN+ = opcode "vbap8move" args+ where args+ = [to a0sig, to i1dur, to i2spread, to i3fldnum] ++ map to i4fldN+++-- | * opcode : vbaplsinit+-- +-- +-- * syntax : +-- +-- > vbaplsinit idim, ilsnum [, idir1] [, idir2] [...] [, idir32]+-- +-- +-- * description : +-- +-- Configures VBAP output according to loudspeaker parameters.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vbaplsinit.html>+ +vbaplsinit :: Irate -> Irate -> [Irate] -> SignalOut+vbaplsinit i0dim i1lsnum i2dirN = outOpcode "vbaplsinit" args+ where args = [to i0dim, to i1lsnum] ++ map to i2dirN+++-- | * opcode : vbapz+-- +-- +-- * syntax : +-- +-- > vbapz inumchnls, istartndx, asig, kazim [, kelev] [, kspread]+-- +-- +-- * description : +-- +-- Writes a multi-channel audio signal to a ZAK array.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vbapz.html>+ +vbapz ::+ (K k0, K k1) => [k0] -> Irate -> Irate -> Arate -> k1 -> SignalOut+vbapz k0init i1numchnls i2startndx a3sig k4azim+ = outOpcode "vbapz" args+ where args+ = [to i1numchnls, to i2startndx, to a3sig, to k4azim] +++ map to k0init+++-- | * opcode : vbapzmove+-- +-- +-- * syntax : +-- +-- > vbapzmove inumchnls, istartndx, asig, idur, ispread, ifldnum, ifld1, +-- > ifld2, [...]+-- +-- +-- * description : +-- +-- Writes a multi-channel audio signal to a ZAK array with moving+-- virtual sources.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vbapzmove.html>+ +vbapzmove ::+ Irate ->+ Irate -> Arate -> Irate -> Irate -> Irate -> [Irate] -> SignalOut+vbapzmove i0numchnls i1startndx a2sig i3dur i4spread i5fldnum+ i6fldN = outOpcode "vbapzmove" args+ where args+ = [to i0numchnls, to i1startndx, to a2sig, to i3dur, to i4spread,+ to i5fldnum]+ ++ map to i6fldN+++-- | * opcode : hrtfer+-- +-- +-- * syntax : +-- +-- > aleft, aright hrtfer asig, kaz, kelev, âHRTFcompactâ+-- +-- +-- * description : +-- +-- Output is binaural (headphone) 3D audio.+-- +-- +-- * url : <http://www.csounds.com/manual/html/hrtfer.html>+ +hrtfer :: (K k0, K k1) => Arate -> k0 -> k1 -> MultiOut+hrtfer a0sig k1az k2elev = opcode "hrtfer" args+ where args = [to a0sig, to k1az, to k2elev]+++-- | * opcode : hrtfmove+-- +-- +-- * syntax : +-- +-- > aleft, aright hrtfmove asrc, kAz, kElev, ifilel, ifiler [, imode, ifade, isr]+-- +-- +-- * description : +-- +-- This opcode takes a source signal and spatialises it in the 3+-- dimensional space around a listener by convolving the source with+-- stored head related transfer function (HRTF) based filters.+-- +-- +-- * url : <http://www.csounds.com/manual/html/hrtfmove.html>+ +hrtfmove ::+ (K k0, K k1) =>+ [Irate] -> Arate -> k0 -> k1 -> Irate -> Irate -> MultiOut+hrtfmove i0init a1src k2Az k3Elev i4filel i5filer+ = opcode "hrtfmove" args+ where args+ = [to a1src, to k2Az, to k3Elev, to i4filel, to i5filer] +++ map to i0init+++-- | * opcode : hrtfmove2+-- +-- +-- * syntax : +-- +-- > aleft, aright hrtfmove2 asrc, kAz, kElev, ifilel, ifiler [,ioverlap, iradius, isr]+-- +-- +-- * description : +-- +-- This opcode takes a source signal and spatialises it in the 3+-- dimensional space around a listener using head related transfer+-- function (HRTF) based filters.+-- +-- +-- * url : <http://www.csounds.com/manual/html/hrtfmove2.html>+ +hrtfmove2 ::+ (K k0, K k1) =>+ [Irate] -> Arate -> k0 -> k1 -> Irate -> Irate -> MultiOut+hrtfmove2 i0init a1src k2Az k3Elev i4filel i5filer+ = opcode "hrtfmove2" args+ where args+ = [to a1src, to k2Az, to k3Elev, to i4filel, to i5filer] +++ map to i0init+++-- | * opcode : hrtfstat+-- +-- +-- * syntax : +-- +-- > aleft, aright hrtfstat asrc, iAz, iElev, ifilel, ifiler [,iradius, isr]+-- +-- +-- * description : +-- +-- This opcode takes a source signal and spatialises it in the 3+-- dimensional space around a listener using head related transfer+-- function (HRTF) based filters. It produces a static output+-- (azimuth and elevation parameters are i-rate), because a static+-- source allows much more efficient processing than hrtfmove and+-- hrtfmove2,.+-- +-- +-- * url : <http://www.csounds.com/manual/html/hrtfstat.html>+ +hrtfstat ::+ [Irate] -> Arate -> Irate -> Irate -> Irate -> Irate -> MultiOut+hrtfstat i0init a1src i2Az i3Elev i4filel i5filer+ = opcode "hrtfstat" args+ where args+ = [to a1src, to i2Az, to i3Elev, to i4filel, to i5filer] +++ map to i0init+++-- | * opcode : bformdec+-- +-- +-- * syntax : +-- +-- > ao1, ao2 bformdec isetup, aw, ax, ay, az [, ar, as, at, au, av +-- > [, abk, al, am, an, ao, ap, aq]]+-- > ao1, ao2, ao3, ao4 bformdec isetup, aw, ax, ay, az [, ar, as, at, +-- > au, av [, abk, al, am, an, ao, ap, aq]]+-- > ao1, ao2, ao3, ao4, ao5 bformdec isetup, aw, ax, ay, az [, ar, as, +-- > at, au, av [, abk, al, am, an, ao, ap, aq]]+-- > ao1, ao2, ao3, ao4, ao5, ao6, ao7, ao8 bformdec isetup, aw, ax, ay, az +-- > [, ar, as, at, au, av [, abk, al, am, an, ao, ap, aq]]]+-- +-- +-- * description : +-- +-- Decodes an ambisonic B format signal into loudspeaker specific+-- signals. Note that this opcode is deprecated as it is inaccurate,+-- and is replaced by the much better opcode bformdec1 which+-- replicates all the important features.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bformdec.html>+ +bformdec ::+ [Arate] -> Irate -> Arate -> Arate -> Arate -> Arate -> MultiOut+bformdec a0init i1setup a2w a3x a4y a5z = opcode "bformdec" args+ where args+ = [to i1setup, to a2w, to a3x, to a4y, to a5z] ++ map to a0init+++-- | * opcode : bformenc+-- +-- +-- * syntax : +-- +-- > aw, ax, ay, az bformenc asig, kalpha, kbeta, kord0, kord1+-- > aw, ax, ay, az, ar, as, at, au, av bformenc asig, kalpha, kbeta, +-- > kord0, kord1, kord2+-- > aw, ax, ay, az, ar, as, at, au, av, ak, al, am, an, ao, ap, aq bformenc +-- > asig, kalpha, kbeta, kord0, kord1, kord2, kord3+-- +-- +-- * description : +-- +-- Codes a signal into the ambisonic B format. Note that this+-- opcode is deprecated as it is inaccurate, and is replaced by the+-- much better opcode bformenc1 which replicates all the important+-- features; also note that the gain arguments are not available in+-- bformenc1.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bformenc.html>+ +bformenc ::+ (K k0, K k1, K k2, K k3) =>+ Arate -> k0 -> k1 -> k2 -> k3 -> MultiOut+bformenc a0sig k1alpha k2beta k3ord0 k4ord1+ = opcode "bformenc" args+ where args+ = [to a0sig, to k1alpha, to k2beta, to k3ord0, to k4ord1]+++-- | * opcode : bformenc+-- +-- +-- * syntax : +-- +-- > aw, ax, ay, az bformenc asig, kalpha, kbeta, kord0, kord1+-- > aw, ax, ay, az, ar, as, at, au, av bformenc asig, kalpha, kbeta, +-- > kord0, kord1, kord2+-- > aw, ax, ay, az, ar, as, at, au, av, ak, al, am, an, ao, ap, aq bformenc +-- > asig, kalpha, kbeta, kord0, kord1, kord2, kord3+-- +-- +-- * description : +-- +-- Codes a signal into the ambisonic B format. Note that this+-- opcode is deprecated as it is inaccurate, and is replaced by the+-- much better opcode bformenc1 which replicates all the important+-- features; also note that the gain arguments are not available in+-- bformenc1.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bformenc.html>+ +bformencK ::+ (K k0, K k1, K k2, K k3, K k4) =>+ Arate -> k0 -> k1 -> k2 -> k3 -> k4 -> MultiOut+bformencK a0sig k1alpha k2beta k3ord0 k4ord1 k5ord2+ = opcode "bformenc" args+ where args+ = [to a0sig, to k1alpha, to k2beta, to k3ord0, to k4ord1,+ to k5ord2]
+ src/CsoundExpr/Opcodes/Sigmod/Reverbtn.hs view
@@ -0,0 +1,282 @@+-- | Reverberation+module CsoundExpr.Opcodes.Sigmod.Reverbtn+ (alpass,+ babo,+ comb,+ freeverb,+ nestedap,+ nreverb,+ reverb2,+ reverb,+ reverbsc,+ valpass,+ vcomb)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : alpass+-- +-- +-- * syntax : +-- +-- > ares alpass asig, krvt, ilpt [, iskip] [, insmps]+-- +-- +-- * description : +-- +-- Reverberates an input signal with a flat frequency response.+-- +-- +-- * url : <http://www.csounds.com/manual/html/alpass.html>+ +alpass :: (K k0) => [Irate] -> Arate -> k0 -> Irate -> Arate+alpass i0init a1sig k2rvt i3lpt = opcode "alpass" args+ where args = [to a1sig, to k2rvt, to i3lpt] ++ map to i0init+++-- | * opcode : babo+-- +-- +-- * syntax : +-- +-- > a1, a2 babo asig, ksrcx, ksrcy, ksrcz, irx, iry, irz [, idiff] [, ifno]+-- +-- +-- * description : +-- +-- babo stands for ball-within-the-box. It is a physical model+-- reverberator based on the paper by Davide Rocchesso "The Ball+-- within the Box: a sound-processing metaphor", Computer Music+-- Journal, Vol 19, N.4, pp.45-47, Winter 1995.+-- +-- +-- * url : <http://www.csounds.com/manual/html/babo.html>+ +babo ::+ (K k0, K k1, K k2) =>+ [Irate] ->+ Arate -> k0 -> k1 -> k2 -> Irate -> Irate -> Irate -> MultiOut+babo i0init a1sig k2srcx k3srcy k4srcz i5rx i6ry i7rz+ = opcode "babo" args+ where args+ = [to a1sig, to k2srcx, to k3srcy, to k4srcz, to i5rx, to i6ry,+ to i7rz]+ ++ map to i0init+++-- | * opcode : comb+-- +-- +-- * syntax : +-- +-- > ares comb asig, krvt, ilpt [, iskip] [, insmps]+-- +-- +-- * description : +-- +-- Reverberates an input signal with a colored frequency response.+-- +-- +-- * url : <http://www.csounds.com/manual/html/comb.html>+ +comb :: (K k0) => [Irate] -> Arate -> k0 -> Irate -> Arate+comb i0init a1sig k2rvt i3lpt = opcode "comb" args+ where args = [to a1sig, to k2rvt, to i3lpt] ++ map to i0init+++-- | * opcode : freeverb+-- +-- +-- * syntax : +-- +-- > aoutL, aoutR freeverb ainL, ainR, kRoomSize, kHFDamp[, iSRate[, iSkip]]+-- +-- +-- * description : +-- +-- freeverb is a stereo reverb unit based on Jezar's public domain+-- C++ sources, composed of eight parallel comb filters on both+-- channels, followed by four allpass units in series. The filters+-- on the right channel are slightly detuned compared to the left+-- channel in order to create a stereo effect.+-- +-- +-- * url : <http://www.csounds.com/manual/html/freeverb.html>+ +freeverb ::+ (K k0, K k1) => [Irate] -> Arate -> Arate -> k0 -> k1 -> MultiOut+freeverb i0init a1inL a2inR k3RoomSize k4HFDamp+ = opcode "freeverb" args+ where args+ = [to a1inL, to a2inR, to k3RoomSize, to k4HFDamp] ++ map to i0init+++-- | * opcode : nestedap+-- +-- +-- * syntax : +-- +-- > ares nestedap asig, imode, imaxdel, idel1, igain1 [, idel2] [, igain2] +-- > [, idel3] [, igain3] [, istor]+-- +-- +-- * description : +-- +-- Three different nested all-pass filters, useful for implementing+-- reverbs.+-- +-- +-- * url : <http://www.csounds.com/manual/html/nestedap.html>+ +nestedap ::+ [Irate] -> Arate -> Irate -> Irate -> Irate -> Irate -> Arate+nestedap i0init a1sig i2mode i3maxdel i4del1 i5gain1+ = opcode "nestedap" args+ where args+ = [to a1sig, to i2mode, to i3maxdel, to i4del1, to i5gain1] +++ map to i0init+++-- | * opcode : nreverb+-- +-- +-- * syntax : +-- +-- > ares nreverb asig, ktime, khdif [, iskip] [,inumCombs] [, ifnCombs] +-- > [, inumAlpas] [, ifnAlpas]+-- +-- +-- * description : +-- +-- This is a reverberator consisting of 6 parallel comb-lowpass+-- filters being fed into a series of 5 allpass filters. nreverb+-- replaces reverb2 (version 3.48) and so both opcodes are+-- identical.+-- +-- +-- * url : <http://www.csounds.com/manual/html/nreverb.html>+ +nreverb :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+nreverb i0init a1sig k2time k3hdif = opcode "nreverb" args+ where args = [to a1sig, to k2time, to k3hdif] ++ map to i0init+++-- | * opcode : reverb2+-- +-- +-- * syntax : +-- +-- > ares reverb2 asig, ktime, khdif [, iskip] [,inumCombs] +-- > [, ifnCombs] [, inumAlpas] [, ifnAlpas]+-- +-- +-- * description : +-- +-- Same as the nreverb opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/reverb2.html>+ +reverb2 :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+reverb2 i0init a1sig k2time k3hdif = opcode "reverb2" args+ where args = [to a1sig, to k2time, to k3hdif] ++ map to i0init+++-- | * opcode : reverb+-- +-- +-- * syntax : +-- +-- > ares reverb asig, krvt [, iskip]+-- +-- +-- * description : +-- +-- Reverberates an input signal with a natural room frequency+-- response.+-- +-- +-- * url : <http://www.csounds.com/manual/html/reverb.html>+ +reverb :: (K k0) => [Irate] -> Arate -> k0 -> Arate+reverb i0init a1sig k2rvt = opcode "reverb" args+ where args = [to a1sig, to k2rvt] ++ map to i0init+++-- | * opcode : reverbsc+-- +-- +-- * syntax : +-- +-- > aoutL, aoutR reverbsc ainL, ainR, kfblvl, kfco[, israte[, ipitchm[, iskip]]]+-- +-- +-- * description : +-- +-- 8 delay line stereo FDN reverb, with feedback matrix based upon+-- physical modeling scattering junction of 8 lossless waveguides of+-- equal characteristic impedance. Based on Csound orchestra version+-- by Sean Costello.+-- +-- +-- * url : <http://www.csounds.com/manual/html/reverbsc.html>+ +reverbsc ::+ (K k0, K k1) => [Irate] -> Arate -> Arate -> k0 -> k1 -> MultiOut+reverbsc i0init a1inL a2inR k3fblvl k4fco = opcode "reverbsc" args+ where args+ = [to a1inL, to a2inR, to k3fblvl, to k4fco] ++ map to i0init+++-- | * opcode : valpass+-- +-- +-- * syntax : +-- +-- > ares valpass asig, krvt, xlpt, imaxlpt [, iskip] [, insmps]+-- +-- +-- * description : +-- +-- Variably reverberates an input signal with a flat frequency+-- response.+-- +-- +-- * url : <http://www.csounds.com/manual/html/valpass.html>+ +valpass ::+ (K k0, X x0) => [Irate] -> Arate -> k0 -> x0 -> Irate -> Arate+valpass i0init a1sig k2rvt x3lpt i4maxlpt = opcode "valpass" args+ where args+ = [to a1sig, to k2rvt, to x3lpt, to i4maxlpt] ++ map to i0init+++-- | * opcode : vcomb+-- +-- +-- * syntax : +-- +-- > ares vcomb asig, krvt, xlpt, imaxlpt [, iskip] [, insmps]+-- +-- +-- * description : +-- +-- Variably reverberates an input signal with a colored frequency+-- response.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vcomb.html>+ +vcomb ::+ (K k0, X x0) => [Irate] -> Arate -> k0 -> x0 -> Irate -> Arate+vcomb i0init a1sig k2rvt x3lpt i4maxlpt = opcode "vcomb" args+ where args+ = [to a1sig, to k2rvt, to x3lpt, to i4maxlpt] ++ map to i0init
+ src/CsoundExpr/Opcodes/Sigmod/Sample.hs view
@@ -0,0 +1,370 @@+-- | Sample Level Operators+module CsoundExpr.Opcodes.Sigmod.Sample+ (denorm,+ diffA,+ diffK,+ downsamp,+ fold,+ integA,+ integK,+ interp,+ ntrpolA,+ ntrpolI,+ ntrpolK,+ sampholdA,+ sampholdK,+ upsamp,+ vaget,+ vaset)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : denorm+-- +-- +-- * syntax : +-- +-- > denorm a1[, a2[, a3[,... ]]]+-- +-- +-- * description : +-- +-- Mixes low level (~1e-20 for floats, and ~1e-56 for doubles)+-- noise to a list of a-rate signals. Can be used before IIR filters+-- and reverbs to avoid denormalized numbers which may otherwise+-- result in significantly increased CPU usage.+-- +-- +-- * url : <http://www.csounds.com/manual/html/denorm.html>+ +denorm :: [Arate] -> SignalOut+denorm a0N = outOpcode "denorm" args+ where args = map to a0N+++-- | * opcode : diff+-- +-- +-- * syntax : +-- +-- > ares diff asig [, iskip]+-- > kres diff ksig [, iskip]+-- +-- +-- * description : +-- +-- Modify a signal by differentiation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/diff.html>+ +diffA :: [Irate] -> Arate -> Arate+diffA i0init a1sig = opcode "diff" args+ where args = [to a1sig] ++ map to i0init+++-- | * opcode : diff+-- +-- +-- * syntax : +-- +-- > ares diff asig [, iskip]+-- > kres diff ksig [, iskip]+-- +-- +-- * description : +-- +-- Modify a signal by differentiation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/diff.html>+ +diffK :: (K k0) => [Irate] -> k0 -> Krate+diffK i0init k1sig = opcode "diff" args+ where args = [to k1sig] ++ map to i0init+++-- | * opcode : downsamp+-- +-- +-- * syntax : +-- +-- > kres downsamp asig [, iwlen]+-- +-- +-- * description : +-- +-- Modify a signal by down-sampling.+-- +-- +-- * url : <http://www.csounds.com/manual/html/downsamp.html>+ +downsamp :: [Irate] -> Arate -> Krate+downsamp i0init a1sig = opcode "downsamp" args+ where args = [to a1sig] ++ map to i0init+++-- | * opcode : fold+-- +-- +-- * syntax : +-- +-- > ares fold asig, kincr+-- +-- +-- * description : +-- +-- Adds artificial foldover to an audio signal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/fold.html>+ +fold :: (K k0) => Arate -> k0 -> Arate+fold a0sig k1incr = opcode "fold" args+ where args = [to a0sig, to k1incr]+++-- | * opcode : integ+-- +-- +-- * syntax : +-- +-- > ares integ asig [, iskip]+-- > kres integ ksig [, iskip]+-- +-- +-- * description : +-- +-- Modify a signal by integration.+-- +-- +-- * url : <http://www.csounds.com/manual/html/integ.html>+ +integA :: [Irate] -> Arate -> Arate+integA i0init a1sig = opcode "integ" args+ where args = [to a1sig] ++ map to i0init+++-- | * opcode : integ+-- +-- +-- * syntax : +-- +-- > ares integ asig [, iskip]+-- > kres integ ksig [, iskip]+-- +-- +-- * description : +-- +-- Modify a signal by integration.+-- +-- +-- * url : <http://www.csounds.com/manual/html/integ.html>+ +integK :: (K k0) => [Irate] -> k0 -> Krate+integK i0init k1sig = opcode "integ" args+ where args = [to k1sig] ++ map to i0init+++-- | * opcode : interp+-- +-- +-- * syntax : +-- +-- > ares interp ksig [, iskip] [, imode]+-- +-- +-- * description : +-- +-- Converts a control signal to an audio signal using linear+-- interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/interp.html>+ +interp :: (K k0) => [Irate] -> k0 -> Arate+interp i0init k1sig = opcode "interp" args+ where args = [to k1sig] ++ map to i0init+++-- | * opcode : ntrpol+-- +-- +-- * syntax : +-- +-- > ares ntrpol asig1, asig2, kpoint [, imin] [, imax]+-- > ires ntrpol isig1, isig2, ipoint [, imin] [, imax]+-- > kres ntrpol ksig1, ksig2, kpoint [, imin] [, imax]+-- +-- +-- * description : +-- +-- Calculates the weighted mean value (i.e. linear interpolation)+-- of two input signals+-- +-- +-- * url : <http://www.csounds.com/manual/html/ntrpol.html>+ +ntrpolA :: (K k0) => [Irate] -> Arate -> Arate -> k0 -> Arate+ntrpolA i0init a1sig1 a2sig2 k3point = opcode "ntrpol" args+ where args = [to a1sig1, to a2sig2, to k3point] ++ map to i0init+++-- | * opcode : ntrpol+-- +-- +-- * syntax : +-- +-- > ares ntrpol asig1, asig2, kpoint [, imin] [, imax]+-- > ires ntrpol isig1, isig2, ipoint [, imin] [, imax]+-- > kres ntrpol ksig1, ksig2, kpoint [, imin] [, imax]+-- +-- +-- * description : +-- +-- Calculates the weighted mean value (i.e. linear interpolation)+-- of two input signals+-- +-- +-- * url : <http://www.csounds.com/manual/html/ntrpol.html>+ +ntrpolI :: [Irate] -> Irate -> Irate -> Irate -> Irate+ntrpolI i0init i1sig1 i2sig2 i3point = opcode "ntrpol" args+ where args = [to i1sig1, to i2sig2, to i3point] ++ map to i0init+++-- | * opcode : ntrpol+-- +-- +-- * syntax : +-- +-- > ares ntrpol asig1, asig2, kpoint [, imin] [, imax]+-- > ires ntrpol isig1, isig2, ipoint [, imin] [, imax]+-- > kres ntrpol ksig1, ksig2, kpoint [, imin] [, imax]+-- +-- +-- * description : +-- +-- Calculates the weighted mean value (i.e. linear interpolation)+-- of two input signals+-- +-- +-- * url : <http://www.csounds.com/manual/html/ntrpol.html>+ +ntrpolK :: (K k0, K k1, K k2) => [Irate] -> k0 -> k1 -> k2 -> Krate+ntrpolK i0init k1sig1 k2sig2 k3point = opcode "ntrpol" args+ where args = [to k1sig1, to k2sig2, to k3point] ++ map to i0init+++-- | * opcode : samphold+-- +-- +-- * syntax : +-- +-- > ares samphold asig, agate [, ival] [, ivstor]+-- > kres samphold ksig, kgate [, ival] [, ivstor]+-- +-- +-- * description : +-- +-- Performs a sample-and-hold operation on its input.+-- +-- +-- * url : <http://www.csounds.com/manual/html/samphold.html>+ +sampholdA :: [Irate] -> Arate -> Arate -> Arate+sampholdA i0init a1sig a2gate = opcode "samphold" args+ where args = [to a1sig, to a2gate] ++ map to i0init+++-- | * opcode : samphold+-- +-- +-- * syntax : +-- +-- > ares samphold asig, agate [, ival] [, ivstor]+-- > kres samphold ksig, kgate [, ival] [, ivstor]+-- +-- +-- * description : +-- +-- Performs a sample-and-hold operation on its input.+-- +-- +-- * url : <http://www.csounds.com/manual/html/samphold.html>+ +sampholdK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Krate+sampholdK i0init k1sig k2gate = opcode "samphold" args+ where args = [to k1sig, to k2gate] ++ map to i0init+++-- | * opcode : upsamp+-- +-- +-- * syntax : +-- +-- > ares upsamp ksig+-- +-- +-- * description : +-- +-- Modify a signal by up-sampling.+-- +-- +-- * url : <http://www.csounds.com/manual/html/upsamp.html>+ +upsamp :: (K k0) => k0 -> Arate+upsamp k0sig = opcode "upsamp" args+ where args = [to k0sig]+++-- | * opcode : vaget+-- +-- +-- * syntax : +-- +-- > kval vaget kndx, avar+-- +-- +-- * description : +-- +-- Access values of the current buffer of an a-rate variable by+-- indexing. Useful for doing sample-by-sample manipulation at+-- k-rate without using setksmps 1.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vaget.html>+ +vaget :: (K k0) => k0 -> Arate -> Krate+vaget k0ndx a1var = opcode "vaget" args+ where args = [to k0ndx, to a1var]+++-- | * opcode : vaset+-- +-- +-- * syntax : +-- +-- > vaset kval, kndx, avar+-- +-- +-- * description : +-- +-- Write values into the current buffer of an a-rate variable at+-- the given index. Useful for doing sample-by-sample manipulation+-- at k-rate without using setksmps 1.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vaset.html>+ +vaset :: (K k0, K k1) => k0 -> k1 -> Arate -> SignalOut+vaset k0val k1ndx a2var = outOpcode "vaset" args+ where args = [to k0val, to k1ndx, to a2var]
+ src/CsoundExpr/Opcodes/Sigmod/SigProcAmpMod.hs view
@@ -0,0 +1,138 @@+-- | Amplitude Modifiers and Dynamic processing+module CsoundExpr.Opcodes.Sigmod.SigProcAmpMod+ (balance,+ compress,+ clip,+ dam,+ gain)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : balance+-- +-- +-- * syntax : +-- +-- > ares balance asig, acomp [, ihp] [, iskip]+-- +-- +-- * description : +-- +-- The rms power of asig can be interrogated, set, or adjusted to+-- match that of a comparator signal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/balance.html>+ +balance :: [Irate] -> Arate -> Arate -> Arate+balance i0init a1sig a2comp = opcode "balance" args+ where args = [to a1sig, to a2comp] ++ map to i0init+++-- | * opcode : compress+-- +-- +-- * syntax : +-- +-- > ar compress aasig, acsig, kthresh, kloknee, khiknee, kratio, katt, krel, ilook+-- +-- +-- * description : +-- +-- This unit functions as an audio compressor, limiter, expander,+-- or noise gate, using either soft-knee or hard-knee mapping, and+-- with dynamically variable performance characteristics. It takes+-- two audio input signals, aasig and acsig, the first of which is+-- modified by a running analysis of the second. Both signals can be+-- the same, or the first can be modified by a different controlling+-- signal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/compress.html>+ +compress ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ Arate ->+ Arate -> k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> Irate -> Arate+compress a0asig a1csig k2thresh k3loknee k4hiknee k5ratio k6att+ k7rel i8look = opcode "compress" args+ where args+ = [to a0asig, to a1csig, to k2thresh, to k3loknee, to k4hiknee,+ to k5ratio, to k6att, to k7rel, to i8look]+++-- | * opcode : clip+-- +-- +-- * syntax : +-- +-- > ares clip asig, imeth, ilimit [, iarg]+-- +-- +-- * description : +-- +-- Clips an a-rate signal to a predefined limit, in a soft manner,+-- using one of three methods.+-- +-- +-- * url : <http://www.csounds.com/manual/html/clip.html>+ +clip :: [Irate] -> Arate -> Irate -> Irate -> Arate+clip i0init a1sig i2meth i3limit = opcode "clip" args+ where args = [to a1sig, to i2meth, to i3limit] ++ map to i0init+++-- | * opcode : dam+-- +-- +-- * syntax : +-- +-- > ares dam asig, kthreshold, icomp1, icomp2, irtime, iftime+-- +-- +-- * description : +-- +-- This opcode dynamically modifies a gain value applied to the+-- input sound ain by comparing its power level to a given threshold+-- level. The signal will be compressed/expanded with different+-- factors regarding that it is over or under the threshold.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dam.html>+ +dam ::+ (K k0) => Arate -> k0 -> Irate -> Irate -> Irate -> Irate -> Arate+dam a0sig k1threshold i2comp1 i3comp2 i4rtime i5ftime+ = opcode "dam" args+ where args+ = [to a0sig, to k1threshold, to i2comp1, to i3comp2, to i4rtime,+ to i5ftime]+++-- | * opcode : gain+-- +-- +-- * syntax : +-- +-- > ares gain asig, krms [, ihp] [, iskip]+-- +-- +-- * description : +-- +-- Adjusts the amplitude audio signal according to a+-- root-mean-square value.+-- +-- +-- * url : <http://www.csounds.com/manual/html/gain.html>+ +gain :: (K k0) => [Irate] -> Arate -> k0 -> Arate+gain i0init a1sig k2rms = opcode "gain" args+ where args = [to a1sig, to k2rms] ++ map to i0init
+ src/CsoundExpr/Opcodes/Sigmod/SigProcConmorph.hs view
@@ -0,0 +1,157 @@+-- | Convolution and Morphing+module CsoundExpr.Opcodes.Sigmod.SigProcConmorph+ (convolve,+ cross2,+ dconv,+ ftconv,+ ftmorf,+ pconvolve)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : convolve+-- +-- +-- * syntax : +-- +-- > ar1 [, ar2] [, ar3] [, ar4] convolve ain, ifilcod [, ichannel]+-- +-- +-- * description : +-- +-- Output is the convolution of signal ain and the impulse response+-- contained in ifilcod. If more than one output signal is supplied,+-- each will be convolved with the same impulse response. Note that+-- it is considerably more efficient to use one instance of the+-- operator when processing a mono input to create stereo, or quad,+-- outputs.+-- +-- +-- * url : <http://www.csounds.com/manual/html/convolve.html>+ +convolve :: [Irate] -> Arate -> String -> MultiOut+convolve i0init a1in s2file = opcode "convolve" args+ where args = [to a1in, to s2file] ++ map to i0init+++-- | * opcode : cross2+-- +-- +-- * syntax : +-- +-- > ares cross2 ain1, ain2, isize, ioverlap, iwin, kbias+-- +-- +-- * description : +-- +-- This is an implementation of cross synthesis using FFT's.+-- +-- +-- * url : <http://www.csounds.com/manual/html/cross2.html>+ +cross2 ::+ (K k0) => Arate -> Arate -> Irate -> Irate -> Irate -> k0 -> Arate+cross2 a0in1 a1in2 i2size i3overlap i4win k5bias+ = opcode "cross2" args+ where args+ = [to a0in1, to a1in2, to i2size, to i3overlap, to i4win,+ to k5bias]+++-- | * opcode : dconv+-- +-- +-- * syntax : +-- +-- > ares dconv asig, isize, ifn+-- +-- +-- * description : +-- +-- A direct convolution opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dconv.html>+ +dconv :: Arate -> Irate -> Irate -> Arate+dconv a0sig i1size i2fn = opcode "dconv" args+ where args = [to a0sig, to i1size, to i2fn]+++-- | * opcode : ftconv+-- +-- +-- * syntax : +-- +-- > a1[, a2[, a3[,... a8]]] ftconv ain, ift, iplen[, iskipsamples +-- > [, iirlen[, iskipinit]]]+-- +-- +-- * description : +-- +-- Low latency multichannel convolution, using a function table as+-- impulse response source. The algorithm is to split the impulse+-- response to partitions of length determined by the iplen+-- parameter, and delay and mix partitions so that the original,+-- full length impulse response is reconstructed without gaps. The+-- output delay (latency) is iplen samples, and does not depend on+-- the control rate, unlike in the case of other convolve opcodes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ftconv.html>+ +ftconv :: [Irate] -> Arate -> Irate -> Irate -> MultiOut+ftconv i0init a1in i2ft i3plen = opcode "ftconv" args+ where args = [to a1in, to i2ft, to i3plen] ++ map to i0init+++-- | * opcode : ftmorf+-- +-- +-- * syntax : +-- +-- > ftmorf kftndx, iftfn, iresfn+-- +-- +-- * description : +-- +-- Uses an index into a table of ftable numbers to morph between+-- adjacent tables in the list.This morphed function is written into+-- the table referenced by iresfn on every k-cycle.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ftmorf.html>+ +ftmorf :: (K k0) => k0 -> Irate -> Irate -> SignalOut+ftmorf k0ftndx i1ftfn i2resfn = outOpcode "ftmorf" args+ where args = [to k0ftndx, to i1ftfn, to i2resfn]+++-- | * opcode : pconvolve+-- +-- +-- * syntax : +-- +-- > ar1 [, ar2] [, ar3] [, ar4] pconvolve ain, ifilcod [, ipartitionsize, ichannel]+-- +-- +-- * description : +-- +-- Convolution based on a uniformly partitioned overlap-save+-- algorithm. Compared to the convolve opcode, pconvolve has these+-- benefits:+-- +-- +-- * url : <http://www.csounds.com/manual/html/pconvolve.html>+ +pconvolve :: [Irate] -> Arate -> String -> MultiOut+pconvolve i0init a1in s2file = opcode "pconvolve" args+ where args = [to a1in, to s2file] ++ map to i0init
+ src/CsoundExpr/Opcodes/Sigmod/Siglimit.hs view
@@ -0,0 +1,221 @@+-- | Signal Limiters+module CsoundExpr.Opcodes.Sigmod.Siglimit+ (limitA,+ limitI,+ limitK,+ mirrorA,+ mirrorI,+ mirrorK,+ wrapA,+ wrapI,+ wrapK)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : limit+-- +-- +-- * syntax : +-- +-- > ares limit asig, klow, khigh+-- > ires limit isig, ilow, ihigh+-- > kres limit ksig, klow, khigh+-- +-- +-- * description : +-- +-- Sets the lower and upper limits of the value it processes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/limit.html>+ +limitA :: (K k0, K k1) => Arate -> k0 -> k1 -> Arate+limitA a0sig k1low k2high = opcode "limit" args+ where args = [to a0sig, to k1low, to k2high]+++-- | * opcode : limit+-- +-- +-- * syntax : +-- +-- > ares limit asig, klow, khigh+-- > ires limit isig, ilow, ihigh+-- > kres limit ksig, klow, khigh+-- +-- +-- * description : +-- +-- Sets the lower and upper limits of the value it processes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/limit.html>+ +limitI :: Irate -> Irate -> Irate -> Irate+limitI i0sig i1low i2high = opcode "limit" args+ where args = [to i0sig, to i1low, to i2high]+++-- | * opcode : limit+-- +-- +-- * syntax : +-- +-- > ares limit asig, klow, khigh+-- > ires limit isig, ilow, ihigh+-- > kres limit ksig, klow, khigh+-- +-- +-- * description : +-- +-- Sets the lower and upper limits of the value it processes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/limit.html>+ +limitK :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+limitK k0sig k1low k2high = opcode "limit" args+ where args = [to k0sig, to k1low, to k2high]+++-- | * opcode : mirror+-- +-- +-- * syntax : +-- +-- > ares mirror asig, klow, khigh+-- > ires mirror isig, ilow, ihigh+-- > kres mirror ksig, klow, khigh+-- +-- +-- * description : +-- +-- Reflects the signal that exceeds the low and high thresholds.+-- +-- +-- * url : <http://www.csounds.com/manual/html/mirror.html>+ +mirrorA :: (K k0, K k1) => Arate -> k0 -> k1 -> Arate+mirrorA a0sig k1low k2high = opcode "mirror" args+ where args = [to a0sig, to k1low, to k2high]+++-- | * opcode : mirror+-- +-- +-- * syntax : +-- +-- > ares mirror asig, klow, khigh+-- > ires mirror isig, ilow, ihigh+-- > kres mirror ksig, klow, khigh+-- +-- +-- * description : +-- +-- Reflects the signal that exceeds the low and high thresholds.+-- +-- +-- * url : <http://www.csounds.com/manual/html/mirror.html>+ +mirrorI :: Irate -> Irate -> Irate -> Irate+mirrorI i0sig i1low i2high = opcode "mirror" args+ where args = [to i0sig, to i1low, to i2high]+++-- | * opcode : mirror+-- +-- +-- * syntax : +-- +-- > ares mirror asig, klow, khigh+-- > ires mirror isig, ilow, ihigh+-- > kres mirror ksig, klow, khigh+-- +-- +-- * description : +-- +-- Reflects the signal that exceeds the low and high thresholds.+-- +-- +-- * url : <http://www.csounds.com/manual/html/mirror.html>+ +mirrorK :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+mirrorK k0sig k1low k2high = opcode "mirror" args+ where args = [to k0sig, to k1low, to k2high]+++-- | * opcode : wrap+-- +-- +-- * syntax : +-- +-- > ares wrap asig, klow, khigh+-- > ires wrap isig, ilow, ihigh+-- > kres wrap ksig, klow, khigh+-- +-- +-- * description : +-- +-- Wraps-around the signal that exceeds the low and high+-- thresholds.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wrap.html>+ +wrapA :: (K k0, K k1) => Arate -> k0 -> k1 -> Arate+wrapA a0sig k1low k2high = opcode "wrap" args+ where args = [to a0sig, to k1low, to k2high]+++-- | * opcode : wrap+-- +-- +-- * syntax : +-- +-- > ares wrap asig, klow, khigh+-- > ires wrap isig, ilow, ihigh+-- > kres wrap ksig, klow, khigh+-- +-- +-- * description : +-- +-- Wraps-around the signal that exceeds the low and high+-- thresholds.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wrap.html>+ +wrapI :: Irate -> Irate -> Irate -> Irate+wrapI i0sig i1low i2high = opcode "wrap" args+ where args = [to i0sig, to i1low, to i2high]+++-- | * opcode : wrap+-- +-- +-- * syntax : +-- +-- > ares wrap asig, klow, khigh+-- > ires wrap isig, ilow, ihigh+-- > kres wrap ksig, klow, khigh+-- +-- +-- * description : +-- +-- Wraps-around the signal that exceeds the low and high+-- thresholds.+-- +-- +-- * url : <http://www.csounds.com/manual/html/wrap.html>+ +wrapK :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+wrapK k0sig k1low k2high = opcode "wrap" args+ where args = [to k0sig, to k1low, to k2high]
+ src/CsoundExpr/Opcodes/Sigmod/Speciale.hs view
@@ -0,0 +1,161 @@+-- | Special Effects+module CsoundExpr.Opcodes.Sigmod.Speciale+ (distort,+ distort1,+ flanger,+ harmon,+ phaser1,+ phaser2)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : distort+-- +-- +-- * syntax : +-- +-- > ar distort asig, kdist, ifn[, ihp, istor]+-- +-- +-- * description : +-- +-- +-- +-- +-- * url : <http://www.csounds.com/manual/html/distort.html>+ +distort :: (K k0) => [Irate] -> Arate -> k0 -> Irate -> Arate+distort i0init a1sig k2dist i3fn = opcode "distort" args+ where args = [to a1sig, to k2dist, to i3fn] ++ map to i0init+++-- | * opcode : distort1+-- +-- +-- * syntax : +-- +-- > ares distort1 asig, kpregain, kpostgain, kshape1, kshape2[, imode]+-- +-- +-- * description : +-- +-- Implementation of modified hyperbolic tangent distortion.+-- distort1 can be used to generate wave shaping distortion based on+-- a modification of the tanh function.+-- +-- +-- * url : <http://www.csounds.com/manual/html/distort1.html>+ +distort1 ::+ (K k0, K k1, K k2, K k3) =>+ [Irate] -> Arate -> k0 -> k1 -> k2 -> k3 -> Arate+distort1 i0init a1sig k2pregain k3postgain k4shape1 k5shape2+ = opcode "distort1" args+ where args+ = [to a1sig, to k2pregain, to k3postgain, to k4shape1, to k5shape2]+ ++ map to i0init+++-- | * opcode : flanger+-- +-- +-- * syntax : +-- +-- > ares flanger asig, adel, kfeedback [, imaxd]+-- +-- +-- * description : +-- +-- A user controlled flanger.+-- +-- +-- * url : <http://www.csounds.com/manual/html/flanger.html>+ +flanger :: (K k0) => [Irate] -> Arate -> Arate -> k0 -> Arate+flanger i0init a1sig a2del k3feedback = opcode "flanger" args+ where args = [to a1sig, to a2del, to k3feedback] ++ map to i0init+++-- | * opcode : harmon+-- +-- +-- * syntax : +-- +-- > ares harmon asig, kestfrq, kmaxvar, kgenfreq1, kgenfreq2, imode, +-- > iminfrq, iprd+-- +-- +-- * description : +-- +-- Analyze an audio input and generate harmonizing voices in+-- synchrony.+-- +-- +-- * url : <http://www.csounds.com/manual/html/harmon.html>+ +harmon ::+ (K k0, K k1, K k2, K k3) =>+ Arate -> k0 -> k1 -> k2 -> k3 -> Irate -> Irate -> Irate -> Arate+harmon a0sig k1estfrq k2maxvar k3genfreq1 k4genfreq2 i5mode+ i6minfrq i7prd = opcode "harmon" args+ where args+ = [to a0sig, to k1estfrq, to k2maxvar, to k3genfreq1,+ to k4genfreq2, to i5mode, to i6minfrq, to i7prd]+++-- | * opcode : phaser1+-- +-- +-- * syntax : +-- +-- > ares phaser1 asig, kfreq, kord, kfeedback [, iskip]+-- +-- +-- * description : +-- +-- An implementation of iord number of first-order allpass filters+-- in series.+-- +-- +-- * url : <http://www.csounds.com/manual/html/phaser1.html>+ +phaser1 ::+ (K k0, K k1, K k2) => [Irate] -> Arate -> k0 -> k1 -> k2 -> Arate+phaser1 i0init a1sig k2freq k3ord k4feedback+ = opcode "phaser1" args+ where args+ = [to a1sig, to k2freq, to k3ord, to k4feedback] ++ map to i0init+++-- | * opcode : phaser2+-- +-- +-- * syntax : +-- +-- > ares phaser2 asig, kfreq, kq, kord, kmode, ksep, kfeedback+-- +-- +-- * description : +-- +-- An implementation of iord number of second-order allpass filters+-- in series.+-- +-- +-- * url : <http://www.csounds.com/manual/html/phaser2.html>+ +phaser2 ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ Arate -> k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> Arate+phaser2 a0sig k1freq k2q k3ord k4mode k5sep k6feedback+ = opcode "phaser2" args+ where args+ = [to a0sig, to k1freq, to k2q, to k3ord, to k4mode, to k5sep,+ to k6feedback]
+ src/CsoundExpr/Opcodes/Sigmod/Speciali.hs view
@@ -0,0 +1,283 @@+-- | Specialized Filters+module CsoundExpr.Opcodes.Sigmod.Speciali+ (dcblock,+ dcblock2,+ pareq,+ rbjeq,+ eqfil,+ nlfilt,+ filter2A,+ filter2K,+ fofilter,+ hilbert,+ zfilter2)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : dcblock+-- +-- +-- * syntax : +-- +-- > ares dcblock ain [, igain]+-- +-- +-- * description : +-- +-- Implements the DC blocking filter+-- +-- +-- * url : <http://www.csounds.com/manual/html/dcblock.html>+ +dcblock :: [Irate] -> Arate -> Arate+dcblock i0init a1in = opcode "dcblock" args+ where args = [to a1in] ++ map to i0init+++-- | * opcode : dcblock2+-- +-- +-- * syntax : +-- +-- > ares dcblock2 ain [, iorder] [, iskip]+-- +-- +-- * description : +-- +-- Implements a DC blocking filter with improved DC attenuation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/dcblock2.html>+ +dcblock2 :: [Irate] -> Arate -> Arate+dcblock2 i0init a1in = opcode "dcblock2" args+ where args = [to a1in] ++ map to i0init+++-- | * opcode : pareq+-- +-- +-- * syntax : +-- +-- > ares pareq asig, kc, kv, kq [, imode] [, iskip]+-- +-- +-- * description : +-- +-- Implementation of Zoelzer's parametric equalizer filters, with+-- some modifications by the author.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pareq.html>+ +pareq ::+ (K k0, K k1, K k2) => [Irate] -> Arate -> k0 -> k1 -> k2 -> Arate+pareq i0init a1sig k2c k3v k4q = opcode "pareq" args+ where args = [to a1sig, to k2c, to k3v, to k4q] ++ map to i0init+++-- | * opcode : rbjeq+-- +-- +-- * syntax : +-- +-- > ar rbjeq asig, kfco, klvl, kQ, kS[, imode]+-- +-- +-- * description : +-- +-- Parametric equalizer and filter opcode with 7 filter types,+-- based on algorithm by Robert Bristow-Johnson.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rbjeq.html>+ +rbjeq ::+ (K k0, K k1, K k2, K k3) =>+ [Irate] -> Arate -> k0 -> k1 -> k2 -> k3 -> Arate+rbjeq i0init a1sig k2fco k3lvl k4Q k5S = opcode "rbjeq" args+ where args+ = [to a1sig, to k2fco, to k3lvl, to k4Q, to k5S] ++ map to i0init+++-- | * opcode : eqfil+-- +-- +-- * syntax : +-- +-- > asig eqfil ain, kcf, kbw, kgain[, istor]+-- +-- +-- * description : +-- +-- The opcode eqfil is a 2nd order tunable equalisation filter+-- based on Regalia and Mitra design ("Tunable Digital Frequency+-- Response Equalization Filters", IEEE Trans. on Ac., Sp. and Sig+-- Proc., 35 (1), 1987). It provides a peak/notch filter for+-- building parametric/graphic equalisers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/eqfil.html>+ +eqfil ::+ (K k0, K k1, K k2) => [Irate] -> Arate -> k0 -> k1 -> k2 -> Arate+eqfil i0init a1in k2cf k3bw k4gain = opcode "eqfil" args+ where args+ = [to a1in, to k2cf, to k3bw, to k4gain] ++ map to i0init+++-- | * opcode : nlfilt+-- +-- +-- * syntax : +-- +-- > ares nlfilt ain, ka, kb, kd, kC, kL+-- +-- +-- * description : +-- +-- Implements the filter:+-- +-- +-- * url : <http://www.csounds.com/manual/html/nlfilt.html>+ +nlfilt ::+ (K k0, K k1, K k2, K k3, K k4) =>+ Arate -> k0 -> k1 -> k2 -> k3 -> k4 -> Arate+nlfilt a0in k1a k2b k3d k4C k5L = opcode "nlfilt" args+ where args = [to a0in, to k1a, to k2b, to k3d, to k4C, to k5L]+++-- | * opcode : filter2+-- +-- +-- * syntax : +-- +-- > ares filter2 asig, iM, iN, ib0, ib1,..., ibM, ia1, ia2,..., iaN+-- > kres filter2 ksig, iM, iN, ib0, ib1,..., ibM, ia1, ia2,..., iaN+-- +-- +-- * description : +-- +-- General purpose custom filter with time-varying pole control.+-- The filter coefficients implement the following difference+-- equation:+-- +-- +-- * url : <http://www.csounds.com/manual/html/filter2.html>+ +filter2A :: Arate -> Irate -> Irate -> [Irate] -> [Irate] -> Arate+filter2A a0sig i1m i2n i3bs i4as = opcode "filter2" args+ where args+ = [to a0sig, to i1m, to i2n] ++ map to i3bs ++ map to i4as+++-- | * opcode : filter2+-- +-- +-- * syntax : +-- +-- > ares filter2 asig, iM, iN, ib0, ib1,..., ibM, ia1, ia2,..., iaN+-- > kres filter2 ksig, iM, iN, ib0, ib1,..., ibM, ia1, ia2,..., iaN+-- +-- +-- * description : +-- +-- General purpose custom filter with time-varying pole control.+-- The filter coefficients implement the following difference+-- equation:+-- +-- +-- * url : <http://www.csounds.com/manual/html/filter2.html>+ +filter2K ::+ (K k0) => k0 -> Irate -> Irate -> [Irate] -> [Irate] -> Krate+filter2K k0sig i1m i2n i3bs i4as = opcode "filter2" args+ where args+ = [to k0sig, to i1m, to i2n] ++ map to i3bs ++ map to i4as+++-- | * opcode : fofilter+-- +-- +-- * syntax : +-- +-- > asig fofilter ain, kcf, kris, kdec[, istor]+-- +-- +-- * description : +-- +-- Fofilter generates a stream of overlapping sinewave grains, when+-- fed with a pulse train. Each grain is the impulse response of a+-- combination of two BP filters. The grains are defined by their+-- attack time (determining the skirtwidth of the formant region at+-- -60dB) and decay time (-6dB bandwidth). Overlapping will occur+-- when 1/freq < decay, but, unlike FOF, there is no upper limit on+-- the number of overlaps. The original idea for this opcode came+-- from J McCartney's formlet class in SuperCollider, but this is+-- possibly implemented differently(?).+-- +-- +-- * url : <http://www.csounds.com/manual/html/fofilter.html>+ +fofilter ::+ (K k0, K k1, K k2) => [Irate] -> Arate -> k0 -> k1 -> k2 -> Arate+fofilter i0init a1in k2cf k3ris k4dec = opcode "fofilter" args+ where args+ = [to a1in, to k2cf, to k3ris, to k4dec] ++ map to i0init+++-- | * opcode : hilbert+-- +-- +-- * syntax : +-- +-- > ar1, ar2 hilbert asig+-- +-- +-- * description : +-- +-- An IIR implementation of a Hilbert transformer.+-- +-- +-- * url : <http://www.csounds.com/manual/html/hilbert.html>+ +hilbert :: Arate -> MultiOut+hilbert a0sig = opcode "hilbert" args+ where args = [to a0sig]+++-- | * opcode : zfilter2+-- +-- +-- * syntax : +-- +-- > ares zfilter2 asig, kdamp, kfreq, iM, iN, ib0, ib1,..., ibM, +-- > ia1,ia2,..., iaN+-- +-- +-- * description : +-- +-- General purpose custom filter with time-varying pole control.+-- The filter coefficients implement the following difference+-- equation:+-- +-- +-- * url : <http://www.csounds.com/manual/html/zfilter2.html>+ +zfilter2 ::+ (K k0, K k1) =>+ Arate -> k0 -> k1 -> Irate -> Irate -> [Irate] -> [Irate] -> Arate+zfilter2 a0sig k1damp k2freq i3m i4n i5bs i6as+ = opcode "filter2" args+ where args+ = [to a0sig, to k1damp, to k2freq, to i3m, to i4n] ++ map to i5bs+ ++ map to i6as
+ src/CsoundExpr/Opcodes/Sigmod/Standard.hs view
@@ -0,0 +1,976 @@+-- | Standard Filters+module CsoundExpr.Opcodes.Sigmod.Standard+ (areson,+ lowpass2,+ lowres,+ lowresx,+ lpf18,+ moogvcf,+ moogladder,+ reson,+ resonr,+ resonx,+ resony,+ resonz,+ rezzy,+ statevar,+ svfilter,+ tbvcf,+ vlowres,+ bqrez,+ atone,+ atonex,+ tone,+ tonex,+ biquad,+ biquada,+ butterbp,+ butterbr,+ butterhp,+ butterlp,+ butbp,+ butbr,+ buthp,+ butlp,+ clfilt,+ aresonk,+ atonek,+ lineto,+ port,+ portk,+ resonk,+ resonxk,+ tlineto,+ tonek)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : areson+-- +-- +-- * syntax : +-- +-- > ares areson asig, kcf, kbw [, iscl] [, iskip]+-- +-- +-- * description : +-- +-- A notch filter whose transfer functions are the complements of+-- the reson opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/areson.html>+ +areson :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+areson i0init a1sig k2cf k3bw = opcode "areson" args+ where args = [to a1sig, to k2cf, to k3bw] ++ map to i0init+++-- | * opcode : lowpass2+-- +-- +-- * syntax : +-- +-- > ares lowpass2 asig, kcf, kq [, iskip]+-- +-- +-- * description : +-- +-- Implementation of a resonant second-order lowpass filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lowpass2.html>+ +lowpass2 :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+lowpass2 i0init a1sig k2cf k3q = opcode "lowpass2" args+ where args = [to a1sig, to k2cf, to k3q] ++ map to i0init+++-- | * opcode : lowres+-- +-- +-- * syntax : +-- +-- > ares lowres asig, kcutoff, kresonance [, iskip]+-- +-- +-- * description : +-- +-- lowres is a resonant lowpass filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lowres.html>+ +lowres :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+lowres i0init a1sig k2cutoff k3resonance = opcode "lowres" args+ where args+ = [to a1sig, to k2cutoff, to k3resonance] ++ map to i0init+++-- | * opcode : lowresx+-- +-- +-- * syntax : +-- +-- > ares lowresx asig, kcutoff, kresonance [, inumlayer] [, iskip]+-- +-- +-- * description : +-- +-- lowresx is equivalent to more layers of lowres with the same+-- arguments serially connected.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lowresx.html>+ +lowresx :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+lowresx i0init a1sig k2cutoff k3resonance = opcode "lowresx" args+ where args+ = [to a1sig, to k2cutoff, to k3resonance] ++ map to i0init+++-- | * opcode : lpf18+-- +-- +-- * syntax : +-- +-- > ares lpf18 asig, kfco, kres, kdist+-- +-- +-- * description : +-- +-- Implementation of a 3 pole sweepable resonant lowpass filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lpf18.html>+ +lpf18 :: (K k0, K k1, K k2) => Arate -> k0 -> k1 -> k2 -> Arate+lpf18 a0sig k1fco k2res k3dist = opcode "lpf18" args+ where args = [to a0sig, to k1fco, to k2res, to k3dist]+++-- | * opcode : moogvcf+-- +-- +-- * syntax : +-- +-- > ares moogvcf asig, xfco, xres [,iscale, iskip]+-- +-- +-- * description : +-- +-- A digital emulation of the Moog diode ladder filter+-- configuration.+-- +-- +-- * url : <http://www.csounds.com/manual/html/moogvcf.html>+ +moogvcf :: (X x0, X x1) => [Irate] -> Arate -> x0 -> x1 -> Arate+moogvcf i0init a1sig x2fco x3res = opcode "moogvcf" args+ where args = [to a1sig, to x2fco, to x3res] ++ map to i0init+++-- | * opcode : moogladder+-- +-- +-- * syntax : +-- +-- > asig moogladder ain, kcf, kres[, istor]+-- +-- +-- * description : +-- +-- Moogladder is an new digital implementation of the Moog ladder+-- filter based on the work of Antti Huovilainen, described in the+-- paper "Non-Linear Digital Implementation of the Moog Ladder+-- Filter" (Proceedings of DaFX04, Univ of Napoli). This+-- implementation is probably a more accurate digital representation+-- of the original analogue filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/moogladder.html>+ +moogladder :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+moogladder i0init a1in k2cf k3res = opcode "moogladder" args+ where args = [to a1in, to k2cf, to k3res] ++ map to i0init+++-- | * opcode : reson+-- +-- +-- * syntax : +-- +-- > ares reson asig, kcf, kbw [, iscl] [, iskip]+-- +-- +-- * description : +-- +-- A second-order resonant filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/reson.html>+ +reson :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+reson i0init a1sig k2cf k3bw = opcode "reson" args+ where args = [to a1sig, to k2cf, to k3bw] ++ map to i0init+++-- | * opcode : resonr+-- +-- +-- * syntax : +-- +-- > ares resonr asig, kcf, kbw [, iscl] [, iskip]+-- +-- +-- * description : +-- +-- Implementations of a second-order, two-pole two-zero bandpass+-- filter with variable frequency response.+-- +-- +-- * url : <http://www.csounds.com/manual/html/resonr.html>+ +resonr :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+resonr i0init a1sig k2cf k3bw = opcode "resonr" args+ where args = [to a1sig, to k2cf, to k3bw] ++ map to i0init+++-- | * opcode : resonx+-- +-- +-- * syntax : +-- +-- > ares resonx asig, kcf, kbw [, inumlayer] [, iscl] [, iskip]+-- +-- +-- * description : +-- +-- resonx is equivalent to a filters consisting of more layers of+-- reson with the same arguments, serially connected. Using a stack+-- of a larger number of filters allows a sharper cutoff. They are+-- faster than using a larger number instances in a Csound orchestra+-- of the old opcodes, because only one initialization and k- cycle+-- are needed at time and the audio loop falls entirely inside the+-- cache memory of processor.+-- +-- +-- * url : <http://www.csounds.com/manual/html/resonx.html>+ +resonx :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+resonx i0init a1sig k2cf k3bw = opcode "resonx" args+ where args = [to a1sig, to k2cf, to k3bw] ++ map to i0init+++-- | * opcode : resony+-- +-- +-- * syntax : +-- +-- > ares resony asig, kbf, kbw, inum, ksep [, isepmode] [, iscl] [, iskip]+-- +-- +-- * description : +-- +-- A bank of second-order bandpass filters, connected in parallel.+-- +-- +-- * url : <http://www.csounds.com/manual/html/resony.html>+ +resony ::+ (K k0, K k1, K k2) =>+ [Irate] -> Arate -> k0 -> k1 -> Irate -> k2 -> Arate+resony i0init a1sig k2bf k3bw i4num k5sep = opcode "resony" args+ where args+ = [to a1sig, to k2bf, to k3bw, to i4num, to k5sep] ++ map to i0init+++-- | * opcode : resonz+-- +-- +-- * syntax : +-- +-- > ares resonz asig, kcf, kbw [, iscl] [, iskip]+-- +-- +-- * description : +-- +-- Implementations of a second-order, two-pole two-zero bandpass+-- filter with variable frequency response.+-- +-- +-- * url : <http://www.csounds.com/manual/html/resonz.html>+ +resonz :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+resonz i0init a1sig k2cf k3bw = opcode "resonz" args+ where args = [to a1sig, to k2cf, to k3bw] ++ map to i0init+++-- | * opcode : rezzy+-- +-- +-- * syntax : +-- +-- > ares rezzy asig, xfco, xres [, imode, iskip]+-- +-- +-- * description : +-- +-- A resonant low-pass filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/rezzy.html>+ +rezzy :: (X x0, X x1) => [Irate] -> Arate -> x0 -> x1 -> Arate+rezzy i0init a1sig x2fco x3res = opcode "rezzy" args+ where args = [to a1sig, to x2fco, to x3res] ++ map to i0init+++-- | * opcode : statevar+-- +-- +-- * syntax : +-- +-- > ahp,alp,abp,abr statevar ain, kcf, kq [, iosamps, istor]+-- +-- +-- * description : +-- +-- Statevar is a new digital implementation of the analogue+-- state-variable filter. This filter has four simultaneous outputs:+-- high-pass, low-pass, band-pass and band-reject. This filter uses+-- oversampling for sharper resonance (default: 3 times+-- oversampling). It includes a resonance limiter that prevents the+-- filter from getting unstable.+-- +-- +-- * url : <http://www.csounds.com/manual/html/statevar.html>+ +statevar ::+ (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> MultiOut+statevar i0init a1in k2cf k3q = opcode "statevar" args+ where args = [to a1in, to k2cf, to k3q] ++ map to i0init+++-- | * opcode : svfilter+-- +-- +-- * syntax : +-- +-- > alow, ahigh, aband svfilter asig, kcf, kq [, iscl]+-- +-- +-- * description : +-- +-- Implementation of a resonant second order filter, with+-- simultaneous lowpass, highpass and bandpass outputs.+-- +-- +-- * url : <http://www.csounds.com/manual/html/svfilter.html>+ +svfilter ::+ (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> MultiOut+svfilter i0init a1sig k2cf k3q = opcode "svfilter" args+ where args = [to a1sig, to k2cf, to k3q] ++ map to i0init+++-- | * opcode : tbvcf+-- +-- +-- * syntax : +-- +-- > ares tbvcf asig, xfco, xres, kdist, kasym [, iskip]+-- +-- +-- * description : +-- +-- This opcode attempts to model some of the filter characteristics+-- of a Roland TB303 voltage-controlled filter. Euler's method is+-- used to approximate the system, rather than traditional filter+-- methods. Cutoff frequency, Q, and distortion are all coupled.+-- Empirical methods were used to try to unentwine, but frequency is+-- only approximate as a result. Future fixes for some problems with+-- this opcode may break existing orchestras relying on this version+-- of tbvcf.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tbvcf.html>+ +tbvcf ::+ (X x0, X x1, K k0, K k1) =>+ [Irate] -> Arate -> x0 -> x1 -> k0 -> k1 -> Arate+tbvcf i0init a1sig x2fco x3res k4dist k5asym = opcode "tbvcf" args+ where args+ = [to a1sig, to x2fco, to x3res, to k4dist, to k5asym] +++ map to i0init+++-- | * opcode : vlowres+-- +-- +-- * syntax : +-- +-- > ares vlowres asig, kfco, kres, iord, ksep+-- +-- +-- * description : +-- +-- A bank of filters in which the cutoff frequency can be separated+-- under user control+-- +-- +-- * url : <http://www.csounds.com/manual/html/vlowres.html>+ +vlowres ::+ (K k0, K k1, K k2) => Arate -> k0 -> k1 -> Irate -> k2 -> Arate+vlowres a0sig k1fco k2res i3ord k4sep = opcode "vlowres" args+ where args = [to a0sig, to k1fco, to k2res, to i3ord, to k4sep]+++-- | * opcode : bqrez+-- +-- +-- * syntax : +-- +-- > ares bqrez asig, xfco, xres [, imode] [, iskip]+-- +-- +-- * description : +-- +-- A second-order multi-mode filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/bqrez.html>+ +bqrez :: (X x0, X x1) => [Irate] -> Arate -> x0 -> x1 -> Arate+bqrez i0init a1sig x2fco x3res = opcode "bqrez" args+ where args = [to a1sig, to x2fco, to x3res] ++ map to i0init+++-- | * opcode : atone+-- +-- +-- * syntax : +-- +-- > ares atone asig, khp [, iskip]+-- +-- +-- * description : +-- +-- A hi-pass filter whose transfer functions are the complements of+-- the tone opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/atone.html>+ +atone :: (K k0) => [Irate] -> Arate -> k0 -> Arate+atone i0init a1sig k2hp = opcode "atone" args+ where args = [to a1sig, to k2hp] ++ map to i0init+++-- | * opcode : atonex+-- +-- +-- * syntax : +-- +-- > ares atonex asig, khp [, inumlayer] [, iskip]+-- +-- +-- * description : +-- +-- atonex is equivalent to a filter consisting of more layers of+-- atone with the same arguments, serially connected. Using a stack+-- of a larger number of filters allows a sharper cutoff. They are+-- faster than using a larger number instances in a Csound orchestra+-- of the old opcodes, because only one initialization and k- cycle+-- are needed at time and the audio loop falls entirely inside the+-- cache memory of processor.+-- +-- +-- * url : <http://www.csounds.com/manual/html/atonex.html>+ +atonex :: (K k0) => [Irate] -> Arate -> k0 -> Arate+atonex i0init a1sig k2hp = opcode "atonex" args+ where args = [to a1sig, to k2hp] ++ map to i0init+++-- | * opcode : tone+-- +-- +-- * syntax : +-- +-- > ares tone asig, khp [, iskip]+-- +-- +-- * description : +-- +-- A first-order recursive low-pass filter with variable frequency+-- response.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tone.html>+ +tone :: (K k0) => [Irate] -> Arate -> k0 -> Arate+tone i0init a1sig k2hp = opcode "tone" args+ where args = [to a1sig, to k2hp] ++ map to i0init+++-- | * opcode : tonex+-- +-- +-- * syntax : +-- +-- > ares tonex asig, khp [, inumlayer] [, iskip]+-- +-- +-- * description : +-- +-- tonex is equivalent to a filter consisting of more layers of+-- tone with the same arguments, serially connected. Using a stack+-- of a larger number of filters allows a sharper cutoff. They are+-- faster than using a larger number instances in a Csound orchestra+-- of the old opcodes, because only one initialization and k- cycle+-- are needed at time and the audio loop falls entirely inside the+-- cache memory of processor.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tonex.html>+ +tonex :: (K k0) => [Irate] -> Arate -> k0 -> Arate+tonex i0init a1sig k2hp = opcode "tonex" args+ where args = [to a1sig, to k2hp] ++ map to i0init+++-- | * opcode : biquad+-- +-- +-- * syntax : +-- +-- > ares biquad asig, kb0, kb1, kb2, ka0, ka1, ka2 [, iskip]+-- +-- +-- * description : +-- +-- A sweepable general purpose biquadratic digital filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/biquad.html>+ +biquad ::+ (K k0, K k1, K k2, K k3, K k4, K k5) =>+ [Irate] -> Arate -> k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> Arate+biquad i0init a1sig k2b0 k3b1 k4b2 k5a0 k6a1 k7a2+ = opcode "biquad" args+ where args+ = [to a1sig, to k2b0, to k3b1, to k4b2, to k5a0, to k6a1, to k7a2]+ ++ map to i0init+++-- | * opcode : biquada+-- +-- +-- * syntax : +-- +-- > ares biquada asig, ab0, ab1, ab2, aa0, aa1, aa2 [, iskip]+-- +-- +-- * description : +-- +-- A sweepable general purpose biquadratic digital filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/biquada.html>+ +biquada ::+ [Irate] ->+ Arate ->+ Arate -> Arate -> Arate -> Arate -> Arate -> Arate -> Arate+biquada i0init a1sig a2b0 a3b1 a4b2 a5a0 a6a1 a7a2+ = opcode "biquada" args+ where args+ = [to a1sig, to a2b0, to a3b1, to a4b2, to a5a0, to a6a1, to a7a2]+ ++ map to i0init+++-- | * opcode : butterbp+-- +-- +-- * syntax : +-- +-- > ares butterbp asig, kfreq, kband [, iskip]+-- +-- +-- * description : +-- +-- Implementation of a second-order band-pass Butterworth filter.+-- This opcode can also be written as butbp.+-- +-- +-- * url : <http://www.csounds.com/manual/html/butterbp.html>+ +butterbp :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+butterbp i0init a1sig k2freq k3band = opcode "butterbp" args+ where args = [to a1sig, to k2freq, to k3band] ++ map to i0init+++-- | * opcode : butterbr+-- +-- +-- * syntax : +-- +-- > ares butterbr asig, kfreq, kband [, iskip]+-- +-- +-- * description : +-- +-- Implementation of a second-order band-reject Butterworth filter.+-- This opcode can also be written as butbr.+-- +-- +-- * url : <http://www.csounds.com/manual/html/butterbr.html>+ +butterbr :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+butterbr i0init a1sig k2freq k3band = opcode "butterbr" args+ where args = [to a1sig, to k2freq, to k3band] ++ map to i0init+++-- | * opcode : butterhp+-- +-- +-- * syntax : +-- +-- > ares butterhp asig, kfreq [, iskip]+-- +-- +-- * description : +-- +-- Implementation of second-order high-pass Butterworth filter.+-- This opcode can also be written as buthp.+-- +-- +-- * url : <http://www.csounds.com/manual/html/butterhp.html>+ +butterhp :: (K k0) => [Irate] -> Arate -> k0 -> Arate+butterhp i0init a1sig k2freq = opcode "butterhp" args+ where args = [to a1sig, to k2freq] ++ map to i0init+++-- | * opcode : butterlp+-- +-- +-- * syntax : +-- +-- > ares butterlp asig, kfreq [, iskip]+-- +-- +-- * description : +-- +-- Implementation of a second-order low-pass Butterworth filter.+-- This opcode can also be written as butlp.+-- +-- +-- * url : <http://www.csounds.com/manual/html/butterlp.html>+ +butterlp :: (K k0) => [Irate] -> Arate -> k0 -> Arate+butterlp i0init a1sig k2freq = opcode "butterlp" args+ where args = [to a1sig, to k2freq] ++ map to i0init+++-- | * opcode : butbp+-- +-- +-- * syntax : +-- +-- > ares butbp asig, kfreq, kband [, iskip]+-- +-- +-- * description : +-- +-- Same as the butterbp opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/butbp.html>+ +butbp :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+butbp i0init a1sig k2freq k3band = opcode "butbp" args+ where args = [to a1sig, to k2freq, to k3band] ++ map to i0init+++-- | * opcode : butbr+-- +-- +-- * syntax : +-- +-- > ares butbr asig, kfreq, kband [, iskip]+-- +-- +-- * description : +-- +-- Same as the butterbr opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/butbr.html>+ +butbr :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+butbr i0init a1sig k2freq k3band = opcode "butbr" args+ where args = [to a1sig, to k2freq, to k3band] ++ map to i0init+++-- | * opcode : buthp+-- +-- +-- * syntax : +-- +-- > ares buthp asig, kfreq [, iskip]+-- +-- +-- * description : +-- +-- Same as the butterhp opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/buthp.html>+ +buthp :: (K k0) => [Irate] -> Arate -> k0 -> Arate+buthp i0init a1sig k2freq = opcode "buthp" args+ where args = [to a1sig, to k2freq] ++ map to i0init+++-- | * opcode : butlp+-- +-- +-- * syntax : +-- +-- > ares butlp asig, kfreq [, iskip]+-- +-- +-- * description : +-- +-- Same as the butterlp opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/butlp.html>+ +butlp :: (K k0) => [Irate] -> Arate -> k0 -> Arate+butlp i0init a1sig k2freq = opcode "butlp" args+ where args = [to a1sig, to k2freq] ++ map to i0init+++-- | * opcode : clfilt+-- +-- +-- * syntax : +-- +-- > ares clfilt asig, kfreq, itype, inpol [, ikind] [, ipbr] [, isba] [, iskip]+-- +-- +-- * description : +-- +-- Implements the classical standard analog filter types: low-pass+-- and high-pass. They are implemented with the four classical kinds+-- of filters: Butterworth, Chebyshev Type I, Chebyshev Type II, and+-- Elliptical. The number of poles may be any even number from 2 to+-- 80.+-- +-- +-- * url : <http://www.csounds.com/manual/html/clfilt.html>+ +clfilt ::+ (K k0) => [Irate] -> Arate -> k0 -> Irate -> Irate -> Arate+clfilt i0init a1sig k2freq i3type i4npol = opcode "clfilt" args+ where args+ = [to a1sig, to k2freq, to i3type, to i4npol] ++ map to i0init+++-- | * opcode : aresonk+-- +-- +-- * syntax : +-- +-- > kres aresonk ksig, kcf, kbw [, iscl] [, iskip]+-- +-- +-- * description : +-- +-- A notch filter whose transfer functions are the complements of+-- the reson opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/aresonk.html>+ +aresonk :: (K k0, K k1, K k2) => [Irate] -> k0 -> k1 -> k2 -> Krate+aresonk i0init k1sig k2cf k3bw = opcode "aresonk" args+ where args = [to k1sig, to k2cf, to k3bw] ++ map to i0init+++-- | * opcode : atonek+-- +-- +-- * syntax : +-- +-- > kres atonek ksig, khp [, iskip]+-- +-- +-- * description : +-- +-- A hi-pass filter whose transfer functions are the complements of+-- the tonek opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/atonek.html>+ +atonek :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Krate+atonek i0init k1sig k2hp = opcode "atonek" args+ where args = [to k1sig, to k2hp] ++ map to i0init+++-- | * opcode : lineto+-- +-- +-- * syntax : +-- +-- > kres lineto ksig, ktime+-- +-- +-- * description : +-- +-- Generate glissandos starting from a control signal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lineto.html>+ +lineto :: (K k0, K k1) => k0 -> k1 -> Krate+lineto k0sig k1time = opcode "lineto" args+ where args = [to k0sig, to k1time]+++-- | * opcode : port+-- +-- +-- * syntax : +-- +-- > kres port ksig, ihtim [, isig]+-- +-- +-- * description : +-- +-- Applies portamento to a step-valued control signal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/port.html>+ +port :: (K k0) => [Irate] -> k0 -> Irate -> Krate+port i0init k1sig i2htim = opcode "port" args+ where args = [to k1sig, to i2htim] ++ map to i0init+++-- | * opcode : portk+-- +-- +-- * syntax : +-- +-- > kres portk ksig, khtim [, isig]+-- +-- +-- * description : +-- +-- Applies portamento to a step-valued control signal.+-- +-- +-- * url : <http://www.csounds.com/manual/html/portk.html>+ +portk :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Krate+portk i0init k1sig k2htim = opcode "portk" args+ where args = [to k1sig, to k2htim] ++ map to i0init+++-- | * opcode : resonk+-- +-- +-- * syntax : +-- +-- > kres resonk ksig, kcf, kbw [, iscl] [, iskip]+-- +-- +-- * description : +-- +-- A second-order resonant filter.+-- +-- +-- * url : <http://www.csounds.com/manual/html/resonk.html>+ +resonk :: (K k0, K k1, K k2) => [Irate] -> k0 -> k1 -> k2 -> Krate+resonk i0init k1sig k2cf k3bw = opcode "resonk" args+ where args = [to k1sig, to k2cf, to k3bw] ++ map to i0init+++-- | * opcode : resonxk+-- +-- +-- * syntax : +-- +-- > kres resonxk ksig, kcf, kbw[, inumlayer, iscl, istor]+-- +-- +-- * description : +-- +-- resonxk is equivalent to a group of resonk filters, with the+-- same arguments, serially connected. Using a stack of a larger+-- number of filters allows a sharper cutoff.+-- +-- +-- * url : <http://www.csounds.com/manual/html/resonxk.html>+ +resonxk :: (K k0, K k1, K k2) => [Irate] -> k0 -> k1 -> k2 -> Krate+resonxk i0init k1sig k2cf k3bw = opcode "resonxk" args+ where args = [to k1sig, to k2cf, to k3bw] ++ map to i0init+++-- | * opcode : tlineto+-- +-- +-- * syntax : +-- +-- > kres tlineto ksig, ktime, ktrig+-- +-- +-- * description : +-- +-- Generate glissandos starting from a control signal with a+-- trigger.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tlineto.html>+ +tlineto :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Krate+tlineto k0sig k1time k2trig = opcode "tlineto" args+ where args = [to k0sig, to k1time, to k2trig]+++-- | * opcode : tonek+-- +-- +-- * syntax : +-- +-- > kres tonek ksig, khp [, iskip]+-- +-- +-- * description : +-- +-- A first-order recursive low-pass filter with variable frequency+-- response.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tonek.html>+ +tonek :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Krate+tonek i0init k1sig k2hp = opcode "tonek" args+ where args = [to k1sig, to k2hp] ++ map to i0init
+ src/CsoundExpr/Opcodes/Sigmod/Wavguide.hs view
@@ -0,0 +1,33 @@+-- | Waveguides+module CsoundExpr.Opcodes.Sigmod.Wavguide+ (streson)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : streson+-- +-- +-- * syntax : +-- +-- > ares streson asig, kfr, ifdbgain+-- +-- +-- * description : +-- +-- An audio signal is modified by a string resonator with variable+-- fundamental frequency.+-- +-- +-- * url : <http://www.csounds.com/manual/html/streson.html>+ +streson :: (K k0) => Arate -> k0 -> Irate -> Arate+streson a0sig k1fr i2fdbgain = opcode "streson" args+ where args = [to a0sig, to k1fr, to i2fdbgain]
+ src/CsoundExpr/Opcodes/Sigmod/Wavshape.hs view
@@ -0,0 +1,166 @@+-- | Waveshaping and Phase Distortion+module CsoundExpr.Opcodes.Sigmod.Wavshape+ (chebyshevpoly,+ polynomial,+ powershape,+ pdclip,+ pdhalf,+ pdhalfy)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : chebyshevpoly+-- +-- +-- * syntax : +-- +-- > aout chebyshevpoly ain, k0 [, k1 [, k2 [...]]]+-- +-- +-- * description : +-- +-- The chebyshevpoly opcode calculates the value of a polynomial+-- expression with a single a-rate input variable that is made up of+-- a linear combination of the first N Chebyshev polynomials of the+-- first kind. Each Chebyshev polynomial, Tn(x), is weighted by a+-- k-rate coefficient, kn, so that the opcode is calculating a sum+-- of any number of terms in the form kn*Tn(x). Thus, the+-- chebyshevpoly opcode allows for the waveshaping of an audio+-- signal with a dynamic transfer function that gives precise+-- control over the harmonic content of the output.+-- +-- +-- * url : <http://www.csounds.com/manual/html/chebyshevpoly.html>+ +chebyshevpoly :: (K k0) => Arate -> [k0] -> Arate+chebyshevpoly a0in k1vals = opcode "chebyshevpoly" args+ where args = [to a0in] ++ map to k1vals+++-- | * opcode : polynomial+-- +-- +-- * syntax : +-- +-- > aout polynomial ain, k0 [, k1 [, k2 [...]]]+-- +-- +-- * description : +-- +-- The polynomial opcode calculates a polynomial with a single+-- a-rate input variable. The polynomial is a sum of any number of+-- terms in the form kn*x^n where kn is the nth coefficient of the+-- expression. These coefficients are k-rate values.+-- +-- +-- * url : <http://www.csounds.com/manual/html/polynomial.html>+ +polynomial :: (K k0) => Arate -> [k0] -> Arate+polynomial a0in k1vals = opcode "polynomial" args+ where args = [to a0in] ++ map to k1vals+++-- | * opcode : powershape+-- +-- +-- * syntax : +-- +-- > aout powershape ain, kShapeAmount [, ifullscale]+-- +-- +-- * description : +-- +-- The powershape opcode raises an input signal to a power with+-- pre- and post-scaling of the signal so that the output will be in+-- a predictable range. It also processes negative inputs in a+-- symmetrical way to positive inputs, calculating a dynamic+-- transfer function that is useful for waveshaping.+-- +-- +-- * url : <http://www.csounds.com/manual/html/powershape.html>+ +powershape :: (K k0) => [Irate] -> Arate -> k0 -> Arate+powershape i0init a1in k2ShapeAmount = opcode "powershape" args+ where args = [to a1in, to k2ShapeAmount] ++ map to i0init+++-- | * opcode : pdclip+-- +-- +-- * syntax : +-- +-- > aout pdclip ain, kWidth, kCenter [, ibipolar [, ifullscale]]+-- +-- +-- * description : +-- +-- The pdclip opcode allows a percentage of the input range of a+-- signal to be clipped to fullscale. It is similar to simply+-- multiplying the signal and limiting the range of the result, but+-- pdclip allows you to think about how much of the signal range is+-- being distorted instead of the scalar factor and has a offset+-- parameter for assymetric clipping of the signal range. pdclip is+-- also useful for remapping phasors for phase distortion synthesis.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pdclip.html>+ +pdclip :: (K k0, K k1) => [Irate] -> Arate -> k0 -> k1 -> Arate+pdclip i0init a1in k2Width k3Center = opcode "pdclip" args+ where args = [to a1in, to k2Width, to k3Center] ++ map to i0init+++-- | * opcode : pdhalf+-- +-- +-- * syntax : +-- +-- > aout pdhalf ain, kShapeAmount [, ibipolar [, ifullscale]]+-- +-- +-- * description : +-- +-- The pdhalf opcode is designed to emulate the "classic" phase+-- distortion synthesis method of the Casio CZ-series of+-- synthesizers from the mid-1980's. This technique reads the first+-- and second halves of a function table at different rates in order+-- to warp the waveform. For example, pdhalf can smoothly transform+-- a sine wave into something approximating the shape of a saw wave.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pdhalf.html>+ +pdhalf :: (K k0) => [Irate] -> Arate -> k0 -> Arate+pdhalf i0init a1in k2ShapeAmount = opcode "pdhalf" args+ where args = [to a1in, to k2ShapeAmount] ++ map to i0init+++-- | * opcode : pdhalfy+-- +-- +-- * syntax : +-- +-- > aout pdhalfy ain, kShapeAmount [, ibipolar [, ifullscale]]+-- +-- +-- * description : +-- +-- The pdhalfy opcode is a variation on the phase distortion+-- synthesis method of the pdhalf opcode. It is useful for+-- distorting a phasor in order to read two unequal portions of a+-- table in the same number of samples.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pdhalfy.html>+ +pdhalfy :: (K k0) => [Irate] -> Arate -> k0 -> Arate+pdhalfy i0init a1in k2ShapeAmount = opcode "pdhalfy" args+ where args = [to a1in, to k2ShapeAmount] ++ map to i0init
+ src/CsoundExpr/Opcodes/SignalFlowGraphOpcodes.hs view
@@ -0,0 +1,8 @@+-- | Signal Flow Graph Opcodes+module CsoundExpr.Opcodes.SignalFlowGraphOpcodes+ (module CsoundExpr.Opcodes.SignalFlowGraphOpcodes.SignalFlowGraphOpcodes)+where++++import CsoundExpr.Opcodes.SignalFlowGraphOpcodes.SignalFlowGraphOpcodes
+ src/CsoundExpr/Opcodes/SignalFlowGraphOpcodes/SignalFlowGraphOpcodes.hs view
@@ -0,0 +1,119 @@+-- | Signal Flow Graph Opcodes+module CsoundExpr.Opcodes.SignalFlowGraphOpcodes.SignalFlowGraphOpcodes+ (outleta,+ outletk,+ inleta,+ inletk,+ ftgenonce)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : outleta+-- +-- +-- * syntax : +-- +-- > outleta Sname, asignal+-- +-- +-- * description : +-- +-- Sends an arate signal out from an instrument to a named port.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outleta.html>+ +outleta :: String -> Arate -> SignalOut+outleta s0name a1signal = outOpcode "outleta" args+ where args = [to s0name, to a1signal]+++-- | * opcode : outletk+-- +-- +-- * syntax : +-- +-- > outletk Sname, ksignal+-- +-- +-- * description : +-- +-- Sends a krate signal out from an instrument to a named port.+-- +-- +-- * url : <http://www.csounds.com/manual/html/outletk.html>+ +outletk :: (K k0) => String -> k0 -> SignalOut+outletk s0name k1signal = outOpcode "outletk" args+ where args = [to s0name, to k1signal]+++-- | * opcode : inleta+-- +-- +-- * syntax : +-- +-- > asignal inleta Sname+-- +-- +-- * description : +-- +-- Receives an arate signal into an instrument through a named+-- port.+-- +-- +-- * url : <http://www.csounds.com/manual/html/inleta.html>+ +inleta :: String -> Arate+inleta s0name = opcode "inleta" args+ where args = [to s0name]+++-- | * opcode : inletk+-- +-- +-- * syntax : +-- +-- > ksignal inletk Sname+-- +-- +-- * description : +-- +-- Receives a krate signal into an instrument from a named port.+-- +-- +-- * url : <http://www.csounds.com/manual/html/inletk.html>+ +inletk :: String -> Krate+inletk s0name = opcode "inletk" args+ where args = [to s0name]+++-- | * opcode : ftgenonce+-- +-- +-- * syntax : +-- +-- > ifno ftgenonce ip1dummy, ip2dummy, isize, igen, iarga, iargb,...+-- +-- +-- * description : +-- +-- Generate a function table from within an instrument definition,+-- without duplication of data.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ftgenonce.html>+ +ftgenonce :: Irate -> Irate -> Irate -> Irate -> [Irate] -> Irate+ftgenonce i0p1 i1p2 i2size i3gen i4vals = opcode "ftgenonce" args+ where args+ = [to i0p1, to i1p2, to i2size, to i3gen] ++ map to i4vals
+ src/CsoundExpr/Opcodes/Spectral.hs view
@@ -0,0 +1,18 @@+-- | Spectral Processing+module CsoundExpr.Opcodes.Spectral+ (module CsoundExpr.Opcodes.Spectral.SiggenStft,+ module CsoundExpr.Opcodes.Spectral.Lpcresyn,+ module CsoundExpr.Opcodes.Spectral.Nonstand,+ module CsoundExpr.Opcodes.Spectral.RealTime,+ module CsoundExpr.Opcodes.Spectral.ATS,+ module CsoundExpr.Opcodes.Spectral.Loris)+where++++import CsoundExpr.Opcodes.Spectral.SiggenStft+import CsoundExpr.Opcodes.Spectral.Lpcresyn+import CsoundExpr.Opcodes.Spectral.Nonstand+import CsoundExpr.Opcodes.Spectral.RealTime+import CsoundExpr.Opcodes.Spectral.ATS+import CsoundExpr.Opcodes.Spectral.Loris
+ src/CsoundExpr/Opcodes/Spectral/ATS.hs view
@@ -0,0 +1,261 @@+-- | ATS Spectral Processing+module CsoundExpr.Opcodes.Spectral.ATS+ (atsInfo,+ atsRead,+ atsReadnz,+ atsBufread,+ atsInterpread,+ atsPartialtap,+ atsAdd,+ atsAddnz,+ atsCross,+ atsSinnoi)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : ATSinfo+-- +-- +-- * syntax : +-- +-- > idata ATSinfo iatsfile, ilocation+-- +-- +-- * description : +-- +-- atsinfo reads data out of the header of an ATS file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ATSinfo.html>+ +atsInfo :: Irate -> Irate -> Irate+atsInfo i0atsfile i1location = opcode "ATSinfo" args+ where args = [to i0atsfile, to i1location]+++-- | * opcode : ATSread+-- +-- +-- * syntax : +-- +-- > kfreq, kamp ATSread ktimepnt, iatsfile, ipartial+-- +-- +-- * description : +-- +-- ATSread returns the amplitude (kamp) and frequency (kfreq)+-- information of a user specified partial contained in the ATS+-- analysis file at the time indicated by the time pointer ktimepnt.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ATSread.html>+ +atsRead :: (K k0) => k0 -> Irate -> Irate -> MultiOut+atsRead k0timepnt i1atsfile i2partial = opcode "ATSread" args+ where args = [to k0timepnt, to i1atsfile, to i2partial]+++-- | * opcode : ATSreadnz+-- +-- +-- * syntax : +-- +-- > kenergy ATSreadnz ktimepnt, iatsfile, iband+-- +-- +-- * description : +-- +-- ATSreadnz returns the energy (kenergy) of a user specified noise+-- band (1-25 bands) at the time indicated by the time pointer+-- ktimepnt.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ATSreadnz.html>+ +atsReadnz :: (K k0) => k0 -> Irate -> Irate -> Krate+atsReadnz k0timepnt i1atsfile i2band = opcode "ATSreadnz" args+ where args = [to k0timepnt, to i1atsfile, to i2band]+++-- | * opcode : ATSbufread+-- +-- +-- * syntax : +-- +-- > ATSbufread ktimepnt, kfmod, iatsfile, ipartials[, ipartialoffset, +-- > ipartialincr]+-- +-- +-- * description : +-- +-- ATSbufread reads data from and ATS data file and stores it in an+-- internal data table of frequency, amplitude pairs.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ATSbufread.html>+ +atsBufread ::+ (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Irate -> SignalOut+atsBufread i0init k1timepnt k2fmod i3atsfile i4partials+ = outOpcode "ATSbufread" args+ where args+ = [to k1timepnt, to k2fmod, to i3atsfile, to i4partials] +++ map to i0init+++-- | * opcode : ATSinterpread+-- +-- +-- * syntax : +-- +-- > kamp ATSinterpread kfreq+-- +-- +-- * description : +-- +-- ATSinterpread allows a user to determine the frequency envelope+-- of any ATSbufread.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ATSinterpread.html>+ +atsInterpread :: (K k0) => k0 -> Krate+atsInterpread k0freq = opcode "ATSinterpread" args+ where args = [to k0freq]+++-- | * opcode : ATSpartialtap+-- +-- +-- * syntax : +-- +-- > kfrq, kamp ATSpartialtap ipartialnum+-- +-- +-- * description : +-- +-- ATSpartialtap takes a partial number and returns a frequency,+-- amplitude pair. The frequency and amplitude data comes from an+-- ATSbufread opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ATSpartialtap.html>+ +atsPartialtap :: Irate -> MultiOut+atsPartialtap i0partialnum = opcode "ATSpartialtap" args+ where args = [to i0partialnum]+++-- | * opcode : ATSadd+-- +-- +-- * syntax : +-- +-- > ar ATSadd ktimepnt, kfmod, iatsfile, ifn, ipartials[, ipartialoffset, +-- > ipartialincr, igatefn]+-- +-- +-- * description : +-- +-- ATSadd reads from an ATS analysis file and uses the data to+-- perform additive synthesis using an internal array of+-- interpolating oscillators.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ATSadd.html>+ +atsAdd ::+ (K k0, K k1) =>+ [Irate] -> k0 -> k1 -> Irate -> Irate -> Irate -> Arate+atsAdd i0init k1timepnt k2fmod i3atsfile i4fn i5partials+ = opcode "ATSadd" args+ where args+ = [to k1timepnt, to k2fmod, to i3atsfile, to i4fn, to i5partials]+ ++ map to i0init+++-- | * opcode : ATSaddnz+-- +-- +-- * syntax : +-- +-- > ar ATSaddnz ktimepnt, iatsfile, ibands[, ibandoffset, ibandincr]+-- +-- +-- * description : +-- +-- ATSaddnz reads from an ATS analysis file and uses the data to+-- perform additive synthesis using a modified randi function.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ATSaddnz.html>+ +atsAddnz :: (K k0) => [Irate] -> k0 -> Irate -> Irate -> Arate+atsAddnz i0init k1timepnt i2atsfile i3bands+ = opcode "ATSaddnz" args+ where args+ = [to k1timepnt, to i2atsfile, to i3bands] ++ map to i0init+++-- | * opcode : ATScross+-- +-- +-- * syntax : +-- +-- > ar ATScross ktimepnt, kfmod, iatsfile, ifn, kmylev, kbuflev, ipartials +-- > [, ipartialoffset, ipartialincr]+-- +-- +-- * description : +-- +-- ATScross uses data from an ATS analysis file and data from an+-- ATSbufread to perform cross synthesis.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ATScross.html>+ +atsCross ::+ (K k0, K k1, K k2, K k3) =>+ [Irate] -> k0 -> k1 -> Irate -> Irate -> k2 -> k3 -> Irate -> Arate+atsCross i0init k1timepnt k2fmod i3atsfile i4fn k5mylev k6buflev+ i7partials = opcode "ATScross" args+ where args+ = [to k1timepnt, to k2fmod, to i3atsfile, to i4fn, to k5mylev,+ to k6buflev, to i7partials]+ ++ map to i0init+++-- | * opcode : ATSsinnoi+-- +-- +-- * syntax : +-- +-- > ar ATSsinnoi ktimepnt, ksinlev, knzlev, kfmod, iatsfile, ipartials +-- > [, ipartialoffset, ipartialincr]+-- +-- +-- * description : +-- +-- ATSsinnoi reads data from an ATS data file and uses the+-- information to synthesize sines and noise together.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ATSsinnoi.html>+ +atsSinnoi ::+ (K k0, K k1, K k2, K k3) =>+ [Irate] -> k0 -> k1 -> k2 -> k3 -> Irate -> Irate -> Arate+atsSinnoi i0init k1timepnt k2sinlev k3nzlev k4fmod i5atsfile+ i6partials = opcode "ATSsinnoi" args+ where args+ = [to k1timepnt, to k2sinlev, to k3nzlev, to k4fmod, to i5atsfile,+ to i6partials]+ ++ map to i0init
+ src/CsoundExpr/Opcodes/Spectral/Loris.hs view
@@ -0,0 +1,97 @@+-- | Loris Opcodes+module CsoundExpr.Opcodes.Spectral.Loris+ (lorisread,+ lorismorph,+ lorisplay)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : lorisread+-- +-- +-- * syntax : +-- +-- > lorisread ktimpnt, ifilcod, istoreidx, kfreqenv, kampenv, kbwenv[, ifadetime]+-- +-- +-- * description : +-- +-- lorisread imports a set of bandwidth-enhanced partials from a+-- SDIF-format data file, applying control-rate frequency,+-- amplitude, and bandwidth scaling envelopes, and stores the+-- modified partials in memory.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lorisread.html>+ +lorisread ::+ (K k0, K k1, K k2, K k3) =>+ [Irate] -> k0 -> String -> Irate -> k1 -> k2 -> k3 -> SignalOut+lorisread i0init k1timpnt s2file i3storeidx k4freqenv k5ampenv+ k6bwenv = outOpcode "lorisread" args+ where args+ = [to k1timpnt, to s2file, to i3storeidx, to k4freqenv,+ to k5ampenv, to k6bwenv]+ ++ map to i0init+++-- | * opcode : lorismorph+-- +-- +-- * syntax : +-- +-- > lorismorph isrcidx, itgtidx, istoreidx, kfreqmorphenv, kampmorphenv, kbwmorphenv+-- +-- +-- * description : +-- +-- lorismorph morphs two stored sets of bandwidth-enhanced partials+-- and stores a new set of partials representing the morphed sound.+-- The morph is performed by linearly interpolating the parameter+-- envelopes (frequency, amplitude, and bandwidth, or noisiness) of+-- the bandwidth-enhanced partials according to control-rate+-- frequency, amplitude, and bandwidth morphing functions.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lorismorph.html>+ +lorismorph ::+ (K k0, K k1, K k2) =>+ Irate -> Irate -> Irate -> k0 -> k1 -> k2 -> SignalOut+lorismorph i0srcidx i1tgtidx i2storeidx k3freqmorphenv+ k4ampmorphenv k5bwmorphenv = outOpcode "lorismorph" args+ where args+ = [to i0srcidx, to i1tgtidx, to i2storeidx, to k3freqmorphenv,+ to k4ampmorphenv, to k5bwmorphenv]+++-- | * opcode : lorisplay+-- +-- +-- * syntax : +-- +-- > ar lorisplay ireadidx, kfreqenv, kampenv, kbwenv+-- +-- +-- * description : +-- +-- lorisplay renders a stored set of bandwidth-enhanced partials+-- using the method of Bandwidth-Enhanced Additive Synthesis+-- implemented in the Loris software, applying control-rate+-- frequency, amplitude, and bandwidth scaling envelopes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lorisplay.html>+ +lorisplay :: (K k0, K k1, K k2) => Irate -> k0 -> k1 -> k2 -> Arate+lorisplay i0readidx k1freqenv k2ampenv k3bwenv+ = opcode "lorisplay" args+ where args = [to i0readidx, to k1freqenv, to k2ampenv, to k3bwenv]
+ src/CsoundExpr/Opcodes/Spectral/Lpcresyn.hs view
@@ -0,0 +1,119 @@+-- | Linear Predictive Coding (LPC) Resynthesis+module CsoundExpr.Opcodes.Spectral.Lpcresyn+ (lpfreson,+ lpinterp,+ lpread,+ lpreson,+ lpslot)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : lpfreson+-- +-- +-- * syntax : +-- +-- > ares lpfreson asig, kfrqratio+-- +-- +-- * description : +-- +-- Resynthesises a signal from the data passed internally by a+-- previous lpread, applying formant shifting.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lpfreson.html>+ +lpfreson :: (K k0) => Arate -> k0 -> Arate+lpfreson a0sig k1frqratio = opcode "lpfreson" args+ where args = [to a0sig, to k1frqratio]+++-- | * opcode : lpinterp+-- +-- +-- * syntax : +-- +-- > lpinterp islot1, islot2, kmix+-- +-- +-- * description : +-- +-- Computes a new set of poles from the interpolation between two+-- analysis.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lpinterp.html>+ +lpinterp :: (K k0) => Irate -> Irate -> k0 -> SignalOut+lpinterp i0slot1 i1slot2 k2mix = outOpcode "lpinterp" args+ where args = [to i0slot1, to i1slot2, to k2mix]+++-- | * opcode : lpread+-- +-- +-- * syntax : +-- +-- > krmsr, krmso, kerr, kcps lpread ktimpnt, ifilcod [, inpoles] [, ifrmrate]+-- +-- +-- * description : +-- +-- Reads a control file of time-ordered information frames.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lpread.html>+ +lpread :: (K k0) => [Irate] -> k0 -> String -> MultiOut+lpread i0init k1timpnt s2file = opcode "lpread" args+ where args = [to k1timpnt, to s2file] ++ map to i0init+++-- | * opcode : lpreson+-- +-- +-- * syntax : +-- +-- > ares lpreson asig+-- +-- +-- * description : +-- +-- Resynthesises a signal from the data passed internally by a+-- previous lpread.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lpreson.html>+ +lpreson :: Arate -> Arate+lpreson a0sig = opcode "lpreson" args+ where args = [to a0sig]+++-- | * opcode : lpslot+-- +-- +-- * syntax : +-- +-- > lpslot islot+-- +-- +-- * description : +-- +-- Selects the slot to be use by further lp opcodes.+-- +-- +-- * url : <http://www.csounds.com/manual/html/lpslot.html>+ +lpslot :: Irate -> SignalOut+lpslot i0slot = outOpcode "lpslot" args+ where args = [to i0slot]
+ src/CsoundExpr/Opcodes/Spectral/Nonstand.hs view
@@ -0,0 +1,13 @@+-- | Non-standard Spectral Processing+module CsoundExpr.Opcodes.Spectral.Nonstand+ ()+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++
+ src/CsoundExpr/Opcodes/Spectral/RealTime.hs view
@@ -0,0 +1,13 @@+-- | Tools for Real-time Spectral Processing (pvs opcodes)+module CsoundExpr.Opcodes.Spectral.RealTime+ ()+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++
+ src/CsoundExpr/Opcodes/Spectral/SiggenStft.hs view
@@ -0,0 +1,268 @@+-- | Short-time Fourier Transform (STFT) Resynthesis+module CsoundExpr.Opcodes.Spectral.SiggenStft+ (tableseg,+ pvadd,+ pvbufread,+ pvcross,+ pvinterp,+ pvoc,+ pvread,+ tablexseg,+ vpvoc)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : tableseg+-- +-- +-- * syntax : +-- +-- > tableseg ifn1, idur1, ifn2 [, idur2] [, ifn3] [...]+-- +-- +-- * description : +-- +-- tableseg is like linseg but interpolate between values in a+-- stored function tables. The result is a new function table passed+-- internally to any following vpvoc which occurs before a+-- subsequent tableseg (much like lpread/lpreson pairs work). The+-- uses of these are described below under vpvoc.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tableseg.html>+ +tableseg :: [Irate] -> SignalOut+tableseg i0ifns = outOpcode "tableseg" args+ where args = map to i0ifns+++-- | * opcode : pvadd+-- +-- +-- * syntax : +-- +-- > ares pvadd ktimpnt, kfmod, ifilcod, ifn, ibins [, ibinoffset] +-- > [, ibinincr] [, iextractmode] [, ifreqlim] [, igatefn]+-- +-- +-- * description : +-- +-- pvadd reads from a pvoc file and uses the data to perform+-- additive synthesis using an internal array of interpolating+-- oscillators. The user supplies the wave table (usually one period+-- of a sine wave), and can choose which analysis bins will be used+-- in the re-synthesis.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pvadd.html>+ +pvadd ::+ (K k0, K k1) =>+ [Irate] -> k0 -> k1 -> String -> Irate -> Irate -> Arate+pvadd i0init k1timpnt k2fmod s3file i4fn i5bins+ = opcode "pvadd" args+ where args+ = [to k1timpnt, to k2fmod, to s3file, to i4fn, to i5bins] +++ map to i0init+++-- | * opcode : pvbufread+-- +-- +-- * syntax : +-- +-- > pvbufread ktimpnt, ifile+-- +-- +-- * description : +-- +-- pvbufread reads from a pvoc file and makes the retrieved data+-- available to any following pvinterp and pvcross units that appear+-- in an instrument before a subsequent pvbufread (just as lpread+-- and lpreson work together). The data is passed internally and the+-- unit has no output of its own.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pvbufread.html>+ +pvbufread :: (K k0) => k0 -> Irate -> SignalOut+pvbufread k0timpnt i1file = outOpcode "pvbufread" args+ where args = [to k0timpnt, to i1file]+++-- | * opcode : pvcross+-- +-- +-- * syntax : +-- +-- > ares pvcross ktimpnt, kfmod, ifile, kampscale1, kampscale2 [, ispecwp]+-- +-- +-- * description : +-- +-- pvcross applies the amplitudes from one phase vocoder analysis+-- file to the data from a second file and then performs the+-- resynthesis. The data is passed, as described above, from a+-- previously called pvbufread unit. The two k-rate amplitude+-- arguments are used to scale the amplitudes of each files+-- separately before they are added together and used in the+-- resynthesis (see below for further explanation). The frequencies+-- of the first file are not used at all in this process. This unit+-- simply allows for cross-synthesis through the application of the+-- amplitudes of the spectra of one signal to the frequencies of a+-- second signal. Unlike pvinterp, pvcross does allow for the use of+-- the ispecwp as in pvoc and vpvoc.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pvcross.html>+ +pvcross ::+ (K k0, K k1, K k2, K k3) =>+ [Irate] -> k0 -> k1 -> Irate -> k2 -> k3 -> Arate+pvcross i0init k1timpnt k2fmod i3file k4ampscale1 k5ampscale2+ = opcode "pvcross" args+ where args+ = [to k1timpnt, to k2fmod, to i3file, to k4ampscale1,+ to k5ampscale2]+ ++ map to i0init+++-- | * opcode : pvinterp+-- +-- +-- * syntax : +-- +-- > ares pvinterp ktimpnt, kfmod, ifile, kfreqscale1, kfreqscale2, +-- > kampscale1, kampscale2, kfreqinterp, kampinterp+-- +-- +-- * description : +-- +-- pvinterp interpolates between the amplitudes and frequencies, on+-- a bin by bin basis, of two phase vocoder analysis files (one from+-- a previously called pvbufread unit and the other from within its+-- own argument list), allowing for user defined transitions between+-- analyzed sounds. It also allows for general scaling of the+-- amplitudes and frequencies of each file separately before the+-- interpolated values are calculated and sent to the resynthesis+-- routines. The kfmod argument in pvinterp performs its frequency+-- scaling on the frequency values after their derivation from the+-- separate scaling and subsequent interpolation is performed so+-- that this acts as an overall scaling value of the new frequency+-- components.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pvinterp.html>+ +pvinterp ::+ (K k0, K k1, K k2, K k3, K k4, K k5, K k6, K k7) =>+ k0 -> k1 -> Irate -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> Arate+pvinterp k0timpnt k1fmod i2file k3freqscale1 k4freqscale2+ k5ampscale1 k6ampscale2 k7freqinterp k8ampinterp+ = opcode "pvinterp" args+ where args+ = [to k0timpnt, to k1fmod, to i2file, to k3freqscale1,+ to k4freqscale2, to k5ampscale1, to k6ampscale2, to k7freqinterp,+ to k8ampinterp]+++-- | * opcode : pvoc+-- +-- +-- * syntax : +-- +-- > ares pvoc ktimpnt, kfmod, ifilcod [, ispecwp] [, iextractmode] +-- > [, ifreqlim] [, igatefn]+-- +-- +-- * description : +-- +-- Implements signal reconstruction using an fft-based phase+-- vocoder.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pvoc.html>+ +pvoc :: (K k0, K k1) => [Irate] -> k0 -> k1 -> String -> Arate+pvoc i0init k1timpnt k2fmod s3file = opcode "pvoc" args+ where args = [to k1timpnt, to k2fmod, to s3file] ++ map to i0init+++-- | * opcode : pvread+-- +-- +-- * syntax : +-- +-- > kfreq, kamp pvread ktimpnt, ifile, ibin+-- +-- +-- * description : +-- +-- pvread reads from a pvoc file and returns the frequency and+-- amplitude from a single analysis channel or bin. The returned+-- values can be used anywhere else in the Csound instrument. For+-- example, one can use them as arguments to an oscillator to+-- synthesize a single component from an analyzed signal or a bank+-- of pvreads can be used to resynthesize the analyzed sound using+-- additive synthesis by passing the frequency and magnitude values+-- to a bank of oscillators.+-- +-- +-- * url : <http://www.csounds.com/manual/html/pvread.html>+ +pvread :: (K k0) => k0 -> Irate -> Irate -> MultiOut+pvread k0timpnt i1file i2bin = opcode "pvread" args+ where args = [to k0timpnt, to i1file, to i2bin]+++-- | * opcode : tablexseg+-- +-- +-- * syntax : +-- +-- > tablexseg ifn1, idur1, ifn2 [, idur2] [, ifn3] [...]+-- +-- +-- * description : +-- +-- tablexseg is like expseg but interpolate between values in a+-- stored function tables. The result is a new function table passed+-- internally to any following vpvoc which occurs before a+-- subsequent tablexseg (much like lpread/lpreson pairs work). The+-- uses of these are described below under vpvoc.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablexseg.html>+ +tablexseg :: [Irate] -> SignalOut+tablexseg i0ifns = outOpcode "tablexseg" args+ where args = map to i0ifns+++-- | * opcode : vpvoc+-- +-- +-- * syntax : +-- +-- > ares vpvoc ktimpnt, kfmod, ifile [, ispecwp] [, ifn]+-- +-- +-- * description : +-- +-- Implements signal reconstruction using an fft-based phase+-- vocoder and an extra envelope.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vpvoc.html>+ +vpvoc :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> Arate+vpvoc i0init k1timpnt k2fmod i3file = opcode "vpvoc" args+ where args = [to k1timpnt, to k2fmod, to i3file] ++ map to i0init
+ src/CsoundExpr/Opcodes/Table.hs view
@@ -0,0 +1,12 @@+-- | Function Table Control+module CsoundExpr.Opcodes.Table+ (module CsoundExpr.Opcodes.Table.Queries,+ module CsoundExpr.Opcodes.Table.Readwrit,+ module CsoundExpr.Opcodes.Table.Select)+where++++import CsoundExpr.Opcodes.Table.Queries+import CsoundExpr.Opcodes.Table.Readwrit+import CsoundExpr.Opcodes.Table.Select
+ src/CsoundExpr/Opcodes/Table/Queries.hs view
@@ -0,0 +1,162 @@+-- | Table Queries+module CsoundExpr.Opcodes.Table.Queries+ (ftchnls,+ ftlen,+ ftlptim,+ ftsr,+ nsamp,+ tablengI,+ tablengK)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : ftchnls+-- +-- +-- * syntax : +-- +-- > ftchnls(x) (init-rate args only)+-- +-- +-- * description : +-- +-- Returns the number of channels in a stored function table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ftchnls.html>+ +ftchnls :: Irate -> Irate+ftchnls i0sig = prefixOperation "ftchnls" args+ where args = [to i0sig]+++-- | * opcode : ftlen+-- +-- +-- * syntax : +-- +-- > ftlen(x) (init-rate args only)+-- +-- +-- * description : +-- +-- Returns the size of a stored function table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ftlen.html>+ +ftlen :: Irate -> Irate+ftlen i0sig = prefixOperation "ftlen" args+ where args = [to i0sig]+++-- | * opcode : ftlptim+-- +-- +-- * syntax : +-- +-- > ftlptim(x) (init-rate args only)+-- +-- +-- * description : +-- +-- Returns the loop segment start-time of a stored function table+-- number.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ftlptim.html>+ +ftlptim :: Irate -> Irate+ftlptim i0sig = prefixOperation "ftlptim" args+ where args = [to i0sig]+++-- | * opcode : ftsr+-- +-- +-- * syntax : +-- +-- > ftsr(x) (init-rate args only)+-- +-- +-- * description : +-- +-- Returns the sampling-rate of a stored function table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ftsr.html>+ +ftsr :: Irate -> Irate+ftsr i0sig = prefixOperation "ftsr" args+ where args = [to i0sig]+++-- | * opcode : nsamp+-- +-- +-- * syntax : +-- +-- > nsamp(x) (init-rate args only)+-- +-- +-- * description : +-- +-- Returns the number of samples loaded into a stored function+-- table number.+-- +-- +-- * url : <http://www.csounds.com/manual/html/nsamp.html>+ +nsamp :: Irate -> Irate+nsamp i0sig = prefixOperation "nsamp" args+ where args = [to i0sig]+++-- | * opcode : tableng+-- +-- +-- * syntax : +-- +-- > ires tableng ifn+-- > kres tableng kfn+-- +-- +-- * description : +-- +-- Interrogates a function table for length.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tableng.html>+ +tablengI :: Irate -> Irate+tablengI i0fn = opcode "tableng" args+ where args = [to i0fn]+++-- | * opcode : tableng+-- +-- +-- * syntax : +-- +-- > ires tableng ifn+-- > kres tableng kfn+-- +-- +-- * description : +-- +-- Interrogates a function table for length.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tableng.html>+ +tablengK :: (K k0) => k0 -> Krate+tablengK k0fn = opcode "tableng" args+ where args = [to k0fn]
+ src/CsoundExpr/Opcodes/Table/Readwrit.hs view
@@ -0,0 +1,600 @@+-- | Read/Write Operations+module CsoundExpr.Opcodes.Table.Readwrit+ (ftloadk,+ ftload,+ ftsavek,+ ftsave,+ tablecopy,+ tablegpw,+ tableicopy,+ tableigpw,+ tableimix,+ tableiw,+ tablemix,+ tablera,+ tablewA,+ tablewI,+ tablewK,+ tablewa,+ tablewktA,+ tablewktK,+ tabmorph,+ tabmorpha,+ tabmorphak,+ tabmorphi,+ tabrec,+ tabplay)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : ftloadk+-- +-- +-- * syntax : +-- +-- > ftloadk "filename", ktrig, iflag, ifn1 [, ifn2] [...]+-- +-- +-- * description : +-- +-- Load a set of previously-allocated tables from a file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ftloadk.html>+ +ftloadk :: (K k0) => String -> k0 -> Irate -> [Irate] -> SignalOut+ftloadk s0filename k1trig i2flag i3fns = outOpcode "ftloadk" args+ where args = [to s0filename, to k1trig, to i2flag] ++ map to i3fns+++-- | * opcode : ftload+-- +-- +-- * syntax : +-- +-- > ftload "filename", iflag, ifn1 [, ifn2] [...]+-- +-- +-- * description : +-- +-- Load a set of previously-allocated tables from a file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ftload.html>+ +ftload :: String -> Irate -> [Irate] -> SignalOut+ftload s0filename i1flag i2fns = outOpcode "ftload" args+ where args = [to s0filename, to i1flag] ++ map to i2fns+++-- | * opcode : ftsavek+-- +-- +-- * syntax : +-- +-- > ftsavek "filename", ktrig, iflag, ifn1 [, ifn2] [...]+-- +-- +-- * description : +-- +-- Save a set of previously-allocated tables to a file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ftsavek.html>+ +ftsavek :: (K k0) => String -> k0 -> Irate -> [Irate] -> SignalOut+ftsavek s0filename k1trig i2flag i3fns = outOpcode "ftsavek" args+ where args = [to s0filename, to k1trig, to i2flag] ++ map to i3fns+++-- | * opcode : ftsave+-- +-- +-- * syntax : +-- +-- > ftsave "filename", iflag, ifn1 [, ifn2] [...]+-- +-- +-- * description : +-- +-- Save a set of previously-allocated tables to a file.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ftsave.html>+ +ftsave :: String -> Irate -> [Irate] -> SignalOut+ftsave s0filename i1flag i2fns = outOpcode "ftsave" args+ where args = [to s0filename, to i1flag] ++ map to i2fns+++-- | * opcode : tablecopy+-- +-- +-- * syntax : +-- +-- > tablecopy kdft, ksft+-- +-- +-- * description : +-- +-- Simple, fast table copy opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablecopy.html>+ +tablecopy :: (K k0, K k1) => k0 -> k1 -> SignalOut+tablecopy k0dft k1sft = outOpcode "tablecopy" args+ where args = [to k0dft, to k1sft]+++-- | * opcode : tablegpw+-- +-- +-- * syntax : +-- +-- > tablegpw kfn+-- +-- +-- * description : +-- +-- Writes a table's guard point.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablegpw.html>+ +tablegpw :: (K k0) => k0 -> SignalOut+tablegpw k0fn = outOpcode "tablegpw" args+ where args = [to k0fn]+++-- | * opcode : tableicopy+-- +-- +-- * syntax : +-- +-- > tableicopy idft, isft+-- +-- +-- * description : +-- +-- Simple, fast table copy opcode.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tableicopy.html>+ +tableicopy :: Irate -> Irate -> SignalOut+tableicopy i0dft i1sft = outOpcode "tableicopy" args+ where args = [to i0dft, to i1sft]+++-- | * opcode : tableigpw+-- +-- +-- * syntax : +-- +-- > tableigpw ifn+-- +-- +-- * description : +-- +-- Writes a table's guard point.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tableigpw.html>+ +tableigpw :: Irate -> SignalOut+tableigpw i0fn = outOpcode "tableigpw" args+ where args = [to i0fn]+++-- | * opcode : tableimix+-- +-- +-- * syntax : +-- +-- > tableimix idft, idoff, ilen, is1ft, is1off, is1g, is2ft, is2off, is2g+-- +-- +-- * description : +-- +-- Mixes two tables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tableimix.html>+ +tableimix ::+ Irate ->+ Irate ->+ Irate ->+ Irate -> Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+tableimix i0dft i1doff i2len i3s1ft i4s1off i5s1g i6s2ft i7s2off+ i8s2g = outOpcode "tableimix" args+ where args+ = [to i0dft, to i1doff, to i2len, to i3s1ft, to i4s1off, to i5s1g,+ to i6s2ft, to i7s2off, to i8s2g]+++-- | * opcode : tableiw+-- +-- +-- * syntax : +-- +-- > tableiw isig, indx, ifn [, ixmode] [, ixoff] [, iwgmode]+-- +-- +-- * description : +-- +-- This opcode operates on existing function tables, changing their+-- contents. tableiw is used when all inputs are init time variables+-- or constants and you only want to run it at the initialization of+-- the instrument. The valid combinations of variable types are+-- shown by the first letter of the variable names.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tableiw.html>+ +tableiw :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+tableiw i0init i1sig i2ndx i3fn = outOpcode "tableiw" args+ where args = [to i1sig, to i2ndx, to i3fn] ++ map to i0init+++-- | * opcode : tablemix+-- +-- +-- * syntax : +-- +-- > tablemix kdft, kdoff, klen, ks1ft, ks1off, ks1g, ks2ft, ks2off, ks2g+-- +-- +-- * description : +-- +-- Mixes two tables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablemix.html>+ +tablemix ::+ (K k0, K k1, K k2, K k3, K k4, K k5, K k6, K k7, K k8) =>+ k0 -> k1 -> k2 -> k3 -> k4 -> k5 -> k6 -> k7 -> k8 -> SignalOut+tablemix k0dft k1doff k2len k3s1ft k4s1off k5s1g k6s2ft k7s2off+ k8s2g = outOpcode "tablemix" args+ where args+ = [to k0dft, to k1doff, to k2len, to k3s1ft, to k4s1off, to k5s1g,+ to k6s2ft, to k7s2off, to k8s2g]+++-- | * opcode : tablera+-- +-- +-- * syntax : +-- +-- > ares tablera kfn, kstart, koff+-- +-- +-- * description : +-- +-- These opcode reads tables in sequential locations to an a-rate+-- variable. Some thought is required before using it. It has at+-- least two major, and quite different, applications which are+-- discussed below.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablera.html>+ +tablera :: (K k0, K k1, K k2) => k0 -> k1 -> k2 -> Arate+tablera k0fn k1start k2off = opcode "tablera" args+ where args = [to k0fn, to k1start, to k2off]+++-- | * opcode : tablew+-- +-- +-- * syntax : +-- +-- > tablew asig, andx, ifn [, ixmode] [, ixoff] [, iwgmode]+-- > tablew isig, indx, ifn [, ixmode] [, ixoff] [, iwgmode]+-- > tablew ksig, kndx, ifn [, ixmode] [, ixoff] [, iwgmode]+-- +-- +-- * description : +-- +-- This opcode operates on existing function tables, changing their+-- contents. tablew is for writing at k- or at a-rates, with the+-- table number being specified at init time. The valid combinations+-- of variable types are shown by the first letter of the variable+-- names.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablew.html>+ +tablewA :: [Irate] -> Arate -> Arate -> Irate -> SignalOut+tablewA i0init a1sig a2ndx i3fn = outOpcode "tablew" args+ where args = [to a1sig, to a2ndx, to i3fn] ++ map to i0init+++-- | * opcode : tablew+-- +-- +-- * syntax : +-- +-- > tablew asig, andx, ifn [, ixmode] [, ixoff] [, iwgmode]+-- > tablew isig, indx, ifn [, ixmode] [, ixoff] [, iwgmode]+-- > tablew ksig, kndx, ifn [, ixmode] [, ixoff] [, iwgmode]+-- +-- +-- * description : +-- +-- This opcode operates on existing function tables, changing their+-- contents. tablew is for writing at k- or at a-rates, with the+-- table number being specified at init time. The valid combinations+-- of variable types are shown by the first letter of the variable+-- names.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablew.html>+ +tablewI :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+tablewI i0init i1sig i2ndx i3fn = outOpcode "tablew" args+ where args = [to i1sig, to i2ndx, to i3fn] ++ map to i0init+++-- | * opcode : tablew+-- +-- +-- * syntax : +-- +-- > tablew asig, andx, ifn [, ixmode] [, ixoff] [, iwgmode]+-- > tablew isig, indx, ifn [, ixmode] [, ixoff] [, iwgmode]+-- > tablew ksig, kndx, ifn [, ixmode] [, ixoff] [, iwgmode]+-- +-- +-- * description : +-- +-- This opcode operates on existing function tables, changing their+-- contents. tablew is for writing at k- or at a-rates, with the+-- table number being specified at init time. The valid combinations+-- of variable types are shown by the first letter of the variable+-- names.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablew.html>+ +tablewK ::+ (K k0, K k1) => [Irate] -> k0 -> k1 -> Irate -> SignalOut+tablewK i0init k1sig k2ndx i3fn = outOpcode "tablew" args+ where args = [to k1sig, to k2ndx, to i3fn] ++ map to i0init+++-- | * opcode : tablewa+-- +-- +-- * syntax : +-- +-- > kstart tablewa kfn, asig, koff+-- +-- +-- * description : +-- +-- This opcode writes to a table in sequential locations to and+-- from an a-rate variable. Some thought is required before using+-- it. It has at least two major, and quite different, applications+-- which are discussed below.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablewa.html>+ +tablewa :: (K k0, K k1) => k0 -> Arate -> k1 -> Krate+tablewa k0fn a1sig k2off = opcode "tablewa" args+ where args = [to k0fn, to a1sig, to k2off]+++-- | * opcode : tablewkt+-- +-- +-- * syntax : +-- +-- > tablewkt asig, andx, kfn [, ixmode] [, ixoff] [, iwgmode]+-- > tablewkt ksig, kndx, kfn [, ixmode] [, ixoff] [, iwgmode]+-- +-- +-- * description : +-- +-- This opcode operates on existing function tables, changing their+-- contents. tablewkt uses a k-rate variable for selecting the table+-- number. The valid combinations of variable types are shown by the+-- first letter of the variable names.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablewkt.html>+ +tablewktA :: (K k0) => [Irate] -> Arate -> Arate -> k0 -> SignalOut+tablewktA i0init a1sig a2ndx k3fn = outOpcode "tablewkt" args+ where args = [to a1sig, to a2ndx, to k3fn] ++ map to i0init+++-- | * opcode : tablewkt+-- +-- +-- * syntax : +-- +-- > tablewkt asig, andx, kfn [, ixmode] [, ixoff] [, iwgmode]+-- > tablewkt ksig, kndx, kfn [, ixmode] [, ixoff] [, iwgmode]+-- +-- +-- * description : +-- +-- This opcode operates on existing function tables, changing their+-- contents. tablewkt uses a k-rate variable for selecting the table+-- number. The valid combinations of variable types are shown by the+-- first letter of the variable names.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablewkt.html>+ +tablewktK ::+ (K k0, K k1, K k2) => [Irate] -> k0 -> k1 -> k2 -> SignalOut+tablewktK i0init k1sig k2ndx k3fn = outOpcode "tablewkt" args+ where args = [to k1sig, to k2ndx, to k3fn] ++ map to i0init+++-- | * opcode : tabmorph+-- +-- +-- * syntax : +-- +-- > kout tabmorph kindex, kweightpoint, ktabnum1, ktabnum2, +-- > ifn1, ifn2 [, ifn3, ifn4,... ifnN]+-- +-- +-- * description : +-- +-- tabmorph allows morphing between a set of tables of the same+-- size, by means of a weighted average between two currently+-- selected tables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tabmorph.html>+ +tabmorph ::+ (K k0, K k1, K k2, K k3) =>+ k0 -> k1 -> k2 -> k3 -> [Irate] -> Krate+tabmorph k0index k1weightpoint k2tabnum1 k3tabnum2 i4fn+ = opcode "tabmorph" args+ where args+ = [to k0index, to k1weightpoint, to k2tabnum1, to k3tabnum2] +++ map to i4fn+++-- | * opcode : tabmorpha+-- +-- +-- * syntax : +-- +-- > aout tabmorpha aindex, aweightpoint, atabnum1, atabnum2, +-- > ifn1, ifn2 [, ifn3, ifn4,... ifnN]+-- +-- +-- * description : +-- +-- tabmorpha allows morphing between a set of tables of the same+-- size, by means of a weighted average between two currently+-- selected tables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tabmorpha.html>+ +tabmorpha :: Arate -> Arate -> Arate -> Arate -> [Irate] -> Arate+tabmorpha a0index a1weightpoint a2tabnum1 a3tabnum2 i4fn+ = opcode "tabmorpha" args+ where args+ = [to a0index, to a1weightpoint, to a2tabnum1, to a3tabnum2] +++ map to i4fn+++-- | * opcode : tabmorphak+-- +-- +-- * syntax : +-- +-- > aout tabmorphak aindex, kweightpoint, ktabnum1, ktabnum2, +-- > ifn1, ifn2 [, ifn3, ifn4,... ifnN]+-- +-- +-- * description : +-- +-- tabmorphak allows morphing between a set of tables of the same+-- size, by means of a weighted average between two currently+-- selected tables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tabmorphak.html>+ +tabmorphak ::+ (K k0, K k1, K k2) => Arate -> k0 -> k1 -> k2 -> [Irate] -> Arate+tabmorphak a0index k1weightpoint k2tabnum1 k3tabnum2 i4fn+ = opcode "tabmorphak" args+ where args+ = [to a0index, to k1weightpoint, to k2tabnum1, to k3tabnum2] +++ map to i4fn+++-- | * opcode : tabmorphi+-- +-- +-- * syntax : +-- +-- > kout tabmorphi kindex, kweightpoint, ktabnum1, ktabnum2, +-- > ifn1, ifn2 [, ifn3, ifn4,... ifnN]+-- +-- +-- * description : +-- +-- tabmorphi allows morphing between a set of tables of the same+-- size, by means of a weighted average between two currently+-- selected tables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tabmorphi.html>+ +tabmorphi ::+ (K k0, K k1, K k2, K k3) =>+ k0 -> k1 -> k2 -> k3 -> [Irate] -> Krate+tabmorphi k0index k1weightpoint k2tabnum1 k3tabnum2 i4fn+ = opcode "tabmorphi" args+ where args+ = [to k0index, to k1weightpoint, to k2tabnum1, to k3tabnum2] +++ map to i4fn+++-- | * opcode : tabrec+-- +-- +-- * syntax : +-- +-- > tabrec ktrig_start, ktrig_stop, knumtics, kfn, kin1 [,kin2,...,kinN]+-- +-- +-- * description : +-- +-- Records control-rate signals on trigger-temporization basis.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tabrec.html>+ +tabrec ::+ (K k0, K k1, K k2, K k3, K k4) =>+ k0 -> k1 -> k2 -> k3 -> [k4] -> SignalOut+tabrec k0trig_start k1trig_stop k2numtics k3fn k4inN+ = outOpcode "tabrec" args+ where args+ = [to k0trig_start, to k1trig_stop, to k2numtics, to k3fn] +++ map to k4inN+++-- | * opcode : tabplay+-- +-- +-- * syntax : +-- +-- > tabplay ktrig, knumtics, kfn, kout1 [,kout2,..., koutN]+-- +-- +-- * description : +-- +-- Plays-back control-rate signals on trigger-temporization basis.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tabplay.html>+ +tabplay ::+ (K k0, K k1, K k2, K k3) => k0 -> k1 -> k2 -> [k3] -> SignalOut+tabplay k0trig k1numtics k2fn k3outN = outOpcode "tabplay" args+ where args = [to k0trig, to k1numtics, to k2fn] ++ map to k3outN
+ src/CsoundExpr/Opcodes/Table/Select.hs view
@@ -0,0 +1,122 @@+-- | Table Reading with Dynamic Selection+module CsoundExpr.Opcodes.Table.Select+ (tableiktA,+ tableiktK,+ tablektA,+ tablektK,+ tablexkt)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : tableikt+-- +-- +-- * syntax : +-- +-- > ares tableikt xndx, kfn [, ixmode] [, ixoff] [, iwrap]+-- > kres tableikt kndx, kfn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- k-rate control over table numbers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tableikt.html>+ +tableiktA :: (X x0, K k0) => [Irate] -> x0 -> k0 -> Arate+tableiktA i0init x1ndx k2fn = opcode "tableikt" args+ where args = [to x1ndx, to k2fn] ++ map to i0init+++-- | * opcode : tableikt+-- +-- +-- * syntax : +-- +-- > ares tableikt xndx, kfn [, ixmode] [, ixoff] [, iwrap]+-- > kres tableikt kndx, kfn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- k-rate control over table numbers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tableikt.html>+ +tableiktK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Krate+tableiktK i0init k1ndx k2fn = opcode "tableikt" args+ where args = [to k1ndx, to k2fn] ++ map to i0init+++-- | * opcode : tablekt+-- +-- +-- * syntax : +-- +-- > ares tablekt xndx, kfn [, ixmode] [, ixoff] [, iwrap]+-- > kres tablekt kndx, kfn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- k-rate control over table numbers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablekt.html>+ +tablektA :: (X x0, K k0) => [Irate] -> x0 -> k0 -> Arate+tablektA i0init x1ndx k2fn = opcode "tablekt" args+ where args = [to x1ndx, to k2fn] ++ map to i0init+++-- | * opcode : tablekt+-- +-- +-- * syntax : +-- +-- > ares tablekt xndx, kfn [, ixmode] [, ixoff] [, iwrap]+-- > kres tablekt kndx, kfn [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- k-rate control over table numbers.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablekt.html>+ +tablektK :: (K k0, K k1) => [Irate] -> k0 -> k1 -> Krate+tablektK i0init k1ndx k2fn = opcode "tablekt" args+ where args = [to k1ndx, to k2fn] ++ map to i0init+++-- | * opcode : tablexkt+-- +-- +-- * syntax : +-- +-- > ares tablexkt xndx, kfn, kwarp, iwsize [, ixmode] [, ixoff] [, iwrap]+-- +-- +-- * description : +-- +-- Reads function tables with linear, cubic, or sinc interpolation.+-- +-- +-- * url : <http://www.csounds.com/manual/html/tablexkt.html>+ +tablexkt ::+ (X x0, K k0, K k1) => [Irate] -> x0 -> k0 -> k1 -> Irate -> Arate+tablexkt i0init x1ndx k2fn k3warp i4wsize = opcode "tablexkt" args+ where args+ = [to x1ndx, to k2fn, to k3warp, to i4wsize] ++ map to i0init
+ src/CsoundExpr/Opcodes/Vectorial.hs view
@@ -0,0 +1,20 @@+-- | Vectorial Opcodes+module CsoundExpr.Opcodes.Vectorial+ (module CsoundExpr.Opcodes.Vectorial.Vectorialtables,+ module CsoundExpr.Opcodes.Vectorial.Vectorialscalar,+ module CsoundExpr.Opcodes.Vectorial.Vectorialvectorial,+ module CsoundExpr.Opcodes.Vectorial.EnvelopeGenerators,+ module CsoundExpr.Opcodes.Vectorial.Vectorialimiting,+ module CsoundExpr.Opcodes.Vectorial.Vectorialdelay,+ module CsoundExpr.Opcodes.Vectorial.Vectorialrandom)+where++++import CsoundExpr.Opcodes.Vectorial.Vectorialtables+import CsoundExpr.Opcodes.Vectorial.Vectorialscalar+import CsoundExpr.Opcodes.Vectorial.Vectorialvectorial+import CsoundExpr.Opcodes.Vectorial.EnvelopeGenerators+import CsoundExpr.Opcodes.Vectorial.Vectorialimiting+import CsoundExpr.Opcodes.Vectorial.Vectorialdelay+import CsoundExpr.Opcodes.Vectorial.Vectorialrandom
+ src/CsoundExpr/Opcodes/Vectorial/EnvelopeGenerators.hs view
@@ -0,0 +1,82 @@+-- | Vectorial Envelope Generators+module CsoundExpr.Opcodes.Vectorial.EnvelopeGenerators+ (vlinseg,+ vexpseg,+ vcella)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : vlinseg+-- +-- +-- * syntax : +-- +-- > vlinseg ifnout, ielements, ifn1, idur1, ifn2 [, idur2, ifn3 [...]]+-- +-- +-- * description : +-- +-- Generate linear vectorial segments+-- +-- +-- * url : <http://www.csounds.com/manual/html/vlinseg.html>+ +vlinseg :: Irate -> Irate -> [Irate] -> SignalOut+vlinseg i0fnout i1elements i2vals = outOpcode "vlinseg" args+ where args = [to i0fnout, to i1elements] ++ map to i2vals+++-- | * opcode : vexpseg+-- +-- +-- * syntax : +-- +-- > vexpseg ifnout, ielements, ifn1, idur1, ifn2 [, idur2, ifn3 [...]]+-- +-- +-- * description : +-- +-- Generate exponential vectorial segments+-- +-- +-- * url : <http://www.csounds.com/manual/html/vexpseg.html>+ +vexpseg :: Irate -> Irate -> [Irate] -> SignalOut+vexpseg i0fnout i1elements i2vals = outOpcode "vexpseg" args+ where args = [to i0fnout, to i1elements] ++ map to i2vals+++-- | * opcode : vcella+-- +-- +-- * syntax : +-- +-- > vcella ktrig, kreinit, ioutFunc, initStateFunc, +-- > iRuleFunc, ielements, irulelen [, iradius]+-- +-- +-- * description : +-- +-- Unidimensional Cellular Automata applied to Csound vectors+-- +-- +-- * url : <http://www.csounds.com/manual/html/vcella.html>+ +vcella ::+ (K k0, K k1) =>+ [Irate] ->+ k0 -> k1 -> Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+vcella i0init k1trig k2reinit i3outFunc i4nitStateFunc i5RuleFunc+ i6elements i7rulelen = outOpcode "vcella" args+ where args+ = [to k1trig, to k2reinit, to i3outFunc, to i4nitStateFunc,+ to i5RuleFunc, to i6elements, to i7rulelen]+ ++ map to i0init
+ src/CsoundExpr/Opcodes/Vectorial/Vectorialdelay.hs view
@@ -0,0 +1,78 @@+-- | Vectorial Control-rate Delay Paths+module CsoundExpr.Opcodes.Vectorial.Vectorialdelay+ (vdelayk,+ vport,+ vecdelay)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : vdelayk+-- +-- +-- * syntax : +-- +-- > kout vdelayk iksig, kdel, imaxdel [, iskip, imode]+-- +-- +-- * description : +-- +-- Variable delay applied to a k-rate signal+-- +-- +-- * url : <http://www.csounds.com/manual/html/vdelayk.html>+ +vdelayk :: (K k0) => [Irate] -> Irate -> k0 -> Irate -> Krate+vdelayk i0init i1ksig k2del i3maxdel = opcode "vdelayk" args+ where args = [to i1ksig, to k2del, to i3maxdel] ++ map to i0init+++-- | * opcode : vport+-- +-- +-- * syntax : +-- +-- > vport ifn, khtime, ielements [, ifnInit]+-- +-- +-- * description : +-- +-- Generate a sort of 'vectorial' portamento+-- +-- +-- * url : <http://www.csounds.com/manual/html/vport.html>+ +vport :: (K k0) => [Irate] -> Irate -> k0 -> Irate -> SignalOut+vport i0init i1fn k2htime i3elements = outOpcode "vport" args+ where args = [to i1fn, to k2htime, to i3elements] ++ map to i0init+++-- | * opcode : vecdelay+-- +-- +-- * syntax : +-- +-- > vecdelay ifn, ifnIn, ifnDel, ielements, imaxdel [, iskip]+-- +-- +-- * description : +-- +-- Generate a sort of 'vectorial' delay+-- +-- +-- * url : <http://www.csounds.com/manual/html/vecdelay.html>+ +vecdelay ::+ [Irate] -> Irate -> Irate -> Irate -> Irate -> Irate -> SignalOut+vecdelay i0init i1fn i2fnIn i3fnDel i4elements i5maxdel+ = outOpcode "vecdelay" args+ where args+ = [to i1fn, to i2fnIn, to i3fnDel, to i4elements, to i5maxdel] +++ map to i0init
+ src/CsoundExpr/Opcodes/Vectorial/Vectorialimiting.hs view
@@ -0,0 +1,74 @@+-- | Limiting and wrapping of vectorial control signals+module CsoundExpr.Opcodes.Vectorial.Vectorialimiting+ (vlimit,+ vwrap,+ vmirror)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : vlimit+-- +-- +-- * syntax : +-- +-- > vlimit ifn, kmin, kmax, ielements+-- +-- +-- * description : +-- +-- Limits elements of vectorial control signals.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vlimit.html>+ +vlimit :: (K k0, K k1) => Irate -> k0 -> k1 -> Irate -> SignalOut+vlimit i0fn k1min k2max i3elements = outOpcode "vlimit" args+ where args = [to i0fn, to k1min, to k2max, to i3elements]+++-- | * opcode : vwrap+-- +-- +-- * syntax : +-- +-- > vwrap ifn, kmin, kmax, ielements+-- +-- +-- * description : +-- +-- Wraps elements of vectorial control signals.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vwrap.html>+ +vwrap :: (K k0, K k1) => Irate -> k0 -> k1 -> Irate -> SignalOut+vwrap i0fn k1min k2max i3elements = outOpcode "vwrap" args+ where args = [to i0fn, to k1min, to k2max, to i3elements]+++-- | * opcode : vmirror+-- +-- +-- * syntax : +-- +-- > vmirror ifn, kmin, kmax, ielements+-- +-- +-- * description : +-- +-- 'Reflects' elements of vectorial control signals on thresholds.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vmirror.html>+ +vmirror :: (K k0, K k1) => Irate -> k0 -> k1 -> Irate -> SignalOut+vmirror i0fn k1min k2max i3elements = outOpcode "vmirror" args+ where args = [to i0fn, to k1min, to k2max, to i3elements]
+ src/CsoundExpr/Opcodes/Vectorial/Vectorialrandom.hs view
@@ -0,0 +1,61 @@+-- | Vectorial Random Signal Generators+module CsoundExpr.Opcodes.Vectorial.Vectorialrandom+ (vrandh,+ vrandi)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : vrandh+-- +-- +-- * syntax : +-- +-- > vrandh ifn, krange, kcps, ielements [, idstoffset] [, iseed] [, isize] [, ioffset]+-- +-- +-- * description : +-- +-- Generates a vector of random numbers stored into a table,+-- holding the values for a period of time. Generates a sort of+-- 'vectorial band-limited noise'.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vrandh.html>+ +vrandh ::+ (K k0, K k1) => [Irate] -> Irate -> k0 -> k1 -> Irate -> SignalOut+vrandh i0init i1fn k2range k3cps i4elements+ = outOpcode "vrandh" args+ where args+ = [to i1fn, to k2range, to k3cps, to i4elements] ++ map to i0init+++-- | * opcode : vrandi+-- +-- +-- * syntax : +-- +-- > vrandi ifn, krange, kcps, ielements [, idstoffset] [, iseed] [, isize] [, ioffset]+-- +-- +-- * description : +-- +-- Generate a sort of 'vectorial band-limited noise'+-- +-- +-- * url : <http://www.csounds.com/manual/html/vrandi.html>+ +vrandi ::+ (K k0, K k1) => [Irate] -> Irate -> k0 -> k1 -> Irate -> SignalOut+vrandi i0init i1fn k2range k3cps i4elements+ = outOpcode "vrandi" args+ where args+ = [to i1fn, to k2range, to k3cps, to i4elements] ++ map to i0init
+ src/CsoundExpr/Opcodes/Vectorial/Vectorialscalar.hs view
@@ -0,0 +1,183 @@+-- | Operations Between a Vectorial and a Scalar Signal+module CsoundExpr.Opcodes.Vectorial.Vectorialscalar+ (vadd,+ vmult,+ vpow,+ vexp,+ vadd_i,+ vmult_i,+ vpow_i,+ vexp_i)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : vadd+-- +-- +-- * syntax : +-- +-- > vadd ifn, kval, kelements [, kdstoffset] [, kverbose]+-- +-- +-- * description : +-- +-- Adds a scalar value to a vector in a table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vadd.html>+ +vadd ::+ (K k0, K k1, K k2) => [k0] -> Irate -> k1 -> k2 -> SignalOut+vadd k0init i1fn k2val k3elements = outOpcode "vadd" args+ where args = [to i1fn, to k2val, to k3elements] ++ map to k0init+++-- | * opcode : vmult+-- +-- +-- * syntax : +-- +-- > vmult ifn, kval, kelements [, kdstoffset] [, kverbose]+-- +-- +-- * description : +-- +-- Multiplies a vector in a table by a scalar value.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vmult.html>+ +vmult ::+ (K k0, K k1, K k2) => [k0] -> Irate -> k1 -> k2 -> SignalOut+vmult k0init i1fn k2val k3elements = outOpcode "vmult" args+ where args = [to i1fn, to k2val, to k3elements] ++ map to k0init+++-- | * opcode : vpow+-- +-- +-- * syntax : +-- +-- > vpow ifn, kval, kelements [, kdstoffset] [, kverbose]+-- +-- +-- * description : +-- +-- Raises each element of a vector to a scalar power+-- +-- +-- * url : <http://www.csounds.com/manual/html/vpow.html>+ +vpow ::+ (K k0, K k1, K k2) => [k0] -> Irate -> k1 -> k2 -> SignalOut+vpow k0init i1fn k2val k3elements = outOpcode "vpow" args+ where args = [to i1fn, to k2val, to k3elements] ++ map to k0init+++-- | * opcode : vexp+-- +-- +-- * syntax : +-- +-- > vexp ifn, kval, kelements [, kdstoffset] [, kverbose]+-- +-- +-- * description : +-- +-- Performs power-of operations between a vector and a scalar+-- +-- +-- * url : <http://www.csounds.com/manual/html/vexp.html>+ +vexp ::+ (K k0, K k1, K k2) => [k0] -> Irate -> k1 -> k2 -> SignalOut+vexp k0init i1fn k2val k3elements = outOpcode "vexp" args+ where args = [to i1fn, to k2val, to k3elements] ++ map to k0init+++-- | * opcode : vadd_i+-- +-- +-- * syntax : +-- +-- > vadd_i ifn, ival, ielements [, idstoffset]+-- +-- +-- * description : +-- +-- Adds a scalar value to a vector in a table.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vadd_i.html>+ +vadd_i :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+vadd_i i0init i1fn i2val i3elements = outOpcode "vadd_i" args+ where args = [to i1fn, to i2val, to i3elements] ++ map to i0init+++-- | * opcode : vmult_i+-- +-- +-- * syntax : +-- +-- > vmult_i ifn, ival, ielements [, idstoffset]+-- +-- +-- * description : +-- +-- Multiplies a vector in a table by a scalar value.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vmult_i.html>+ +vmult_i :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+vmult_i i0init i1fn i2val i3elements = outOpcode "vmult_i" args+ where args = [to i1fn, to i2val, to i3elements] ++ map to i0init+++-- | * opcode : vpow_i+-- +-- +-- * syntax : +-- +-- > vpow_i ifn, ival, ielements [, idstoffset]+-- +-- +-- * description : +-- +-- Raises each element of a vector to a scalar power+-- +-- +-- * url : <http://www.csounds.com/manual/html/vpow_i.html>+ +vpow_i :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+vpow_i i0init i1fn i2val i3elements = outOpcode "vpow_i" args+ where args = [to i1fn, to i2val, to i3elements] ++ map to i0init+++-- | * opcode : vexp_i+-- +-- +-- * syntax : +-- +-- > vexp_i ifn, ival, ielements[, idstoffset]+-- +-- +-- * description : +-- +-- Performs power-of operations between a vector and a scalar+-- +-- +-- * url : <http://www.csounds.com/manual/html/vexp_i.html>+ +vexp_i :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+vexp_i i0init i1fn i2val i3elements = outOpcode "vexp_i" args+ where args = [to i1fn, to i2val, to i3elements] ++ map to i0init
+ src/CsoundExpr/Opcodes/Vectorial/Vectorialtables.hs view
@@ -0,0 +1,294 @@+-- | Tables of vectors operators+module CsoundExpr.Opcodes.Vectorial.Vectorialtables+ (vtablei,+ vtable1k,+ vtablek,+ vtablea,+ vtablewi,+ vtablewk,+ vtablewa,+ vtabi,+ vtabk,+ vtaba,+ vtabwi,+ vtabwk,+ vtabwa)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : vtablei+-- +-- +-- * syntax : +-- +-- > vtablei indx, ifn, interp, ixmode, iout1 [, iout2, iout3,...., ioutN ]+-- +-- +-- * description : +-- +-- This opcode reads vectors from tables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtablei.html>+ +vtablei :: Irate -> Irate -> Irate -> Irate -> [Irate] -> SignalOut+vtablei i0ndx i1fn i2interp i3xmode i4outN+ = outOpcode "vtablei" args+ where args+ = [to i0ndx, to i1fn, to i2interp, to i3xmode] ++ map to i4outN+++-- | * opcode : vtable1k+-- +-- +-- * syntax : +-- +-- > vtable1k kfn,kout1 [, kout2, kout3,...., koutN ]+-- +-- +-- * description : +-- +-- This opcode reads vectors from tables at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtable1k.html>+ +vtable1k :: (K k0, K k1) => k0 -> [k1] -> SignalOut+vtable1k k0fn k1outN = outOpcode "vtable1k" args+ where args = [to k0fn] ++ map to k1outN+++-- | * opcode : vtablek+-- +-- +-- * syntax : +-- +-- > vtablek kndx, kfn, kinterp, ixmode, kout1 [, kout2, kout3,...., koutN ]+-- +-- +-- * description : +-- +-- This opcode reads vectors from tables at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtablek.html>+ +vtablek ::+ (K k0, K k1, K k2) =>+ k0 -> k1 -> k2 -> Irate -> [Irate] -> SignalOut+vtablek k0ndx k1fn k2interp i3xmode i4outN+ = outOpcode "vtablek" args+ where args+ = [to k0ndx, to k1fn, to k2interp, to i3xmode] ++ map to i4outN+++-- | * opcode : vtablea+-- +-- +-- * syntax : +-- +-- > vtablea andx, kfn, kinterp, ixmode, aout1 [, aout2, aout3,...., aoutN ]+-- +-- +-- * description : +-- +-- This opcode reads vectors from tables at a-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtablea.html>+ +vtablea ::+ (K k0, K k1) => Arate -> k0 -> k1 -> Irate -> [Arate] -> SignalOut+vtablea a0ndx k1fn k2interp i3xmode a4outN+ = outOpcode "vtablea" args+ where args+ = [to a0ndx, to k1fn, to k2interp, to i3xmode] ++ map to a4outN+++-- | * opcode : vtablewi+-- +-- +-- * syntax : +-- +-- > vtablewi indx, ifn, ixmode, inarg1 [, inarg2, inarg3,...., inargN ]+-- +-- +-- * description : +-- +-- This opcode writes vectors to tables at init time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtablewi.html>+ +vtablewi :: Irate -> Irate -> Irate -> [Irate] -> SignalOut+vtablewi i0ndx i1fn i2xmode i3arg = outOpcode "vtablewi" args+ where args = [to i0ndx, to i1fn, to i2xmode] ++ map to i3arg+++-- | * opcode : vtablewk+-- +-- +-- * syntax : +-- +-- > vtablewk kndx, kfn, ixmode, kinarg1 [, kinarg2, kinarg3,...., kinargN ]+-- +-- +-- * description : +-- +-- This opcode writes vectors to tables at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtablewk.html>+ +vtablewk ::+ (K k0, K k1, K k2) => k0 -> k1 -> Irate -> [k2] -> SignalOut+vtablewk k0ndx k1fn i2xmode k3arg = outOpcode "vtablewk" args+ where args = [to k0ndx, to k1fn, to i2xmode] ++ map to k3arg+++-- | * opcode : vtablewa+-- +-- +-- * syntax : +-- +-- > vtablewa andx, kfn, ixmode, ainarg1 [, ainarg2, ainarg3,...., ainargN ]+-- +-- +-- * description : +-- +-- This opcode writes vectors to tables at a-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtablewa.html>+ +vtablewa :: Arate -> Arate -> Irate -> [Arate] -> SignalOut+vtablewa a0ndx a1fn i2xmode a3arg = outOpcode "vtablewa" args+ where args = [to a0ndx, to a1fn, to i2xmode] ++ map to a3arg+++-- | * opcode : vtabi+-- +-- +-- * syntax : +-- +-- > vtabi indx, ifn, iout1 [, iout2, iout3,...., ioutN ]+-- +-- +-- * description : +-- +-- This opcode reads vectors from tables.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtabi.html>+ +vtabi :: Irate -> Irate -> [Irate] -> SignalOut+vtabi i0ndx i1fn i2outN = outOpcode "vtabi" args+ where args = [to i0ndx, to i1fn] ++ map to i2outN+++-- | * opcode : vtabk+-- +-- +-- * syntax : +-- +-- > vtabk kndx, ifn, kout1 [, kout2, kout3,...., koutN ]+-- +-- +-- * description : +-- +-- This opcode reads vectors from tables at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtabk.html>+ +vtabk :: (K k0, K k1) => k0 -> Irate -> [k1] -> SignalOut+vtabk k0ndx i1fn k2outN = outOpcode "vtabk" args+ where args = [to k0ndx, to i1fn] ++ map to k2outN+++-- | * opcode : vtaba+-- +-- +-- * syntax : +-- +-- > vtaba andx, ifn, aout1 [, aout2, aout3,...., aoutN ]+-- +-- +-- * description : +-- +-- This opcode reads vectors from tables at a-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtaba.html>+ +vtaba :: Arate -> Irate -> [Arate] -> SignalOut+vtaba a0ndx i1fn a2outN = outOpcode "vtaba" args+ where args = [to a0ndx, to i1fn] ++ map to a2outN+++-- | * opcode : vtabwi+-- +-- +-- * syntax : +-- +-- > vtabwi indx, ifn, inarg1 [, inarg2, inarg3,...., inargN ]+-- +-- +-- * description : +-- +-- This opcode writes vectors to tables at init time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtabwi.html>+ +vtabwi :: Irate -> Irate -> [Irate] -> SignalOut+vtabwi i0ndx i1fn i2outN = outOpcode "vtabwi" args+ where args = [to i0ndx, to i1fn] ++ map to i2outN+++-- | * opcode : vtabwk+-- +-- +-- * syntax : +-- +-- > vtabwk kndx, ifn, kinarg1 [, kinarg2, kinarg3,...., kinargN ]+-- +-- +-- * description : +-- +-- This opcode writes vectors to tables at a-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtabwk.html>+ +vtabwk :: (K k0, K k1) => k0 -> Irate -> [k1] -> SignalOut+vtabwk k0ndx i1fn k2outN = outOpcode "vtabwk" args+ where args = [to k0ndx, to i1fn] ++ map to k2outN+++-- | * opcode : vtabwa+-- +-- +-- * syntax : +-- +-- > vtabwa andx, ifn, ainarg1 [, ainarg2, ainarg3,...., ainargN ]+-- +-- +-- * description : +-- +-- This opcode writes vectors to tables at a-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vtabwa.html>+ +vtabwa :: Arate -> Irate -> [Arate] -> SignalOut+vtabwa a0ndx i1fn a2outN = outOpcode "vtabwa" args+ where args = [to a0ndx, to i1fn] ++ map to a2outN
+ src/CsoundExpr/Opcodes/Vectorial/Vectorialvectorial.hs view
@@ -0,0 +1,335 @@+-- | Operations Between two Vectorial Signals+module CsoundExpr.Opcodes.Vectorial.Vectorialvectorial+ (vaddv,+ vsubv,+ vmultv,+ vdivv,+ vpowv,+ vexpv,+ vcopy,+ vmap,+ vaddv_i,+ vsubv_i,+ vmultv_i,+ vdivv_i,+ vpowv_i,+ vexpv_i,+ vcopy_i)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : vaddv+-- +-- +-- * syntax : +-- +-- > vaddv ifn1, ifn2, kelements [, kdstoffset] [, ksrcoffset] [,kverbose]+-- +-- +-- * description : +-- +-- Performs addition between two vectorial control signals+-- +-- +-- * url : <http://www.csounds.com/manual/html/vaddv.html>+ +vaddv :: (K k0, K k1) => [k0] -> Irate -> Irate -> k1 -> SignalOut+vaddv k0init i1fn1 i2fn2 k3elements = outOpcode "vaddv" args+ where args = [to i1fn1, to i2fn2, to k3elements] ++ map to k0init+++-- | * opcode : vsubv+-- +-- +-- * syntax : +-- +-- > vsubv ifn1, ifn2, kelements [, kdstoffset] [, ksrcoffset] [,kverbose]+-- +-- +-- * description : +-- +-- Performs subtraction between two vectorial control signals+-- +-- +-- * url : <http://www.csounds.com/manual/html/vsubv.html>+ +vsubv :: (K k0, K k1) => [k0] -> Irate -> Irate -> k1 -> SignalOut+vsubv k0init i1fn1 i2fn2 k3elements = outOpcode "vsubv" args+ where args = [to i1fn1, to i2fn2, to k3elements] ++ map to k0init+++-- | * opcode : vmultv+-- +-- +-- * syntax : +-- +-- > vmultv ifn1, ifn2, kelements [, kdstoffset] [, ksrcoffset] [,kverbose]+-- +-- +-- * description : +-- +-- Performs mutiplication between two vectorial control signals+-- +-- +-- * url : <http://www.csounds.com/manual/html/vmultv.html>+ +vmultv :: (K k0, K k1) => [k0] -> Irate -> Irate -> k1 -> SignalOut+vmultv k0init i1fn1 i2fn2 k3elements = outOpcode "vmultv" args+ where args = [to i1fn1, to i2fn2, to k3elements] ++ map to k0init+++-- | * opcode : vdivv+-- +-- +-- * syntax : +-- +-- > vdivv ifn1, ifn2, kelements [, kdstoffset] [, ksrcoffset] [,kverbose]+-- +-- +-- * description : +-- +-- Performs division between two vectorial control signals+-- +-- +-- * url : <http://www.csounds.com/manual/html/vdivv.html>+ +vdivv :: (K k0, K k1) => [k0] -> Irate -> Irate -> k1 -> SignalOut+vdivv k0init i1fn1 i2fn2 k3elements = outOpcode "vdivv" args+ where args = [to i1fn1, to i2fn2, to k3elements] ++ map to k0init+++-- | * opcode : vpowv+-- +-- +-- * syntax : +-- +-- > vpowv ifn1, ifn2, kelements [, kdstoffset] [, ksrcoffset] [,kverbose]+-- +-- +-- * description : +-- +-- Performs power-of operations between two vectorial control+-- signals+-- +-- +-- * url : <http://www.csounds.com/manual/html/vpowv.html>+ +vpowv :: (K k0, K k1) => [k0] -> Irate -> Irate -> k1 -> SignalOut+vpowv k0init i1fn1 i2fn2 k3elements = outOpcode "vpowv" args+ where args = [to i1fn1, to i2fn2, to k3elements] ++ map to k0init+++-- | * opcode : vexpv+-- +-- +-- * syntax : +-- +-- > vexpv ifn1, ifn2, kelements [, kdstoffset] [, ksrcoffset] [,kverbose]+-- +-- +-- * description : +-- +-- Performs exponential operations between two vectorial control+-- signals+-- +-- +-- * url : <http://www.csounds.com/manual/html/vexpv.html>+ +vexpv :: (K k0, K k1) => [k0] -> Irate -> Irate -> k1 -> SignalOut+vexpv k0init i1fn1 i2fn2 k3elements = outOpcode "vexpv" args+ where args = [to i1fn1, to i2fn2, to k3elements] ++ map to k0init+++-- | * opcode : vcopy+-- +-- +-- * syntax : +-- +-- > vcopy ifn, ifn2, kelements [, kdstoffset] [, ksrcoffset] [, kverbose]+-- +-- +-- * description : +-- +-- Copies between two vectorial control signals+-- +-- +-- * url : <http://www.csounds.com/manual/html/vcopy.html>+ +vcopy :: (K k0, K k1) => [k0] -> Irate -> Irate -> k1 -> SignalOut+vcopy k0init i1fn i2fn2 k3elements = outOpcode "vcopy" args+ where args = [to i1fn, to i2fn2, to k3elements] ++ map to k0init+++-- | * opcode : vmap+-- +-- +-- * syntax : +-- +-- > vmap ifn1, ifn2, ielements [,idstoffset, isrcoffset]+-- +-- +-- * description : +-- +-- Maps elements from a vector onto another according to the+-- indeces of a this vector+-- +-- +-- * url : <http://www.csounds.com/manual/html/vmap.html>+ +vmap :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+vmap i0init i1fn1 i2fn2 i3elements = outOpcode "vmap" args+ where args = [to i1fn1, to i2fn2, to i3elements] ++ map to i0init+++-- | * opcode : vaddv_i+-- +-- +-- * syntax : +-- +-- > vaddv_i ifn1, ifn2, ielements [, idstoffset] [, isrcoffset]+-- +-- +-- * description : +-- +-- Performs addition between two vectorial control signals at init+-- time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vaddv_i.html>+ +vaddv_i :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+vaddv_i i0init i1fn1 i2fn2 i3elements = outOpcode "vaddv_i" args+ where args = [to i1fn1, to i2fn2, to i3elements] ++ map to i0init+++-- | * opcode : vsubv_i+-- +-- +-- * syntax : +-- +-- > vsubv_i ifn1, ifn2, ielements [, idstoffset] [, isrcoffset]+-- +-- +-- * description : +-- +-- Performs subtraction between two vectorial control signals at+-- init time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vsubv_i.html>+ +vsubv_i :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+vsubv_i i0init i1fn1 i2fn2 i3elements = outOpcode "vsubv_i" args+ where args = [to i1fn1, to i2fn2, to i3elements] ++ map to i0init+++-- | * opcode : vmultv_i+-- +-- +-- * syntax : +-- +-- > vmultv_i ifn1, ifn2, ielements [, idstoffset] [, isrcoffset]+-- +-- +-- * description : +-- +-- Performs mutiplication between two vectorial control signals at+-- init time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vmultv_i.html>+ +vmultv_i :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+vmultv_i i0init i1fn1 i2fn2 i3elements = outOpcode "vmultv_i" args+ where args = [to i1fn1, to i2fn2, to i3elements] ++ map to i0init+++-- | * opcode : vdivv_i+-- +-- +-- * syntax : +-- +-- > vdivv_i ifn1, ifn2, ielements [, idstoffset] [, isrcoffset]+-- +-- +-- * description : +-- +-- Performs division between two vectorial control signals at init+-- time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vdivv_i.html>+ +vdivv_i :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+vdivv_i i0init i1fn1 i2fn2 i3elements = outOpcode "vdivv_i" args+ where args = [to i1fn1, to i2fn2, to i3elements] ++ map to i0init+++-- | * opcode : vpowv_i+-- +-- +-- * syntax : +-- +-- > vpowv_i ifn1, ifn2, ielements [, idstoffset] [, isrcoffset]+-- +-- +-- * description : +-- +-- Performs power-of operations between two vectorial control+-- signals at init time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vpowv_i.html>+ +vpowv_i :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+vpowv_i i0init i1fn1 i2fn2 i3elements = outOpcode "vpowv_i" args+ where args = [to i1fn1, to i2fn2, to i3elements] ++ map to i0init+++-- | * opcode : vexpv_i+-- +-- +-- * syntax : +-- +-- > vexpv_i ifn1, ifn2, ielements [, idstoffset] [, isrcoffset]+-- +-- +-- * description : +-- +-- Performs exponential operations between two vectorial control+-- signals at init time.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vexpv_i.html>+ +vexpv_i :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+vexpv_i i0init i1fn1 i2fn2 i3elements = outOpcode "vexpv_i" args+ where args = [to i1fn1, to i2fn2, to i3elements] ++ map to i0init+++-- | * opcode : vcopy_i+-- +-- +-- * syntax : +-- +-- > vcopy_i ifn, ifn2, ielements [,idstoffset, isrcoffset]+-- +-- +-- * description : +-- +-- Copies a vector from one table to another.+-- +-- +-- * url : <http://www.csounds.com/manual/html/vcopy_i.html>+ +vcopy_i :: [Irate] -> Irate -> Irate -> Irate -> SignalOut+vcopy_i i0init i1fn i2fn2 i3elements = outOpcode "vcopy_i" args+ where args = [to i1fn, to i2fn2, to i3elements] ++ map to i0init
+ src/CsoundExpr/Opcodes/Zak.hs view
@@ -0,0 +1,8 @@+-- | Zak Patch System+module CsoundExpr.Opcodes.Zak+ (module CsoundExpr.Opcodes.Zak.Top)+where++++import CsoundExpr.Opcodes.Zak.Top
+ src/CsoundExpr/Opcodes/Zak/Top.hs view
@@ -0,0 +1,326 @@+-- | Zak Patch System+module CsoundExpr.Opcodes.Zak.Top+ (zacl,+ zakinit,+ zamod,+ zar,+ zarg,+ zaw,+ zawm,+ zkcl,+ zkmod,+ zkr,+ zkw,+ zkwm,+ zir,+ ziw,+ ziwm)+where++++import CsoundExpr.Base.Types+import CsoundExpr.Base.MultiOut+import CsoundExpr.Base.SideEffect+import CsoundExpr.Base.UserDefined++++-- | * opcode : zacl+-- +-- +-- * syntax : +-- +-- > zacl kfirst, klast+-- +-- +-- * description : +-- +-- Clears one or more variables in the za space.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zacl.html>+ +zacl :: (K k0, K k1) => k0 -> k1 -> SignalOut+zacl k0first k1last = outOpcode "zacl" args+ where args = [to k0first, to k1last]+++-- | * opcode : zakinit+-- +-- +-- * syntax : +-- +-- > zakinit isizea, isizek+-- +-- +-- * description : +-- +-- Establishes zak space. Must be called only once.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zakinit.html>+ +zakinit :: Irate -> Irate -> SignalOut+zakinit i0sizea i1sizek = outOpcode "zakinit" args+ where args = [to i0sizea, to i1sizek]+++-- | * opcode : zamod+-- +-- +-- * syntax : +-- +-- > ares zamod asig, kzamod+-- +-- +-- * description : +-- +-- Modulates one a-rate signal by a second one.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zamod.html>+ +zamod :: (K k0) => Arate -> k0 -> Arate+zamod a0sig k1zamod = opcode "zamod" args+ where args = [to a0sig, to k1zamod]+++-- | * opcode : zar+-- +-- +-- * syntax : +-- +-- > ares zar kndx+-- +-- +-- * description : +-- +-- Reads from a location in za space at a-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zar.html>+ +zar :: (K k0) => k0 -> Arate+zar k0ndx = opcode "zar" args+ where args = [to k0ndx]+++-- | * opcode : zarg+-- +-- +-- * syntax : +-- +-- > ares zarg kndx, kgain+-- +-- +-- * description : +-- +-- Reads from a location in za space at a-rate, adds some gain.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zarg.html>+ +zarg :: (K k0, K k1) => k0 -> k1 -> Arate+zarg k0ndx k1gain = opcode "zarg" args+ where args = [to k0ndx, to k1gain]+++-- | * opcode : zaw+-- +-- +-- * syntax : +-- +-- > zaw asig, kndx+-- +-- +-- * description : +-- +-- Writes to a za variable at a-rate without mixing.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zaw.html>+ +zaw :: (K k0) => Arate -> k0 -> SignalOut+zaw a0sig k1ndx = outOpcode "zaw" args+ where args = [to a0sig, to k1ndx]+++-- | * opcode : zawm+-- +-- +-- * syntax : +-- +-- > zawm asig, kndx [, imix]+-- +-- +-- * description : +-- +-- Writes to a za variable at a-rate with mixing.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zawm.html>+ +zawm :: (K k0) => [Irate] -> Arate -> k0 -> SignalOut+zawm i0init a1sig k2ndx = outOpcode "zawm" args+ where args = [to a1sig, to k2ndx] ++ map to i0init+++-- | * opcode : zkcl+-- +-- +-- * syntax : +-- +-- > zkcl kfirst, klast+-- +-- +-- * description : +-- +-- Clears one or more variables in the zk space.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zkcl.html>+ +zkcl :: (K k0, K k1) => k0 -> k1 -> SignalOut+zkcl k0first k1last = outOpcode "zkcl" args+ where args = [to k0first, to k1last]+++-- | * opcode : zkmod+-- +-- +-- * syntax : +-- +-- > kres zkmod ksig, kzkmod+-- +-- +-- * description : +-- +-- Facilitates the modulation of one signal by another.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zkmod.html>+ +zkmod :: (K k0, K k1) => k0 -> k1 -> Krate+zkmod k0sig k1zkmod = opcode "zkmod" args+ where args = [to k0sig, to k1zkmod]+++-- | * opcode : zkr+-- +-- +-- * syntax : +-- +-- > kres zkr kndx+-- +-- +-- * description : +-- +-- Reads from a location in zk space at k-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zkr.html>+ +zkr :: (K k0) => k0 -> Krate+zkr k0ndx = opcode "zkr" args+ where args = [to k0ndx]+++-- | * opcode : zkw+-- +-- +-- * syntax : +-- +-- > zkw ksig, kndx+-- +-- +-- * description : +-- +-- Writes to a zk variable at k-rate without mixing.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zkw.html>+ +zkw :: (K k0, K k1) => k0 -> k1 -> SignalOut+zkw k0sig k1ndx = outOpcode "zkw" args+ where args = [to k0sig, to k1ndx]+++-- | * opcode : zkwm+-- +-- +-- * syntax : +-- +-- > zkwm ksig, kndx [, imix]+-- +-- +-- * description : +-- +-- Writes to a zk variable at k-rate with mixing.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zkwm.html>+ +zkwm :: (K k0, K k1) => [Irate] -> k0 -> k1 -> SignalOut+zkwm i0init k1sig k2ndx = outOpcode "zkwm" args+ where args = [to k1sig, to k2ndx] ++ map to i0init+++-- | * opcode : zir+-- +-- +-- * syntax : +-- +-- > ir zir indx+-- +-- +-- * description : +-- +-- Reads from a location in zk space at i-rate.+-- +-- +-- * url : <http://www.csounds.com/manual/html/zir.html>+ +zir :: Irate -> Irate+zir i0ndx = opcode "zir" args+ where args = [to i0ndx]+++-- | * opcode : ziw+-- +-- +-- * syntax : +-- +-- > ziw isig, indx+-- +-- +-- * description : +-- +-- Writes to a zk variable at i-rate without mixing.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ziw.html>+ +ziw :: Irate -> Irate -> SignalOut+ziw i0sig i1ndx = outOpcode "ziw" args+ where args = [to i0sig, to i1ndx]+++-- | * opcode : ziwm+-- +-- +-- * syntax : +-- +-- > ziwm isig, indx [, imix]+-- +-- +-- * description : +-- +-- Writes to a zk variable to an i-rate variable with mixing.+-- +-- +-- * url : <http://www.csounds.com/manual/html/ziwm.html>+ +ziwm :: [Irate] -> Irate -> Irate -> SignalOut+ziwm i0init i1sig i2ndx = outOpcode "ziwm" args+ where args = [to i1sig, to i2ndx] ++ map to i0init
+ src/CsoundExpr/Translator/AssignmentElimination.hs view
@@ -0,0 +1,159 @@+module CsoundExpr.Translator.AssignmentElimination + (eliminateAssignment,+ SubstExpr(..), RateInfo(..), Opcode, + numArgName, strArgName)+where++import Control.Monad.State+import qualified Data.Map as M+import Data.Either++import qualified CsoundExpr.Translator.Cs.CsTree as La+import qualified CsoundExpr.Translator.Cs.CsoundFile as Cs++import CsoundExpr.Translator.ExprTree.ExprTree+import CsoundExpr.Translator.Types++type SubstTable = M.Map Int (RateInfo, Opcode)++type Opcode = (String, [Cs.ArgIn])++data RateInfo = ZeroOut+ | SingleOut Cs.Rate+ | MultiOut (Purity La.Label) Int [Cs.Rate]+ deriving (Show, Eq, Ord)++data SubstExpr = SubstExpr + { lineNum :: Int+ , argOut :: Maybe Cs.ArgOut+ , rateInfo :: RateInfo+ , body :: Opcode+ } deriving (Show)+++ppSubstExpr x = "(" ++ (show $ lineNum x) ++ "," ++ (show $ argOut x) ++ "," ++ (show $ body x)++rates = exprType . exprTag . layerOp+op = exprOp . exprTag . layerOp++++eliminateAssignment :: [ExprLayer Int LaExpr Int] -> [SubstExpr]+eliminateAssignment xs = filter (flip elem ids . lineNum) ys+ where (ys, (ids, _)) = runState (mapM stateFun xs) ([], M.empty)+ stateFun x = State $ \(ids, m) -> substFun x ids m ++substFun :: ExprLayer Int LaExpr Int + -> [Int] -> SubstTable + -> (SubstExpr, ([Int], SubstTable))+substFun x is m+ | isArgOut x = (SubstExpr id (aoArgOut x) (aoRateInfo m x) (aoBody m x),+ (id : is, m))+ | La.isVal $ op x = (SubstExpr id (valArgOut x) (valRateInfo x) (valBody x), + (is, M.insert id (valSubstTableValue x) m))+ | La.isParam $ op x = (SubstExpr id (paramArgOut x) (paramRateInfo x) (paramBody x),+ (is, M.insert id (paramSubstTableValue x) m))+ | La.isArg $ op x = (SubstExpr id (aiArgOut x) (aiRateInfo x) (aiBody x),+ (is, M.insert id (aiSubstTableValue x) m))+ | La.isOpr $ op x = (SubstExpr id (oprArgOut x) (oprRateInfo x) (oprBody m x), + (is ++ oprIds m x, M.insert id (oprSubstTableValue m x) m))+ | La.isOpc $ op x = (SubstExpr id (opcArgOut x) (opcRateInfo x) (opcBody m x),+ (is ++ opcIds m x, M.insert id (opcSubstTableValue m x) m))+ where id = layerOut x+++-- val++valArgOut x = Just $ numArgName Cs.I (layerOut x)+valRateInfo x = SingleOut Cs.I+valBody x = ("=", [Cs.ArgInValue $ toValue $ La.value $ op x])++valSubstTableValue x = (valRateInfo x, valBody x)++-- param++paramArgOut x = Just $ numArgName Cs.I (layerOut x)+paramRateInfo x = SingleOut Cs.I+paramBody x = ("=", [Cs.ArgInParam $ Cs.Param $ La.paramId $ op x])++paramSubstTableValue x = (paramRateInfo x, paramBody x)++-- argOut++aoArgOut x = Just $ strArgName (toCsRate $ La.argRate $ op x) (La.argName $ op x)+aoRateInfo m x = fst $ m M.! aoArgInId x+aoBody m x = snd $ m M.! aoArgInId x ++aoArgInId = head . layerIn++-- argIn++aiArgOut x = Just $ numArgName (toCsRate $ head $ rates x) (layerOut x)+aiRateInfo x = SingleOut $ toCsRate $ head $ rates x+aiBody x = ("=", [Cs.ArgInName $ strArgName (toCsRate $ La.argRate $ op x) (La.argName $ op x)])++aiSubstTableValue x = (aiRateInfo x, aiBody x)++-- opr++oprArgOut x = Just $ numArgName (toCsRate $ head $ rates x) (layerOut x)+oprRateInfo x = SingleOut $ toCsRate $ head $ rates x+oprBody m x = ("=", [Cs.ArgInOpr (La.oprName $ op x) (toOprType $ La.oprType $ op x) args])+ where args = map (substArg m) $ layerIn x++oprSubstTableValue m x = (oprRateInfo x, oprBody m x)++oprIds m x = filter (not . isSubstId m) $ layerIn x++-- opc++opcArgOut x = case (rates x) of+ [] -> Nothing+ (r:[]) -> Just $ numArgName (toCsRate $ r) (layerOut x)+ rs -> let i = exprOutPort $ layerOp x+ in Just $ numArgName (toCsRate $ rs !! i) (layerOut x)+opcRateInfo x = case (rates x) of+ [] -> ZeroOut+ (r:[]) -> SingleOut (toCsRate r)+ rs -> MultiOut (exprPurity $ layerOp x) + (exprOutPort $ layerOp x) + (map toCsRate rs)+opcBody m x = (La.opcName $ op x, map (substArg m) $ layerIn x)++opcSubstTableValue m x = (opcRateInfo x, opcBody m x)++opcIds m x = case (rates x) of+ [] -> outId : inIds+ _ -> inIds+ where inIds = filter (not . isSubstId m) $ layerIn x+ outId = layerOut x++-- subst args++substArg :: SubstTable -> Int -> Cs.ArgIn+substArg m id = + case m M.! id of+ (SingleOut r, (opc, as)) -> if opc == "="+ then head as+ else Cs.ArgInName $ numArgName r id+ (MultiOut _ i rs, _) -> Cs.ArgInName $ numArgName (rs !! i) id+++isSubstId :: SubstTable -> Int -> Bool+isSubstId m id = + case m M.! id of+ (SingleOut r, (opc, as)) -> opc == "="+ _ -> False++--++numArgName :: Cs.Rate -> Int -> Cs.ArgName+numArgName rate id = Cs.ArgName rate (show id)+++strArgName :: Cs.Rate -> String -> Cs.ArgName+strArgName rate name = case rate of+ Cs.SetupRate -> Cs.ArgName rate name+ _ -> Cs.ArgName rate ("x" ++ name)+ +
+ src/CsoundExpr/Translator/Cs/CsTree.hs view
@@ -0,0 +1,301 @@+{-# LANGUAGE + MultiParamTypeClasses, + TypeSynonymInstances, + FlexibleContexts #-}++module CsoundExpr.Translator.Cs.CsTree (+ -- types+ CsTree, + Rate(..), CsExpr(..),+ Value(..), OprType(..), Ftable(..), GEN(..), Name, Label,+ -- constructors+ opc, oprPrefix, oprInfix,+ int, double, string, ftable, param,+ argIn, argOut,+ -- predicates+ isArg, isFtable,+ isVal, isOpc, isOpr, isParam, isString,+ equalStructure, equalStructureByParams, + -- selectors+ toFtable, ftableGENArgs, ftableSize, ftableGENId, getFtable, + mapFtable, toDouble, opcName, oprName, oprType, paramId, value, + argName, argRate+ )+where++import Data.Function++import CsoundExpr.Translator.ExprTree.ExprTree +import CsoundExpr.Translator.ExprTree.Tree+import CsoundExpr.Translator.Cs.IM+import CsoundExpr.Translator.Cs.Utils+import CsoundExpr.Translator.ExprTree.Tree++-----------------------------------------------+-- types++type CsTree = ExprTree Label Rate CsExpr+++data Rate = A | K | I | S | GA | GK | GI | GS | SetupRate+ deriving (Show, Eq, Ord)++data CsExpr = Val Value+ | Param Id+ | Arg Rate Name+ | Opc Name+ | Opr Name OprType+ deriving (Show, Eq, Ord)+++data Value = ValueInt Int+ | ValueDouble Double+ | ValueString String+ | ValueFtable Ftable+ deriving (Show, Eq, Ord)++data OprType = Infix | Prefix+ deriving (Show, Eq, Ord)+++data Ftable = EmptyFtable+ | Ftable Size GEN+ deriving (Show, Eq, Ord)++data GEN = GEN Id [CsTree]+ deriving (Show, Eq, Ord)++++--type Id = Int+--type Size = Int++type Name = String+type Label = Int++------------------------------------------+-- instances++instance IM CsTree CsTree where+ from = id+ to = id++-----------------+-- Lists++val :: CsExpr -> CsTree+val x = pure x []++param :: IM CsTree a => Id -> a+param = from . val . Param++int :: IM CsTree a => Int -> a+int = from . val . Val . ValueInt++double :: IM CsTree a => Double -> a+double = from . val . Val . ValueDouble++ftable :: IM CsTree a => Ftable -> a+ftable = from . val . Val . ValueFtable++string :: IM CsTree a => String -> a+string = from . mapType (const [S]) . val . Val . ValueString+++argIn :: IM CsTree a => Rate -> Name -> a+argIn rate = from . val . Arg rate++argOut :: IM CsTree a => Rate -> Name -> a -> CsTree+argOut rate name = mapType (const [rate]) . pure' (Arg rate name) . return . to+ where pure' :: CsExpr -> [CsTree] -> CsTree+ pure' = pure+ ++------------------------------++opc :: Name -> CsExpr+opc = Opc ++oprPrefix :: Name -> CsExpr+oprPrefix = flip Opr Prefix++oprInfix :: Name -> CsExpr+oprInfix = flip Opr Infix++------------------------------------------+-- CsTree Selectors++mapFtable :: (Ftable -> Ftable) -> CsTree -> CsTree+mapFtable f = mapTag (mapSnd $ phi f)+ where phi f x = case x of+ (Val (ValueFtable x)) -> Val (ValueFtable $ f x)+ _ -> error "value is not ftable"++getFtable :: CsTree -> Ftable+getFtable = select . exprOp . exprTreeTag+ where select x = case x of+ (Val (ValueFtable x)) -> x+ _ -> error "value is not ftable"++-----------------------------------------------------------+-- CsExpr selectors++paramId :: CsExpr -> Id+paramId x = case x of+ (Param x) -> x+ _ -> error "expr is no Param" +++value :: CsExpr -> Value+value x = case x of+ (Val x) -> x+ _ -> error "expr is no Val" +++opcName :: CsExpr -> Name+opcName x = case x of+ (Opc x) -> x+ _ -> error "expr is no Opc" ++oprName :: CsExpr -> Name+oprName x = case x of+ (Opr x _) -> x+ _ -> error "expr is no Opr" ++oprType :: CsExpr -> OprType+oprType x = case x of+ (Opr _ x) -> x+ _ -> error "expr is no Opr" +++argName :: CsExpr -> Name+argName x = case x of+ (Arg _ x) -> x+ _ -> error "expr is not Arg"+ ++argRate :: CsExpr -> Rate+argRate x = case x of+ (Arg x _) -> x+ _ -> error "expr is not Arg"+++ +-------------------------------------------------+--++ftableSize :: Ftable -> Size+ftableSize x = case x of+ EmptyFtable -> 0+ (Ftable x _) -> x++ftableGENId :: Ftable -> Id+ftableGENId x = case x of+ EmptyFtable -> 0+ (Ftable _ (GEN x _ )) -> x++ftableGENArgs :: Ftable -> [CsTree]+ftableGENArgs x = case x of+ EmptyFtable -> []+ (Ftable _ (GEN _ ts)) -> ts++--------------------------------------------------+++--------------------------------------------------+-- predicates+++isParam :: CsExpr -> Bool+isParam x = case x of+ (Param _) -> True+ _ -> False++isVal :: CsExpr -> Bool+isVal x = case x of+ (Val _) -> True+ _ -> False+++isOpc :: CsExpr -> Bool+isOpc x = case x of+ (Opc _) -> True+ _ -> False++isOpr :: CsExpr -> Bool+isOpr x = case x of+ (Opr _ _) -> True+ _ -> False++isArg :: CsExpr -> Bool+isArg x = case x of+ (Arg _ _) -> True+ _ -> False++-------------+-- value predicates++isFtable :: Value -> Bool+isFtable x = case x of + (ValueFtable _) -> True+ _ -> False+++toFtable :: Value -> Ftable+toFtable x = case x of+ (ValueFtable q) -> q+ _ -> error "value is not ftable"+++isDouble :: Value -> Bool+isDouble x = case x of+ ValueDouble q -> True+ _ -> False++toDouble :: Value -> Maybe Double+toDouble x = case x of+ ValueDouble q -> Just q+ _ -> Nothing ++isString :: Value -> Bool+isString x = case x of + (ValueString _) -> True+ _ -> False++++----------------------+-- tree predicates+++equalStructure :: CsTree -> CsTree -> Bool+equalStructure = equalTreeStructureBy pred+ where pred a b+ | isVal' a && isVal' b = eqVal a b+ | otherwise = a == b+ isVal' = isVal . exprOp . exprTag+ value' = value . exprOp . exprTag+ eqVal = equalValueStructure `on` value' ++equalStructureByParams :: CsTree -> CsTree -> Bool+equalStructureByParams = equalTreeStructureBy pred+ where pred a b+ | isVal' a && isVal' b = eqVal a b + | isParam' a && isVal' b && paramId' a > 3 = True+ | isVal' a && isParam' b && paramId' b > 3 = True+ | otherwise = a == b+ isVal' = isVal . exprOp . exprTag+ value' = value . exprOp . exprTag+ isParam' = isParam . exprOp . exprTag+ paramId' = paramId . exprOp . exprTag+ eqVal = equalValueStructure `on` value' +++equalValueStructure :: Value -> Value -> Bool+equalValueStructure a b = + case (a, b) of + ((ValueInt _) , (ValueInt _)) -> True+ ((ValueString _), (ValueString _)) -> True+ ((ValueDouble _), (ValueDouble _)) -> True+ ((ValueFtable _), (ValueFtable _)) -> True+ _ -> False
+ src/CsoundExpr/Translator/Cs/CsoundFile.hs view
@@ -0,0 +1,327 @@+module CsoundExpr.Translator.Cs.CsoundFile (+ CsoundFile(..),+ Flags, Orchestra(..), Scores(..),+ Value(..), Rate(..), ArgName(..), Param(..),+ Header(..), Instr(..), OpcodeExpr(..), ArgOut, ArgIn(..), OprType(..),+ Ftable(..), FtableInits(..), GEN(..), TotalDuration(..), Note(..), NoteInits(..),+ defTempo+)+where++import Data.Char+import Data.List+import qualified Data.Map as Map+import Text.PrettyPrint++-----------------------------------------------------------+-----------------------------------------------------------+-- types++-- | csound code+data CsoundFile = CsoundFile Flags Orchestra Scores++-- | csound flags+type Flags = String+data Orchestra = Orchestra Header [Instr]+data Scores = Scores [Ftable] Tempo TotalDuration [Note]++-- basic types+type Id = Int++data Value = ValueInt Int+ | ValueDouble Double+ | ValueString String+ deriving (Eq, Ord)++data Rate = SetupRate | A | K | I | S | GA | GK | GI | GS+ deriving (Eq, Ord)++type Name = String+data ArgName = ArgName Rate Name+ deriving (Eq, Ord)+data Param = Param Id+ deriving (Eq, Ord)++-- Orchestra subtypes+newtype Header = Instr0 [OpcodeExpr]++data Instr = Instr Id [OpcodeExpr]++data OpcodeExpr = OpcodeExpr [ArgOut] Name [ArgIn]+ deriving (Show)+type ArgOut = ArgName+data ArgIn = ArgInName ArgName+ | ArgInParam Param+ | ArgInValue Value+ | ArgInOpr Name OprType [ArgIn]+ deriving (Eq, Ord)++data OprType = Infix | Prefix+ deriving (Eq, Ord)++-- Scores subtypes+data Ftable = Ftable Id FtableInits GEN++data FtableInits = FtableInits LoadTime NumOfPoints++type LoadTime = Double+type NumOfPoints = Int++data GEN = GEN Id [Value]++newtype Tempo = Tempo [Double]++newtype TotalDuration = TotalDuration Double++data Note = Note Id NoteInits [Value]++data NoteInits = NoteInits StartTime Duration+type StartTime = Double+type Duration = Double++-----------------------------------------------------------+-----------------------------------------------------------+-- defaults++defTempo = Tempo []++-----------------------------------------------------------+-----------------------------------------------------------+-- pretty printing around+++nlines n = foldl1 ($$) $ take n $ repeat $ text ""+commentSection s = + (text "; -------------------------------") $$ + (text $ "; " ++ s)+++-----------------------------------------------------------+-----------------------------------------------------------+-- rates++instance Show Rate where+ show x = case x of+ SetupRate -> ""+ A -> "a"+ K -> "k"+ I -> "i"+ S -> "S"+ GA -> "ga"+ GK -> "gk"+ GI -> "gi" + GS -> "gS"++-----------------------------------------------------------+-----------------------------------------------------------+-- .CSD file++instance Show CsoundFile where+ show (CsoundFile flags orc sco) = show $+ flagsHeader $$+ (text flags) $$+ orchestraHeader $$+ (text $ show orc) $$ + scoresHeader $$+ (text $ show sco) $$ + finHeader+ where nlineOffset = 2++----------------------------------------------------------- +-----------------------------------------------------------+-- headers for .CSD file++-- <CsoundSynthesizer>+-- <CsOptions>+flagsHeader = + text "<CsoundSynthesizer>" $$ + text "<CsOptions>"++-- </CsOptions>+-- <CsInstruments>+orchestraHeader = + text "</CsOptions>" $$+ text "<CsInstruments>"++-- </CsInstruments>+-- <CsScore>+scoresHeader = + text "</CsInstruments>" $$+ text "<CsScore>"++-- </CsScore>+-- </CsoundSynthesizer>+finHeader = + text "</CsScore>" $$+ text "</CsoundSynthesizer>"++-----------------------------------------------------------+-----------------------------------------------------------+-- .ORC file++instance Show Orchestra where + show (Orchestra header instrs) = show $+ (commentSection "Header") $$+ (text $ show header) $$ + nlines (2*nlineOffset) $$+ (commentSection "Instruments") $$+ (vcat $ + map ((nlines nlineOffset <>) . text . show) instrs) $$+ nlines (2*nlineOffset)+ where nlineOffset = 1+++-----------------------------------------------------------+-----------------------------------------------------------+-- .SCO file++instance Show Scores where+ show (Scores ftables tempo totalDuration notes) = show $+ (commentSection "Ftables") $$+ (text $ show totalDuration) $$+ (vcat $ map (text . show) ftables) $$+ (nlines (2*nlineOffset)) $$+ (commentSection "Tempo") $$+ (text $ show tempo) $$+ (nlines (2*nlineOffset)) $$+ (commentSection "Notes") $$+ (vcat $ map (text . show) notes) $$+ (nlines nlineOffset) $$+ (text "e") $$+ (nlines (2*nlineOffset)) + where nlineOffset = 1+ + +----------------------------------------------------+----------------------------------------------------+-- flags section++----------------------------------------------------+----------------------------------------------------+-- orchestra section (header, intruments)++----------------------------------------------------+-- header section++instance Show Header where+ show (Instr0 []) = ""+ show (Instr0 opcodes) = show $ empty $$ align lines $$ empty+ where lines = map opcodeExprToLine opcodes ++----------------------------------------------------+-- instrument section++instance Show Instr where+ show (Instr id opcodes) = show $ space $$ align lines $$ space+ where lines = firstLine ++ body ++ lastLine+ firstLine = [("", "instr", show id)]+ lastLine = [("", "endin", "")]+ body = map opcodeExprToLine opcodes++align :: [(String, String, String)] -> Doc+align lines = foldl1 ($$) $ map (f indent1 indent2) lines+ where offset = 3+ indent1 = offset + maximum [length x | (x, _, _) <- lines]+ indent2 = offset + maximum [length x | (_, x, _) <- lines]+ f n1 n2 (x1, x2, x3) = + text x1 $$ + nest (n1) (text x2) $$+ nest (n1+n2) (text x3)++opcodeExprToLine :: OpcodeExpr -> (String, String, String)+opcodeExprToLine (OpcodeExpr argsOut opcode argsIn) = + (argsToLine argsOut, opcode, argsToLine argsIn)+ where+ argsToLine :: Show a => [a] -> String+ argsToLine = show . hcat . + punctuate (comma <> space) . map (text . show) ++instance Show ArgName where+ show (ArgName rate name) = show rate ++ name++instance Show Param where+ show (Param id) = "p" ++ show id++instance Show Value where+ show (ValueString s) = show s+ show (ValueInt x) = show x+ show (ValueDouble x) = show x+++instance Show ArgIn where+ show (ArgInName x) = show x+ show (ArgInParam x) = show x+ show (ArgInValue x) = show x+-- operators+ show (ArgInOpr op opType xs) = printOperator op opType xs+-- if (Map.member op operators)+-- then +-- else error "no such operator"+ +printOperator :: Name -> OprType -> [ArgIn] -> String+printOperator op desc args = + case desc of+ Prefix -> show $ opStr <> (parens $ hcat $ argsStr) + Infix -> show $ parens $ hcat $ punctuate space [arg1Str, opStr, arg2Str]+ where opStr = text op+ argsStr = punctuate (comma <> space) $ map (text . show) args+ (arg1Str, arg2Str) = + if length args == 1+ then (text "", parens $ text $ show $ head args)+ else (text $ show (args !! 0), text $ show (args !! 1))+ ++----------------------------------------------------+----------------------------------------------------+-- scores section++----------------------------------------------------+-- ftable section++instance Show Ftable where+ show (Ftable id inits gen) = show $+ (text "f") <+> + int id <+>+ (text $ show inits) <+>+ (text $ show gen)+++instance Show FtableInits where+ show (FtableInits loadTime numOfPoints) = show $ + (text $ show loadTime) <+>+ (text $ show numOfPoints) ++instance Show GEN where+ show (GEN id vals) = show $ int id <+>+ (foldl1 (<+>) $ map (text . show) vals)++----------------------------------------------------+-- tempo ++instance Show Tempo where+ show (Tempo []) = ""+ show (Tempo vals) = show $ + text "t" <+> + (foldl1 (<+>) $ map double vals)+++----------------------------------------------------+-- total duration++instance Show TotalDuration where+ show (TotalDuration t) = show $ text "f 0" <+> double t++----------------------------------------------------+-- notes++instance Show Note where+ show (Note id noteInits vals) = show $ inits <+> aux+ where+ inits = text "i" <+> int id <+> (text $ show noteInits)+ aux = if (length vals == 0)+ then text "" + else foldl1 (<+>) $ map (text . show) vals++instance Show NoteInits where+ show (NoteInits start duration) = show $ + double start <+> double duration
+ src/CsoundExpr/Translator/Cs/IM.hs view
@@ -0,0 +1,8 @@+{-# LANGUAGE MultiParamTypeClasses #-}++module CsoundExpr.Translator.Cs.IM (IM(..)) +where++class IM a b where+ from :: a -> b+ to :: b -> a
+ src/CsoundExpr/Translator/Cs/Utils.hs view
@@ -0,0 +1,37 @@+module CsoundExpr.Translator.Cs.Utils + (mapFst, mapSnd, thd, + liftPredicateToList, + unionSorted, unionSortedBy)+where++mapFst :: (a -> a') -> (a, b) -> (a', b)+mapFst f (a, b) = (f a, b)++mapSnd :: (b -> b') -> (a, b) -> (a, b')+mapSnd f (a, b) = (a, f b)++thd (_, _, a) = a++liftPredicateToList :: (a -> b -> Bool) -> ([a] -> [b] -> Bool)+liftPredicateToList f xs ys+ | length xs == length ys = all (uncurry f) $ zip xs ys+ | otherwise = False+++unionSorted :: Ord a => [a] -> [a] -> [a]+unionSorted x1 x2 = case (x1, x2) of+ ([] , ys) -> ys+ (xs , []) -> xs+ ((x:xs) ,(y:ys)) -> if x < y+ then x : unionSorted xs x2+ else y : unionSorted x1 ys+++unionSortedBy :: (a -> a -> Ordering) -> [a] -> [a] -> [a]+unionSortedBy cmp x1 x2 = + case (x1, x2) of+ ([] , ys) -> ys+ (xs , []) -> xs+ ((x:xs) ,(y:ys)) -> if cmp x y == LT+ then x : unionSortedBy cmp xs x2+ else y : unionSortedBy cmp x1 ys
+ src/CsoundExpr/Translator/Csd.hs view
@@ -0,0 +1,98 @@+module CsoundExpr.Translator.Csd+ (toCsd, ppCsTrees, toNotes)+where++import Text.PrettyPrint+import Temporal.Media(EventList, Temporal(..))+++import qualified CsoundExpr.Translator.Cs.CsTree as La+import qualified CsoundExpr.Translator.Cs.CsoundFile as Cs++import CsoundExpr.Translator.Types++import CsoundExpr.Translator.Header+import CsoundExpr.Translator.Instr+import CsoundExpr.Translator.Ftable+import CsoundExpr.Translator.Score+import CsoundExpr.Translator.InstrOrder++import qualified Data.Map as Map++import Debug.Trace+debug x = trace (show $ map snd $ Map.toList x) x++---------------------------------------------------------------+---------------------------------------------------------------+-- translate to csd file+++toCsd :: Cs.Flags -> [SignalInit] -> EventList Dur SignalOut -> Cs.CsoundFile+toCsd flags inits scores = Cs.CsoundFile flags orc sco+ where orc = Cs.Orchestra header instrs+ sco = Cs.Scores fTabs Cs.defTempo tDur notes+ header = toHeader iTab inits (setFtablesInInstr ftInfo instr0)+ instrs = map toInstr q1+ notes = ( >>= toNotes) q2+ (q1, q2) = setInstrIds ids ps+ ps = substFtables ftInfo qs+ ids = instrIds iTab $ map fst qs+ iTab = instrOrderInfo order $ map fst qs+ fTabs = toCsFtables ftInfo+ ftInfo = getFtableInfo qs instr0+ qs = foldScores scores' ++ (zip midi $ repeat [])+ tDur = Cs.TotalDuration $ dur scores + scores' = fmap fromSignalOut scores+ (instr0, midi, order) = parseInits inits+++---------------------------------------------------------------+---------------------------------------------------------------+-- ftables++getFtableInfo :: [(Instr, [Note])] -> Instr -> FtableInfo+getFtableInfo as instr0 = + ftableInfo $ (getFtablesFromInstr =<< instrs1) +++ ((getFtablesFromNote =<<) =<< notes1) +++ (getFtablesFromInstr instr0)+ where (instrs1, notes1) = unzip as+++substFtables :: FtableInfo -> [(Instr, [Note])] -> [(Instr, [Note])]+substFtables ftInfo x = zip instrs' notes'+ where instrs' = map (setFtablesInInstr ftInfo) instrs+ notes' = map (map (setFtablesInNote ftInfo)) notes+ (instrs, notes) = unzip x+ ++substFtablesInInstr :: Instr -> (Instr, [Cs.Ftable])+substFtablesInInstr x = (x', toCsFtables ftInfo)+ where x' = setFtablesInInstr ftInfo x+ ftInfo = ftableInfo $ getFtablesFromInstr x+++---------------------------------------------------------------+---------------------------------------------------------------+-- translate notes++toNotes :: (Id, [Note]) -> [Cs.Note]+toNotes (id, xs) = map (toNote id) xs+ where toNote id (t, d, vs) = Cs.Note id (Cs.NoteInits t d) $ map (toValue . snd) vs+++---------------------------------------------------------------+---------------------------------------------------------------+-- prettyPrint trees++ +ppCsTrees :: [La.CsTree] -> Doc+ppCsTrees x = vcat [opcTitle, opcs, space, ftableTitle, ftables, space, space]+ where opcs = text $ show $ Cs.Instr0 $ toOpcodeExpr ts+ ftables = vcat $ map (text . show) fts + (ts, fts) = substFtablesInInstr x+++opcTitle = text "; opcodes" +ftableTitle = text "; ftables"++
+ src/CsoundExpr/Translator/ExprTree/ExprTree.hs view
@@ -0,0 +1,87 @@+module CsoundExpr.Translator.ExprTree.ExprTree + (+ -- types+ ExprTree, Expr, OutPort, Purity(..), Id, Size, Tag,+ -- constructors+ pure, unpure, outPort, singlePort,+ -- modifiers+ labelUnpure, mapRootLabel, mapTag, mapOp, mapType, mapPurity, mapPort,+ -- selectors+ exprTreeTag, exprTag, exprPurity, exprOutPort, exprOp, exprType+ ) +where++import CsoundExpr.Translator.Cs.Utils+import CsoundExpr.Translator.ExprTree.Tree+++type ExprTree a b c = Tree (Expr a b c)++data Expr a b c = Expr OutPort (Purity a) (Tag b c)+ deriving (Show, Eq, Ord)++type OutPort = Id++data Purity a = Pure | Unpure (Maybe a)+ deriving (Show, Eq, Ord)++type Tag a b = (Types a, Op b)+type Types a = [a]+type Op a = a++type Id = Int+type Size = Int+++pure :: Op c -> [ExprTree a b c] -> ExprTree a b c+pure f xs = Node (Expr singlePort Pure ([], f)) xs++unpure :: Op c -> [ExprTree a b c] -> ExprTree a b c+unpure f xs = Node (Expr singlePort (Unpure Nothing) ([], f)) xs+++outPort :: Int -> ExprTree a b c -> ExprTree a b c+outPort id = mapPort (const id) ++singlePort = 0++labelUnpure :: a -> ExprTree a b c -> ExprTree a b c+labelUnpure lab = mapPurity (const $ Unpure $ Just lab)+++mapRootLabel :: (a -> a) -> Tree a -> Tree a+mapRootLabel f (Node v xs) = Node (f v) xs+++mapTag :: (Tag b c -> Tag b c) -> ExprTree a b c -> ExprTree a b c+mapTag f = mapRootLabel $ \(Expr o p x) -> (Expr o p (f x))+++mapType :: (Types b -> Types b) -> ExprTree a b c -> ExprTree a b c+mapType f = mapTag $ mapFst f++mapOp :: (Op c -> Op c) -> ExprTree a b c -> ExprTree a b c+mapOp f = mapTag $ mapSnd f++mapPurity :: (Purity a -> Purity a) -> ExprTree a b c -> ExprTree a b c+mapPurity f = mapRootLabel $ \(Expr o p x) -> (Expr o (f p) x)+++mapPort :: (OutPort -> OutPort) -> ExprTree a b c -> ExprTree a b c+mapPort f = mapRootLabel $ \(Expr o p x) -> (Expr (f o) p x)++-------------------------------------------------------+-- selectors++exprTreeTag :: ExprTree a b c -> Tag b c+exprTreeTag (Node (Expr _ _ t) _) = t++exprTag (Expr _ _ t) = t+exprPurity (Expr _ p _) = p+exprOutPort (Expr x _ _) = x+++exprType = fst+exprOp = snd++
+ src/CsoundExpr/Translator/ExprTree/Tree.hs view
@@ -0,0 +1,74 @@+module CsoundExpr.Translator.ExprTree.Tree + (Tree(..),+ treeVal, treeChilds, subTree,+ substTreeByFunc, substTreeById,+ foldTree, toIdList, + equalTreeStructureBy)+where++import Text.PrettyPrint++data Tree a = Node a [Tree a]+ deriving (Eq, Ord)++ppTree :: Show a => Tree a -> Doc+ppTree (Node a xs) = text "Node" <+> (text $ show a) $+$ + nest 4 (vcat $ map ppTree xs)++instance Show a => Show (Tree a) where+ show t = show $ ppTree t+++treeVal :: Tree a -> a+treeVal (Node x _) = x++treeChilds :: Tree a -> [Tree a]+treeChilds (Node _ xs) = xs+++substTreeByFunc :: (Tree a -> Maybe (Tree a)) -> Tree a -> Tree a+substTreeByFunc f t@(Node a ts) = + case f t of+ (Just x) -> substTreeByFunc f x+ Nothing -> (Node a $ map (substTreeByFunc f) ts)++++foldTree :: (a -> b -> a) -> a -> Tree b -> a+foldTree f s (Node a ts) = foldl (foldTree f) (f s a) ts+++toIdList :: Tree a -> [([Int], a)]+toIdList = f []+ where f ids (Node a as) = ((ids, a) : ) $+ concat [f (ids ++ [i]) x | (i, x) <- zip [0..] as]+ + +substTreeById :: [Int] -> Tree a -> Tree a -> Tree a+substTreeById id subtree tree = + case id of + [] -> subtree+ xs -> substTreeById (init id) newSubtree tree+ where newSubtree = + let s = subTree (init id) tree+ x = treeChilds s+ n = last id+ in Node (treeVal s) $ + (take n x) ++ [subtree] ++ (drop (n+1) x)+++subTree :: [Int] -> Tree a -> Tree a+subTree id tree = + case id of+ [] -> tree+ (x:xs) -> subTree xs (treeChilds tree !! x)++++equalTreeStructureBy :: (a -> a -> Bool) -> Tree a -> Tree a -> Bool+equalTreeStructureBy pred (Node a as) (Node b bs) + | pred a b = if length as == length bs+ then all (uncurry $ equalTreeStructureBy pred) $ zip as bs+ else False+ | otherwise = False+
+ src/CsoundExpr/Translator/ExprTree/TreeSeq.hs view
@@ -0,0 +1,123 @@+module CsoundExpr.Translator.ExprTree.TreeSeq + (adjList, reduceAdjList, + adjLists, reduceAdjLists+ ) +where++import Control.Monad.State+import qualified Data.Map as M++import CsoundExpr.Translator.ExprTree.Tree+++numOfChildsList :: Tree a -> [(a, Int)]+numOfChildsList (Node a xs) = (a, length xs) : (numOfChildsList =<< xs)++type TreeLayer a b = (a, (b, [Int]))+mkLayer a b c = (a, (b, c))+ ++adjList :: Int -> [Tree a] -> [TreeLayer Int a]+adjList s = fst . foldl f ([], s)+ where f (res, id) t = let xs = fst $ runState (adjList' id t) id+ ys = reverse xs+ in (res ++ ys, nextId ys)+ nextId (x:xs) = 1 + layerOut x+++reduceAdjList :: Ord a => [TreeLayer Int a] -> [TreeLayer Int a]+reduceAdjList xs = fst $ runState (foldM reduceAdjList' [] xs) (0, M.empty, M.empty)+++adjLists :: Int -> [Tree a] -> [(TreeLayer Int a, [TreeLayer Int a])]+adjLists s = fst . foldl f ([], s)+ where f (res, id) t = let (x:xs) = fst $ runState (adjList' id t) id+ ys = reverse xs+ in (res ++ [(x, ys)], nextId x ys)+ nextId x xs = (1 + ) $ layerOut $ + case xs of+ [] -> x+ _ -> head xs+++reduceAdjLists :: Ord a => + [(TreeLayer Int a, [TreeLayer Int a])]+ -> [TreeLayer Int a] +reduceAdjLists = fst . foldl f ([], (0, M.empty, M.empty))+ where f (res, s) (lastStm, x) = + registerLastStm lastStm $ + runState (foldM reduceAdjList' res $ x) s+++++adjList' :: Int -> Tree a -> State Int [TreeLayer Int a]+adjList' root (Node a xs) = + State $ \s -> let s' = nextId s+ xs' = zip (ids s) xs+ vs = fst $ runState (foldM foldAdjList [] xs') s'+ in (mkLayer root a (ids s) : vs, s')+ where ids x = [x + 1 .. x + n]+ nextId x = x + n + 1+ n = length xs + foldAdjList x y = liftM (x ++) $ (uncurry adjList') y++layerOut = fst+layerOp = fst . snd+layerIns = snd . snd+++type LayerNode a = (a, [Int])+type TableNode a = M.Map (LayerNode a) Int+type TableId = M.Map Int Int+type RegisterData a = (Int, TableNode a, TableId)+++reduceAdjList' :: + Ord a => [TreeLayer Int a]+ -> TreeLayer Int a+ -> State (RegisterData a) [(TreeLayer Int a)]+reduceAdjList' res x = + State $ \s@(id, mNodes, mIds) -> + let k = (layerOp x, map (mIds M.! ) $ layerIns x)+ in case (M.lookup k mNodes) of+ Nothing -> registerNewNode (layerOut x) k (res, s)+ (Just i) -> registerNewId (layerOut x) i (res, s)+++registerNewNode :: Ord a => Int -> LayerNode a + -> ([TreeLayer Int a], RegisterData a) + -> ([TreeLayer Int a], RegisterData a)+registerNewNode i k (res, (id, mNodes, mIds)) = + (res ++ [(id, k)], (id+1, M.insert k id mNodes, M.insert i id mIds))+++registerNewId :: Ord a => Int -> Int+ -> ([TreeLayer Int a], RegisterData a) + -> ([TreeLayer Int a], RegisterData a)+registerNewId x i (res, (id, mNodes, mIds)) = + (res, (id, mNodes, M.insert x i mIds))++++registerLastStm :: Ord a => + TreeLayer Int a+ -> ([TreeLayer Int a], RegisterData a) + -> ([TreeLayer Int a], RegisterData a)+registerLastStm lastStm (res, (id, mNodes, mIds)) =+ (res ++ [(id, k)],(+ id + 1,+ dropLastStm lastStm mNodes, + M.insert (layerOut lastStm) id mIds+ )+ )+ where k = (layerOp lastStm, map (mIds M.! ) $ layerIns lastStm)+++dropLastStm :: Ord a => TreeLayer Int a + -> TableNode a -> TableNode a+dropLastStm lastStm = + M.filterWithKey (\k _ -> (/= layerOp lastStm) $ fst k)+ + +
+ src/CsoundExpr/Translator/Ftable.hs view
@@ -0,0 +1,110 @@+module CsoundExpr.Translator.Ftable + (toCsFtables, + ftableInfo,+ getFtablesFromInstr, getFtablesFromNote,+ setFtablesInInstr, setFtablesInNote) +where++import Data.List+import qualified Data.Map as Map++import CsoundExpr.Translator.ExprTree.Tree+import CsoundExpr.Translator.ExprTree.ExprTree+import CsoundExpr.Translator.Cs.Utils++import qualified CsoundExpr.Translator.Cs.CsTree as La+import qualified CsoundExpr.Translator.Cs.CsoundFile as Cs++import CsoundExpr.Translator.Types+++substFtablesGen :: (a -> [FtableId]) -> (FtableInfo -> a -> a) ->+ a -> (a, [Cs.Ftable])+substFtablesGen toFtables fromFtables t = (fromFtables fs t, toCsFtables fs)+ where fs = Map.fromList $ zip (addFtempty $ nub $ toFtables t) [0..]+ addFtempty = let ft0 = (Pure, La.EmptyFtable)+ in (ft0 : ) . delete ft0+++--------------------------------------------------------+-- translate ftables++toCsFtables :: FtableInfo -> [Cs.Ftable]+toCsFtables fs = map f $ filter ((/= 0 ) . snd) $ Map.toList fs+ where f ((_, ft), id) = Cs.Ftable id + (Cs.FtableInits 0 (La.ftableSize ft))+ (Cs.GEN (La.ftableGENId ft) $ + map toGens $ La.ftableGENArgs ft)+ toGens (Node a _)+ | isFtable' $ exprOp $ exprTag a = Cs.ValueInt $ fs Map.! (ftableId a)+ | otherwise = toValue $ La.value $ exprOp $ exprTag a++--------------------------------------------------------+-- make ftableInfo++ftableInfo :: [FtableId] -> FtableInfo+ftableInfo = Map.fromList . flip zip [0..] . addFtempty . nub+ where addFtempty = let ft0 = (Pure, La.EmptyFtable)+ in (ft0 : ) . delete ft0+++--------------------------------------------------------+-- extract ftables++getFtablesFromNote :: Note -> [FtableId]+getFtablesFromNote (_, _, x) = (subFtables =<< ) $ map f $ filter (La.isFtable . snd) x+ where f = mapSnd La.toFtable+++getFtablesFromInstr :: Instr -> [FtableId]+getFtablesFromInstr = (getFtablesFromTree =<<)++getFtablesFromTree :: La.CsTree -> [FtableId]+getFtablesFromTree = (subFtables =<< ) . getFtables'+ where getFtables' = map ftableId . filter p . foldTree (flip (:)) []+ p = isFtable' . exprOp . exprTag ++-----------------------------------------------------------+-- substitute ftables++setFtablesInNote :: FtableInfo -> Note -> Note+setFtablesInNote fs (t0, t1, vs) = (t0, t1, map f vs)+ where f x+ | La.isFtable $ snd x = let id = La.ValueInt $ (fs Map.!) $ mapSnd La.toFtable x+ in (fst x, id)+ | otherwise = x+ ++setFtablesInInstr :: FtableInfo -> Instr -> Instr+setFtablesInInstr fs = map (setFtablesInTree fs)+++setFtablesInTree :: FtableInfo -> La.CsTree -> La.CsTree+setFtablesInTree fs = substTreeByFunc (f fs)+ where f fs (Node a _)+ | isFtable' $ exprOp $ exprTag a = Just $ toValueInt fs $ ftableId a+ | otherwise = Nothing++-----------------------------------------------------------+-- aux funs++subFtables :: FtableId -> [FtableId]+subFtables x = (x: ) $ (getFtablesFromTree =<<) $ La.ftableGENArgs $ snd x+++ftableId :: Expr Id La.Rate La.CsExpr -> FtableId+ftableId a = (exprPurity a, La.toFtable $ La.value $ exprOp $ exprTag a)++++isFtable' :: La.CsExpr -> Bool+isFtable' x = if La.isVal x+ then (La.isFtable $ La.value x)+ else False+++toValueInt :: FtableInfo -> FtableId -> La.CsTree+toValueInt fs = mapType (const [La.I]) . La.int . (fs Map.! )+++
+ src/CsoundExpr/Translator/Header.hs view
@@ -0,0 +1,85 @@+module CsoundExpr.Translator.Header+ (toHeader,+ parseInits,+ GlobalInits,+ MidiInstr,+ InstrOrder)+where++import Data.List+import Data.Maybe+import Control.Monad+++import qualified Data.Set as Set+import qualified Data.Map as Map++import qualified CsoundExpr.Translator.Cs.CsTree as La+import qualified CsoundExpr.Translator.Cs.CsoundFile as Cs++import CsoundExpr.Translator.Types+import CsoundExpr.Translator.Instr+import CsoundExpr.Base.Header++---------------------------------------------------------------+---------------------------------------------------------------+-- translate header++toHeader :: InstrOrderInfo -> [SignalInit] -> Instr -> Cs.Header+toHeader order inits instr0 = Cs.Instr0 $ csInstr0 ++ (map f $ filter isMidiAssign inits)+ where f x = + case x of+ (Massign xs id instr) -> assigns "massign" order xs id (fromSignalOut instr)+ (Pgmassign xs id instr) -> assigns "pgmassign" order xs id (fromSignalOut instr)+ g name val = let outs = [Cs.ArgName Cs.SetupRate name]+ ins = [Cs.ArgInValue $ Cs.ValueInt val]+ in Cs.OpcodeExpr outs "=" ins+ assigns name order xs id instr = + let vs = [id, order Map.! instr] ++ xs+ ins = map (Cs.ArgInValue . Cs.ValueInt) vs+ in Cs.OpcodeExpr [] name ins+ csInstr0 = toOpcodeExpr instr0+++---------------------------------------------------------------+---------------------------------------------------------------++parseInits :: [SignalInit] -> (Instr, [MidiInstr], InstrOrder)+parseInits inits = (getInstr0 inits, + getMidiInstrs inits,+ getInstrOrder inits)+++getInstr0 :: [SignalInit] -> Instr+getInstr0 = (fromSignalOut . fromInstr0 =<< ) . filter isInstr0+ where fromInstr0 (Instr0 x) = x+++getMidiInstrs :: [SignalInit] -> [MidiInstr]+getMidiInstrs = map fromSignalOut . ( >>= f)+ where f x = case x of+ Massign _ _ x -> [x]+ Pgmassign _ _ x -> [x]+ _ -> []+++getInstrOrder :: [SignalInit] -> InstrOrder+getInstrOrder = map fromSignalOut . getList . find isInstrOrder+ where getList x = case x of+ (Just (InstrOrder xs)) -> xs+ Nothing -> []+++------------------------------------------------------------++isInstr0 :: SignalInit -> Bool+isInstr0 x = case x of (Instr0 _) -> True+ _ -> False++isInstrOrder :: SignalInit -> Bool+isInstrOrder x = case x of (InstrOrder _) -> True+ _ -> False+++isMidiAssign :: SignalInit -> Bool+isMidiAssign x = not $ isInstr0 x || isInstrOrder x
+ src/CsoundExpr/Translator/Instr.hs view
@@ -0,0 +1,32 @@+module CsoundExpr.Translator.Instr + (toInstr, toOpcodeExpr)+where++import qualified Data.Map as Map++import CsoundExpr.Translator.ExprTree.TreeSeq++import qualified CsoundExpr.Translator.Cs.CsTree as La+import qualified CsoundExpr.Translator.Cs.CsoundFile as Cs++import CsoundExpr.Translator.Types+import CsoundExpr.Translator.AssignmentElimination+import CsoundExpr.Translator.MultiOutsFolding++---------------------------------------------------------------+---------------------------------------------------------------+-- translate intruments+++toInstr :: (Id, Instr) -> Cs.Instr+toInstr (id, x) = Cs.Instr id $ toOpcodeExpr x+++---------------------------------------------------------------+---------------------------------------------------------------+-- translate opcodes +++toOpcodeExpr :: Instr -> [Cs.OpcodeExpr]+toOpcodeExpr = foldMultiOuts . eliminateAssignment . + reduceAdjLists . adjLists 0
+ src/CsoundExpr/Translator/InstrOrder.hs view
@@ -0,0 +1,54 @@+module CsoundExpr.Translator.InstrOrder+ (instrOrderInfo,+ setInstrIds,+ instrIds)+where++import Data.List+import Data.Function+import qualified Data.Map as Map++import Control.Monad.State++import CsoundExpr.Translator.Cs.CsTree+import CsoundExpr.Translator.Cs.Utils+import CsoundExpr.Translator.Types+++import Debug.Trace+debug x = trace (show x) x++setInstrIds :: [Id] -> [(Instr, [Note])] ->+ ([(Id, Instr)], [(Id, [Note])])+setInstrIds ids qs = unzip [((id, q1), (id, q2)) | (id, (q1, q2)) <- xs]+ where xs = sortBy (compare `on` fst) $ zip ids qs +++instrOrderInfo :: InstrOrder -> [Instr] -> InstrOrderInfo+instrOrderInfo xs qs = Map.fromList $ zip (map fst ps') ids+ where ids = resolveCollisions $ map snd ps'+ ps' = sortBy (compare `on` snd) $ + fst $ runState (mapM (f xs) qs) (startId + length xs)+++f :: InstrOrder -> Instr -> State Id (Instr, Id)+f xs q = State $ \s -> case findIndex ((liftPredicateToList equalStructureByParams) q) xs of+ (Just i) -> ((q, startId + i), s)+ Nothing -> ((q, s), s + 1)++++resolveCollisions :: [Int] -> [Int]+resolveCollisions xs = fst $ runState (mapM f xs) (head xs - 1, 0)+ where f x = State $ \(prev, shift) -> + if x + shift == prev+ then (x + shift + 1, (x + shift + 1, shift + 1))+ else (x + shift, (x + shift , shift))+ ++startId :: Id+startId = 33+++instrIds :: InstrOrderInfo -> [Instr] -> [Id]+instrIds f = map (f Map.!)
+ src/CsoundExpr/Translator/MultiOutsFolding.hs view
@@ -0,0 +1,110 @@+module CsoundExpr.Translator.MultiOutsFolding + (foldMultiOuts)+where++import Data.List+import Data.Function+import Data.Maybe++import qualified Data.Map as M++import Control.Monad+import Control.Monad.State+++import CsoundExpr.Translator.AssignmentElimination++import qualified CsoundExpr.Translator.Cs.CsoundFile as Cs+import CsoundExpr.Translator.Cs.Utils++++isMO :: SubstExpr -> Bool+isMO x = case rateInfo x of+ (MultiOut _ _ _) -> True+ _ -> False+++foldMultiOuts :: [SubstExpr] -> [Cs.OpcodeExpr]+foldMultiOuts xs = map snd $ + unionSortedBy (compare `on` fst)+ (map procS s) + (procMOs (length xs) $ sortMOs $ groupMOs m)+ where (m, s) = partition isMO xs+++procS :: SubstExpr -> (Int, Cs.OpcodeExpr)+procS x = (lineNum x, uncurry (Cs.OpcodeExpr $ outs x) $ body x)+ where outs = fromMaybe [] . (liftM (:[])) . argOut+++groupMOs :: [SubstExpr] -> [[SubstExpr]]+groupMOs = groupBy ((==) `on` pred) . sortBy (compare `on` pred)+ where pred x = case rateInfo x of+ MultiOut purity _ rates -> (purity, rates, body x) +++sortMOs :: [[SubstExpr]] -> [(Int, [(Maybe Cs.ArgOut, Cs.Rate)], Opcode)]+sortMOs = (flattenMOs =<< ) . map foldMOs+++data FoldedMO = FoldedMO+ { moLineNum :: Int+ , moPort :: Int+ , moArgOut :: Cs.ArgOut+ } deriving (Show)++foldMOs :: [SubstExpr] -> ([FoldedMO], [Cs.Rate], Opcode)+foldMOs xs = (map outs xs, rates xs, opc xs) + where opc = body . head+ rates x = case rateInfo $ head x of+ MultiOut _ _ rs -> rs+ outs x = case rateInfo x of+ MultiOut _ port _ -> + FoldedMO (lineNum x) port (fromJust $ argOut x)+++flattenMOs :: ([FoldedMO], [Cs.Rate], Opcode) + -> [(Int, [(Maybe Cs.ArgOut, Cs.Rate)], Opcode)]+flattenMOs (xs, rates, opc) = map (\(i, os) -> (i, os, opc)) $ flatten rates xs+ +flatten :: [Cs.Rate] -> [FoldedMO] -> [(Int, [(Maybe Cs.ArgOut, Cs.Rate)])]+flatten rs xs = map (\x -> (formId x, formRates x)) ys+ where formId = minimum . map (fst . fromJust) . filter isJust + formRates = flip zip rs . map (liftM snd) + ys = transpose $ map (getPortVals m k) [0 .. n - 1]+ n = length rs+ (m, k) = foldPorts xs+++getPortVals :: M.Map Int [(Int, Cs.ArgOut)]+ -> Int -> Int + -> [Maybe (Int, Cs.ArgOut)]+getPortVals m n id = map Just q ++ replicate (n - length q) Nothing+ where q = case M.lookup id m of+ (Just xs) -> xs+ Nothing -> []++foldPorts :: [FoldedMO] -> (M.Map Int [(Int, Cs.ArgOut)], Int)+foldPorts = (\x -> (M.fromList x, getMaxLength x)) . map select . + groupBy ((==) `on` moPort) . sortBy (compare `on` moPort) + where getMaxLength = maximum . map (length . snd)+ select xs = let key = moPort $ head xs+ val = map (\x -> (moLineNum x, moArgOut x)) xs+ in (key, val)+ +++procMOs :: Int -> [(Int, [(Maybe Cs.ArgOut, Cs.Rate)], Opcode)] + -> [(Int, Cs.OpcodeExpr)]+procMOs n xs = fst $ runState (mapM f xs) n+ where f (id, outs, opc) = liftM (\x -> (id, x)) $ mkOpcode outs opc+ mkOpcode outs opc = liftM (\x -> uncurry (Cs.OpcodeExpr x) opc) $ + mapM mkOuts outs+++mkOuts :: (Maybe Cs.ArgOut, Cs.Rate) -> State Int Cs.ArgOut+mkOuts (arg, rate) = + State $ \n -> case arg of+ Nothing -> (numArgName rate n, n + 1)+ (Just a) -> (a, n)
+ src/CsoundExpr/Translator/Score.hs view
@@ -0,0 +1,130 @@+module CsoundExpr.Translator.Score+ (foldScores)+where++import Data.List+import Data.Function+++import Temporal.Media(EventList(..))++import qualified Data.Map as Map++import CsoundExpr.Translator.ExprTree.Tree+import CsoundExpr.Translator.ExprTree.ExprTree+import CsoundExpr.Translator.ExprTree.ExprTree (Purity(..), exprTag)++import CsoundExpr.Translator.Cs.CsTree+import CsoundExpr.Translator.Cs.Utils++import CsoundExpr.Translator.Types++type NodeId = (Int, [Int])+type PfieldId = (Int, IsStringPfield)++type IsStringPfield = Bool+++foldScores :: EventList Dur Instr -> [(Instr, [Note])]+foldScores x = zip instrs vals+ where instrs = zipWith substPfields ids rawInstrs+ (ids, vals) = unzip $ map (foldVals . formValues) sco+ rawInstrs = map (thd . head) sco+ sco = scoreList x+++--scoreList :: Events Instr -> [[(Time, Time, Instr)]]+--scoreList = groupBy ((liftPredicateToList equalStructure) `on` thd) . +-- sortBy (compare `on` thd) . toList++scoreList :: EventList Dur Instr -> [[(Time, Dur, Instr)]]+scoreList = iterScoreList [] . toList+ where iterScoreList res s = + case s of+ [] -> res+ (x:xs) -> let (x1, x2) = partition (pred x) xs+ in iterScoreList (res ++ [x : x1]) x2+ pred = liftPredicateToList equalStructure `on` thd+ toList (EventList _ xs) = xs+++foldVals :: [(Time, Time, [(NodeId, ValueId)])] -> ([(NodeId, PfieldId)], [Note])+foldVals xs = (i, subst3 (valList v) xs)+ where (i, v) = assignPfieldIds $ [(fst $ head v, (map snd v)) | v <- f xs]+ f = filter isPfield . transpose . map thd+ subst3 ys xs = [(a, b, y) | (y, (a, b, _)) <- zip ys xs]+ valList [] = repeat []+ valList xs = transpose xs+ isPfield = ( > 1) . length . nub++++substPfields :: [(NodeId, PfieldId)] -> Instr -> Instr+substPfields ids instr = foldl f instr ids -- zip ids [4..]+ where f xs ((id0, id), n) =+ substListElem id0 (substTreeById id (p n) (xs !! id0)) xs+ p (id, isStr) + | isStr = mapType (const [S]) $ param id+ | otherwise = mapType (const [I]) $ param id+ +++substListElem :: Int -> a -> [a] -> [a]+substListElem id x xs = take id xs ++ [x] ++ drop (id+1) xs+++ +formValues :: [(Time, Time, Instr)] -> [(Time, Time, [(NodeId, ValueId)])]+formValues = map f . sortBy p+ where f (t, d, expr) = (t, d, toVals expr)+ p (a1, b1, _) (a2, b2, _)+ | a1 < a2 = LT+ | a1 == a2 && a1 < a2 = LT+ | a1 == a2 && a1 == a2 = EQ+ | otherwise = GT+++toVals :: Instr -> [(NodeId, ValueId)]+toVals = (addId0 =<< ) . zip [0..] . map getVals+ where getVals = map (mapSnd value') . filter (isVal . exprOp . exprTag . snd) . toIdList+ value' x = (exprPurity x, value $ exprOp $ exprTag x)+ addId0 (id0, xs) = [((id0, ids), vs) | (ids, vs) <- xs]+ ++assignPfieldIds :: [(NodeId, [ValueId])] -> ([(NodeId, PfieldId)], [[ValueId]])+assignPfieldIds xs = (zip (map fst xs) (zip ids isStr), orderValsWithIds ids vals)+ where ids = map (+4) $ numerate $ map snd xs+ isStr = map (isStringValueId . head . snd) xs+ vals = map (snd . head) $+ groupBy ((==) `on` fst) $+ zip ids (map snd xs)+ +++orderValsWithIds :: [Int] -> [[ValueId]] -> [[ValueId]]+orderValsWithIds ids vals = map snd $ sortOn fst $ nubOn fst $ zip ids vals+++sortOn :: Ord b => (a -> b) -> [a] -> [a]+sortOn f = sortBy (compare `on` f)++nubOn :: Eq b => (a -> b) -> [a] -> [a]+nubOn f = nubBy ((==) `on` f)+++isStringValueId :: ValueId -> Bool+isStringValueId (_, v) = isString v +++-- numerate : +-- assigns numbers to unique elements of list+-- (it's for (ExprTree -> ExprSeq) optimisation, +-- pfields with the same values should have same pfield ids)++numerate :: Ord b => [b] -> [Int]+numerate = fst . foldl f ([], Map.empty) + where f (s, m) b + | Map.member b m = (s ++ [m Map.! b], m)+ | otherwise = (s ++ [id], mNew)+ where id = Map.size m+ mNew = Map.insert b id m
+ src/CsoundExpr/Translator/Types.hs view
@@ -0,0 +1,215 @@+{-# LANGUAGE + MultiParamTypeClasses, + TypeSynonymInstances, + FlexibleContexts #-}++module CsoundExpr.Translator.Types (+ Time, Dur, + Id, + ExprLayer, LaExpr, + mkLayer, layerOut, layerOp, layerIn,+ GlobalInits,+ FtableId, FtableInfo,+ Instr, MidiInstr, InstrOrder, InstrOrderInfo,+ Note, ValueId,+ SignalOut(..), outList, fromSignalOut,+ SignalInit(..),+ Arate(..), Krate(..), Irate(..), X(..), K(..), MO(..),+ toValue, toCsRate, gRate, isArgOut, toOprType+)+where++import qualified Data.Set as Set+import qualified Data.Map as Map++import CsoundExpr.Translator.ExprTree.ExprTree+import CsoundExpr.Translator.Cs.IM+import qualified CsoundExpr.Translator.Cs.CsTree as La+import qualified CsoundExpr.Translator.Cs.CsoundFile as Cs++type Time = Double+type Dur = Time+++-- exprSeq++--type CsExprSeq = ExprSeq La.Rate La.CsExpr+--type CsExprLayer = ExprLayer [(La.Rate, Id)] La.CsExpr Int++type LaExpr = Expr La.Label La.Rate La.CsExpr++-- type ExprSeq a b = [ExprLayer [(a, Id)] b Id]+type ExprLayer a b c = (a, (b, [c]))++layerOut (a, (b, c)) = a+layerOp (a, (b, c)) = b+layerIn (a, (b, c)) = c++mkLayer a b c = (a, (b, c))++-- globals++type GlobalInits = Set.Set (La.Name, La.Rate)++-- ftables++type FtableId = (Purity Id, La.Ftable)+type FtableInfo = Map.Map FtableId Id++-- instr++type Instr = [La.CsTree]+type MidiInstr = Instr+type InstrOrder = [Instr]++type InstrOrderInfo = Map.Map Instr Id++-- scores++type Note = (Time, Time, [ValueId])+type ValueId = (Purity Id, La.Value)++-- rates++-- | audio signal +data Arate = Arate La.CsTree++-- | control signal +data Krate = Krate La.CsTree++-- | init variable+data Irate = Irate La.CsTree+ deriving (Eq)++-- rate classes++-- IM++instance IM La.CsTree Arate where+ from = Arate . mapType (const [La.A])+ to (Arate t) = t+++instance IM La.CsTree Krate where+ from = Krate . mapType (const [La.K])+ to (Krate t) = t+++instance IM La.CsTree Irate where+ from = Irate . mapType (const [La.I])+ to (Irate t) = t+++instance IM La.CsTree String where+ from x = error "from string is undefined"+ to = La.string++-- MO++class MO a where+ rateMO :: [La.Rate] -> a -> a++instance MO Arate where+ rateMO rs (Arate x) = Arate $ mapType (const rs) x++instance MO Krate where+ rateMO rs (Krate x) = Krate $ mapType (const rs) x++instance MO Irate where+ rateMO rs (Irate x) = Irate $ mapType (const rs) x++-- X, K++-- | 'X' = 'Arate' | 'Krate' | 'Irate'+class (IM La.CsTree a, MO a) => X a++-- | 'K' = 'Krate' | 'Irate'+class X a => K a++instance X Arate+instance X Krate+instance X Irate++instance K Krate+instance K Irate++-- signal out++-- | Output of opcodes that produce no value in csound code (out, outs, xtratim, etc.)+data SignalOut = SignalOut Instr+ deriving (Eq, Ord)++-- | Join several output opcodes+--+-- Example :+-- +-- > instr q+-- > a1 upsamp 1+-- > out a1+-- > gaSig = a1+-- > endin+--+-- > q = outList [out x, gar "Sig" <=> x]+-- > where x = upsamp $ num 1+--+outList :: [SignalOut] -> SignalOut+outList = SignalOut . (fromSignalOut =<< )+++fromSignalOut :: SignalOut -> Instr+fromSignalOut (SignalOut x) = x++-- signal init++data SignalInit = Instr0 SignalOut+ | Massign [Int] Int SignalOut+ | Pgmassign [Int] Int SignalOut+ | InstrOrder [SignalOut]+ deriving (Eq, Ord)++-------------------------------------------------------+-- predicates++isArgOut :: ExprLayer Int LaExpr Int -> Bool+isArgOut x = (not $ null $ layerIn x) && (La.isArg $ exprOp $ exprTag $ layerOp x) ++-------------------------------------------------------+-- converters+++toValue :: La.Value -> Cs.Value+toValue x = case x of+ (La.ValueDouble v) -> Cs.ValueDouble v+ (La.ValueString v) -> Cs.ValueString v+ (La.ValueInt v) -> Cs.ValueInt v+++toCsRate :: La.Rate -> Cs.Rate+toCsRate x = + case x of+ La.A -> Cs.A+ La.K -> Cs.K+ La.I -> Cs.I+ La.S -> Cs.S+ + La.GA -> Cs.GA+ La.GK -> Cs.GK+ La.GI -> Cs.GI+ La.GS -> Cs.GS+ + La.SetupRate -> Cs.SetupRate+ +++gRate :: Cs.Rate -> Cs.Rate+gRate x = case x of+ Cs.A -> Cs.GA+ Cs.K -> Cs.GK+ Cs.I -> Cs.GI++toOprType :: La.OprType -> Cs.OprType+toOprType x = case x of+ La.Infix -> Cs.Infix+ La.Prefix -> Cs.Prefix++