csound-expression-typed-0.2.7.1: typed core for the library csound-expression
Safe HaskellSafe-Inferred
LanguageHaskell2010

Csound.Typed.Control.Ref

Synopsis

Documentation

newtype Ref a Source #

It describes a reference to mutable values.

Constructors

Ref [Var] 

writeRef :: Tuple a => Ref a -> a -> SE () Source #

readRef :: Tuple a => Ref a -> SE a Source #

newRef :: forall a. Tuple a => a -> SE (Ref a) Source #

Allocates a new local (it is visible within the instrument) mutable value and initializes it with value. A reference can contain a tuple of variables.

mixRef :: (Num a, Tuple a) => Ref a -> a -> SE () Source #

Adds the given signal to the value that is contained in the reference.

modifyRef :: Tuple a => Ref a -> (a -> a) -> SE () Source #

Modifies the Ref value with given function.

sensorsSE :: Tuple a => a -> SE (SE a, a -> SE ()) Source #

An alias for the function newRef. It returns not the reference to mutable value but a pair of reader and writer functions.

newGlobalRef :: forall a. Tuple a => a -> SE (Ref a) Source #

Allocates a new global mutable value and initializes it with value. A reference can contain a tuple of variables.

concatRef :: (Tuple a, Tuple b) => Ref a -> Ref b -> Ref (a, b) Source #

concatRef3 :: (Tuple a, Tuple b, Tuple c) => Ref a -> Ref b -> Ref c -> Ref (a, b, c) Source #

concatRef4 :: (Tuple a, Tuple b, Tuple c, Tuple d) => Ref a -> Ref b -> Ref c -> Ref d -> Ref (a, b, c, d) Source #

concatRef5 :: (Tuple a, Tuple b, Tuple c, Tuple d, Tuple e) => Ref a -> Ref b -> Ref c -> Ref d -> Ref e -> Ref (a, b, c, d, e) Source #

newCtrlRef :: forall a. Tuple a => a -> SE (Ref a) Source #

Allocates a new local (it is visible within the instrument) mutable value and initializes it with value. A reference can contain a tuple of variables. It contains control signals (k-rate) and constants for numbers (i-rates).

newGlobalCtrlRef :: forall a. Tuple a => a -> SE (Ref a) Source #

Allocates a new global mutable value and initializes it with value. A reference can contain a tuple of variables. It contains control signals (k-rate) and constants for numbers (i-rates).

globalSensorsSE :: Tuple a => a -> SE (SE a, a -> SE ()) Source #

An alias for the function newRef. It returns not the reference to mutable value but a pair of reader and writer functions.

newClearableGlobalRef :: forall a. Tuple a => a -> SE (Ref a) Source #

Allocates a new clearable global mutable value and initializes it with value. A reference can contain a tuple of variables. The variable is set to zero at the end of every iteration. It's useful for accumulation of audio values from several instruments.

newTab :: D -> SE Tab Source #

Creates a new table. The Tab could be used while the instrument is playing. When the instrument is retriggered the new tab is allocated.

newTab size

newGlobalTab :: Int -> SE Tab Source #

Creates a new global table. It's generated only once. It's persisted between instrument calls.

newGlobalTab identifier size

whileRef :: forall st. Tuple st => st -> (st -> SE BoolSig) -> (st -> SE st) -> SE () Source #

whileRefD :: forall st. Tuple st => st -> (st -> SE BoolD) -> (st -> SE st) -> SE () Source #