csound-expression-dynamic-0.0.3: dynamic core for csound-expression library

Safe HaskellNone

Csound.Dynamic.Types.Exp

Description

Main types

Synopsis

Documentation

type E = Fix RatedExpSource

The inner representation of csound expressions.

data RatedExp a Source

Constructors

RatedExp 

Fields

ratedExpRate :: Maybe Rate

Rate (can be undefined or Nothing, it means that rate should be deduced automatically from the context)

ratedExpDepends :: Maybe a

Dependency (it is used for expressions with side effects, value contains the privious statement)

ratedExpExp :: Exp a

Main expression

type RatedVar = Var RateSource

RatedVar is for pretty printing of the wiring ports.

ratedVar :: Rate -> Int -> RatedVarSource

Makes an rated variable.

ratedVarRate :: RatedVar -> RateSource

Querries a rate.

ratedVarId :: RatedVar -> IntSource

Querries an integral identifier.

type Exp a = MainExp (PrimOr a)Source

toPrimOr :: E -> PrimOr ESource

Constructs PrimOr values from the expressions. It does inlining in case of primitive values.

newtype PrimOr a Source

It's a primitive value or something else. It's used for inlining of the constants (primitive values).

Constructors

PrimOr 

Fields

unPrimOr :: Either Prim a
 

Instances

data MainExp a Source

Constructors

EmptyExp 
ExpPrim Prim

Primitives

Tfm Info [a]

Application of the opcode: we have opcode information (Info) and the arguments [a]

ConvertRate Rate Rate a

Rate conversion

Select Rate Int a

Selects a cell from the tuple, here argument is always a tuple (result of opcode that returns several outputs)

If (CondInfo a) a a

if-then-else

ExpBool (BoolExp a)

Boolean expressions (rendered in infix notation in the Csound)

ExpNum (NumExp a)

Numerical expressions (rendered in infix notation in the Csound)

InitVar Var a

Reading/writing a named variable

ReadVar Var 
WriteVar Var a 
IfBegin (CondInfo a)

Imperative If-then-else

ElseIfBegin (CondInfo a) 
ElseBegin 
IfEnd 
Verbatim String

Verbatim stmt

data InstrId Source

An instrument identifier

intInstrId :: Int -> InstrIdSource

Constructs an instrument id with the integer.

ratioInstrId :: Int -> Int -> InstrIdSource

Constructs an instrument id with fractional part.

stringInstrId :: String -> InstrIdSource

Constructs an instrument id with the string label.

data VarType Source

Constructors

LocalVar 
GlobalVar 

data Var Source

Constructors

Var 

Fields

varType :: VarType
 
varRate :: Rate
 
varName :: Name
 
VarVerbatim 

Fields

varRate :: Rate
 
varName :: Name
 

Instances

data Info Source

Instances

data Rate Source

The Csound rates.

Constructors

Xr 
Ar 
Kr 
Ir 
Sr 
Fr 
Wr 
Tvar 

data Gen Source

Constructors

Gen 

Fields

genSize :: Int
 
genId :: Int
 
genArgs :: [Double]
 
genFile :: Maybe String
 

Instances

data Inline a b Source

Constructors

Inline 

Fields

inlineExp :: InlineExp a
 
inlineEnv :: IntMap b
 

Instances

Functor (Inline a) 
Foldable (Inline a) 
Traversable (Inline a) 
(Eq a, Eq b) => Eq (Inline a b) 
(Ord a, Ord b) => Ord (Inline a b) 
(Show a, Show b) => Show (Inline a b) 

data InlineExp a Source

Constructors

InlinePrim Int 
InlineExp a [InlineExp a] 

Instances

Eq a => Eq (InlineExp a) 
Ord a => Ord (InlineExp a) 
Show a => Show (InlineExp a) 

data PreInline a b Source

Constructors

PreInline a [b] 

Instances

Functor (PreInline a) 
Foldable (PreInline a) 
Traversable (PreInline a) 
(Eq a, Eq b) => Eq (PreInline a b) 
(Ord a, Ord b) => Ord (PreInline a b) 
(Show a, Show b) => Show (PreInline a b) 

data NumOp Source

Constructors

Add 
Sub 
Neg 
Mul 
Div 
Pow 
Mod 

Instances

type Note = [Prim]Source

type MultiOut a = Int -> aSource

Multiple output. Specify the number of outputs to get the result.