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

Csound.Typed.Types.Array

Synopsis

Documentation

newtype Arr ix a Source #

Arrays. The array data type is parametrized with type of the index and the type of the value. Note that the data tpyes for indices and values can be tuples.

Constructors

Arr 

Fields

newLocalArr :: (Tuple a, Tuple ix) => [D] -> SE (Arr ix a) Source #

Creates an array that is local to the body of Csound instrument where it's defined. The array contains audio signals.

newLocalArr sizes

newGlobalArr :: (Tuple a, Tuple ix) => [D] -> SE (Arr ix a) Source #

Creates a global array. The array contains audio signals.

newGlobalArr sizes

newLocalCtrlArr :: (Tuple a, Tuple ix) => [D] -> SE (Arr ix a) Source #

Creates an array that is local to the body of Csound instrument where it's defined. The array contains control signals.

newLocalCtrlArr sizes

newGlobalCtrlArr :: (Tuple a, Tuple ix) => [D] -> SE (Arr ix a) Source #

Creates a global array. The array contains control signals.

newGlobalCtrlArr sizes

fillLocalArr :: (Tuple a, Tuple ix) => [Int] -> [a] -> SE (Arr ix a) Source #

Creates an array that is local to the body of Csound instrument where it's defined. The array contains audio signals. It fills the array from the list of values (the last argument).

fillLocalArr sizes initValues = ...

fillGlobalArr :: (Tuple a, Tuple ix) => [Int] -> [a] -> SE (Arr ix a) Source #

Creates a global array. The array contains audio signals. It fills the array from the list of values (the last argument).

fillGlobalArr sizes initValues = ...

fillLocalCtrlArr :: (Tuple a, Tuple ix) => [Int] -> [a] -> SE (Arr ix a) Source #

Creates an array that is local to the body of Csound instrument where it's defined. The array contains control signals. It fills the array from the list of values (the last argument).

fillLocalCtrlArr sizes initValues = ...

fillGlobalCtrlArr :: (Tuple a, Tuple ix) => [Int] -> [a] -> SE (Arr ix a) Source #

Creates a global array. The array contains control signals. It fills the array from the list of values (the last argument).

fillGlobalCtrlArr sizes initValues = ...

readArr :: (Tuple a, Tuple ix) => Arr ix a -> ix -> SE a Source #

Reads data from the array.

writeArr :: (Tuple ix, Tuple a) => Arr ix a -> ix -> a -> SE () Source #

Writes data to the array.

writeInitArr :: (Tuple ix, Tuple a) => Arr ix a -> ix -> a -> SE () Source #

Writes data to the array.

modifyArr :: (Tuple a, Tuple ix) => Arr ix a -> ix -> (a -> a) -> SE () Source #

Updates the value of the array with pure function.

mixArr :: (Tuple ix, Tuple a, Num a) => Arr ix a -> ix -> a -> SE () Source #

Misc functions to help the type inverence

type Arr1 a = Arr Sig a Source #

An array with single signal index.

type DArr1 a = Arr D a Source #

An array with single constant index.

type Arr2 a = Arr (Sig, Sig) a Source #

A matrix (2D array) with signal index.

type DArr2 a = Arr (D, D) a Source #

A matrix (2D array) with constant index.

type Arr3 a = Arr (Sig, Sig, Sig) a Source #

A 3D array with signal index.

type DArr3 a = Arr (D, D, D) a Source #

A 3D array with constant index.

arr1 :: SE (Arr Sig a) -> SE (Arr Sig a) Source #

Function to help the type inference.

darr1 :: SE (Arr D a) -> SE (Arr D a) Source #

Function to help the type inference.

arr2 :: SE (Arr (Sig, Sig) a) -> SE (Arr (Sig, Sig) a) Source #

Function to help the type inference.

darr2 :: SE (Arr (D, D) a) -> SE (Arr (D, D) a) Source #

Function to help the type inference.

arr3 :: SE (Arr (Sig, Sig, Sig) a) -> SE (Arr (Sig, Sig, Sig) a) Source #

Function to help the type inference.

darr3 :: SE (Arr (D, D, D) a) -> SE (Arr (D, D, D) a) Source #

Function to help the type inference.

Array opcodes

