synthesizer-llvm-0.2.0.1: Efficient signal processing using runtime compilation

Synthesizer.LLVM.Storable.Signal

Description

Functions on lazy storable vectors that are implemented using LLVM.

Synopsis

Documentation

unpackStrict :: (Storable a, IsPrimitive a, IsPowerOf2 n) => Vector (Vector n a) -> Vector aSource

This function needs only constant time in contrast to Synthesizer.LLVM.Parameterized.SignalPacked.unpack.

We cannot provide a pack function since the array size may not line up. It would also need copying since the source data may not be aligned properly.

makeUnpackGenericStrict :: (Access n va vv, Storable a, MakeValueTuple a va, Memory va as, IsSized as asize, Storable v, MakeValueTuple v vv, Memory vv vs, IsSized vs vsize) => IO (Vector v -> Vector a)Source

This is similar to unpackStrict but performs rearrangement of data. This is for instance necessary for stereo signals where the data layout of packed and unpacked data is different, thus simple casting of the data is not possible.

makeUnpackGeneric :: (Access n va vv, Storable a, MakeValueTuple a va, Memory va as, IsSized as asize, Storable v, MakeValueTuple v vv, Memory vv vs, IsSized vs vsize) => IO (Vector v -> Vector a)Source

makeReversePackedStrict :: (Storable v, Access n va vv, MakeValueTuple v vv, Memory vv vs, IsSized vs vsize) => IO (Vector v -> Vector v)Source

makeReversePacked :: (Storable v, Access n va vv, MakeValueTuple v vv, Memory vv vs, IsSized vs vsize) => IO (Vector v -> Vector v)Source

continue :: Storable a => Vector a -> (a -> Vector a) -> Vector aSource

Append two signals where the second signal gets the last value of the first signal as parameter. If the first signal is empty then there is no parameter for the second signal and thus we simply return an empty signal in that case.

continuePackedGeneric :: (Storable v, Storable a) => (Vector v -> Vector a) -> Vector v -> (a -> Vector v) -> Vector vSource

Use this like

 do unpackGeneric <- makeUnpackGenericStrict
    return (continuePackedGeneric unpackGeneric x y)

makeMixer :: (Storable a, Additive value, MakeValueTuple a value, Memory value struct) => value -> IO (Word32 -> Ptr a -> Ptr a -> IO ())Source

makeArranger :: (Storable a, Additive value, MakeValueTuple a value, Memory value struct) => IO (ChunkSize -> T Int (Vector a) -> Vector a)Source

arrangeSource

Arguments

:: (Storable a, Additive value, MakeValueTuple a value, Memory value struct) 
=> ChunkSize 
-> T Int (Vector a)

A list of pairs: (relative start time, signal part), The start time is relative to the start time of the previous event.

-> Vector a

The mixed signal.

This is unsafe since it relies on the prior initialization of the LLVM JIT. Better use makeArranger.