maparrayNew :: Arr a b -> Str -> SE (Arr a b) Source #

Mapps all values in the array with the function.

Csound docs: http://csound.github.io/docs/manual/maparray.html

lenarray :: SigOrD c => Arr a b -> c Source #

copyf2array :: Arr Sig Sig -> Tab -> SE () Source #

Copies table to array.

copya2ftab :: Arr Sig Sig -> Tab -> SE () Source #

Copies array to table.

minarray :: (Tuple b, Num b) => Arr a b -> SE b Source #

Finds a minimum value of the array.

maxarray :: (Tuple b, Num b) => Arr a b -> SE b Source #

Finds a maximum value of the array.

sumarray :: (Tuple b, Num b) => Arr a b -> SE b Source #

Summs all elements in the array.

scalearray :: (Tuple b, Num b) => Arr a b -> (b, b) -> SE () Source #

Scales all elements in the array.

slicearrayNew :: Arr D a -> (D, D) -> SE (Arr D a) Source #

Creates a copy of some part of the given array

maparrayCopy :: Arr a b -> Str -> Arr a b -> SE () Source #

Transforms the dta of the array and copies it to the second array.

slicearrayCopy :: Arr D a -> (D, D) -> Arr D a -> SE () Source #

Copies a part of array to another array.

divArrayCopy :: (Tuple b, Num b) => Arr a b -> Arr a b -> Arr a b -> SE () Source #

Divides two arrays and copies the result into third array.

subArrayCopy :: (Tuple b, Num b) => Arr a b -> Arr a b -> Arr a b -> SE () Source #

Substracts two arrays and copies the result into third array.

addArrayCopy :: (Tuple b, Num b) => Arr a b -> Arr a b -> Arr a b -> SE () Source #

Summs two arrays and copies the result into third array.

mulArrayCopy :: (Tuple b, Num b) => Arr a b -> Arr a b -> Arr a b -> SE () Source #

Multiplies two arrays and copies the result into third array.

addArrayNew :: (Tuple b, Num b) => Arr a b -> Arr a b -> SE (Arr a b) Source #

Summs two numeric arrays and save the result in the third array.

mulArrayNew :: (Tuple b, Num b) => Arr a b -> Arr a b -> SE (Arr a b) Source #

Multiplies two numeric arrays and save the result in the third array.

divArrayNew :: (Tuple b, Num b) => Arr a b -> Arr a b -> SE (Arr a b) Source #

Division of two numeric arrays and save the result in the third array.

subArrayNew :: (Tuple b, Num b) => Arr a b -> Arr a b -> SE (Arr a b) Source #

Substraction of two numeric arrays and save the result in the third array.

Spectral opcodes

type SpecArr = Arr Sig Sig Source #

Spectral array.

fftNew :: SpecArr -> SE SpecArr Source #

Complex-to-complex Fast Fourier Transform.

csound docs: http://csound.github.io/docs/manual/fft.html

fftinvNew :: SpecArr -> SE SpecArr Source #

Complex-to-complex Inverse Fast Fourier Transform.

csound docs: http://csound.github.io/docs/manual/fftinv.html

rfftNew :: SpecArr -> SE SpecArr Source #

Fast Fourier Transform of a real-value array.

csound docs: http://csound.github.io/docs/manual/rfft.html

rifftNew :: SpecArr -> SE SpecArr Source #

Complex-to-real Inverse Fast Fourier Transform.

csound docs: http://csound.github.io/docs/manual/rifft.html

pvs2tab :: SpecArr -> Spec -> SE Sig Source #

Copies spectral data to k-rate arrays (or t-variables). Also known as pvs2array.

csound docs: http://csound.github.io/docs/manual/pvs2tab.html

tab2pvs :: SpecArr -> SE Spec Source #

Copies spectral data from k-rate arrays (or t-variables.). Also known as pvsfromarray.

csound docs: http://csound.github.io/docs/manual/tab2pvs.html

cmplxprodNew :: SpecArr -> SpecArr -> SE SpecArr Source #

Complex product of two arrays.

kout[] cmplxprod kin1[], kin2[]

csound docs: http://csound.github.io/docs/manual/cmplxprod.html

rect2polNew :: SpecArr -> SE SpecArr Source #

Rectangular to polar format conversion.

kout[] rect2pol kin[]

csound docs: http://csound.github.io/docs/manual/rect2pol.html

pol2rectNew :: SpecArr -> SE SpecArr Source #

Polar to rectangular format conversion.

kout[] pol2rect kin[]

csound docs: http://csound.github.io/docs/manual/pol2rect.html

pol2rect2New :: SpecArr -> SpecArr -> SE SpecArr Source #

Polar to rectangular format conversion.

kout[] pol2rect kmags[], kphs[]

csound docs: http://csound.github.io/docs/manual/pol2rect.html

windowArrayNew :: SpecArr -> SE SpecArr Source #

Applies a window to an array.

kout[] window kin[][, koff, itype]

csound docs: http://csound.github.io/docs/manual/window.html

r2cNew :: SpecArr -> SE SpecArr Source #

Real to complex format conversion.

kout[] r2c kin[]

csound docs: http://csound.github.io/docs/manual/r2c.html

c2rNew :: SpecArr -> SE SpecArr Source #

Complex to real format conversion.

kout[] c2r kin[]

csound docs: http://csound.github.io/docs/manual/c2r.html

magsArrayNew :: SpecArr -> SE SpecArr Source #

Obtains the magnitudes of a complex-number array

kout[] mags kin[]

csound docs: http://csound.github.io/docs/manual/mags.html

phsArrayNew :: SpecArr -> SE SpecArr Source #

Obtains the phases of a complex-number array

kout[] phs kin[]

csound docs: <http://csound.github.io/docs/manual/phs.html>

fftCopy :: SpecArr -> SpecArr -> SE () Source #

Complex-to-complex Fast Fourier Transform.

csound docs: http://csound.github.io/docs/manual/fft.html

fftinvCopy :: SpecArr -> SpecArr -> SE () Source #

Complex-to-complex Inverse Fast Fourier Transform.

csound docs: http://csound.github.io/docs/manual/fftinv.html

rfftCopy :: SpecArr -> SpecArr -> SE () Source #

Fast Fourier Transform of a real-value array.

csound docs: http://csound.github.io/docs/manual/rfft.html

rifftCopy :: SpecArr -> SpecArr -> SE () Source #

Complex-to-real Inverse Fast Fourier Transform.

csound docs: http://csound.github.io/docs/manual/rifft.html

cmplxprodCopy :: SpecArr -> SpecArr -> SpecArr -> SE () Source #

Complex product of two arrays.

kout[] cmplxprod kin1[], kin2[]

csound docs: http://csound.github.io/docs/manual/cmplxprod.html

rect2polCopy :: SpecArr -> SpecArr -> SE () Source #

Rectangular to polar format conversion.

kout[] rect2pol kin[]

csound docs: http://csound.github.io/docs/manual/rect2pol.html

pol2rectCopy :: SpecArr -> SpecArr -> SE () Source #

Polar to rectangular format conversion.

kout[] pol2rect kin[]

csound docs: http://csound.github.io/docs/manual/pol2rect.html

pol2rect2Copy :: SpecArr -> SpecArr -> SpecArr -> SE () Source #

Polar to rectangular format conversion.

kout[] pol2rect kmags[], kphs[]

csound docs: http://csound.github.io/docs/manual/pol2rect.html

windowArrayCopy :: SpecArr -> SpecArr -> SE () Source #

Applies a window to an array.

kout[] window kin[][, koff, itype]

csound docs: http://csound.github.io/docs/manual/window.html

r2cCopy :: SpecArr -> SpecArr -> SE () Source #

Real to complex format conversion.

kout[] r2c kin[]

csound docs: http://csound.github.io/docs/manual/r2c.html

c2rCopy :: SpecArr -> SpecArr -> SE () Source #

Complex to real format conversion.

kout[] c2r kin[]

csound docs: http://csound.github.io/docs/manual/c2r.html

magsArrayCopy :: SpecArr -> SpecArr -> SE () Source #

Obtains the magnitudes of a complex-number array

kout[] mags kin[]

csound docs: http://csound.github.io/docs/manual/mags.html

phsArrayCopy :: SpecArr -> SpecArr -> SE () Source #

Obtains the phases of a complex-number array

kout[] phs kin[]

csound docs: <http://csound.github.io/docs/manual/phs.html>