synthesizer-core-0.4.0.4: Audio signal processing coded in Haskell: Low level part

Synthesizer.Generic.Cut

Description

This module allows abstraction of operations that operate on the time axis and do also work on signal types without sample values. The most distinctive instances are certainly Dirac signals and chunky time values.

Synopsis

Documentation

class Read sig whereSource

Methods

null :: sig -> BoolSource

length :: sig -> IntSource

Instances

Read [y] 
Integral a => Read (T a) 
(C a, C a) => Read (T a) 
Storable y => Read (Vector y) 
Read (T y) 
Integral t => Read (T t y)

We use event lists for efficient representation of piecewise constant signals.

class Read sig => NormalForm sig whereSource

Methods

evaluateHead :: sig -> ()Source

Evaluating the first value of the signal is necessary for avoiding a space leaks if you repeatedly drop a prefix from the signal and do not consume something from it.

Instances

NFData y => NormalForm [y] 
(Integral a, C a, NFData a) => NormalForm (T a) 
(C a, C a, NFData a) => NormalForm (T a) 
Storable y => NormalForm (Vector y) 
NFData y => NormalForm (T y) 
(Integral t, NFData y) => NormalForm (T t y) 

class (Read sig, Monoid sig) => Transform sig whereSource

Methods

take :: Int -> sig -> sigSource

drop :: Int -> sig -> sigSource

dropMarginRem :: Int -> Int -> sig -> (Int, sig)Source

splitAt :: Int -> sig -> (sig, sig)Source

reverse :: sig -> sigSource

Instances

Transform [y] 
(Integral a, C a) => Transform (T a) 
(C a, C a) => Transform (T a) 
Storable y => Transform (Vector y) 
Transform (T y) 
(Integral t, C t) => Transform (T t y)

The function defined here are based on the interpretation of event lists as piecewise constant signals. They do not fit to the interpretation of atomic events. Because e.g. it makes no sense to split an atomic event into two instances by splitAt, and it is also not clear, whether dropping the first chunk shall leave a chunk of length zero or remove that chunk completely.

intToChunky :: (C a, C a) => String -> Int -> T aSource

intToChunky98 :: (Num a, C a) => String -> Int -> T aSource

empty :: Monoid sig => sigSource

cycle :: Monoid sig => sig -> sigSource

append :: Monoid sig => sig -> sig -> sigSource

concat :: Monoid sig => [sig] -> sigSource

lengthAtLeast :: Transform sig => Int -> sig -> BoolSource

Like lengthAtLeast n xs = length xs >= n, but is more efficient, because it is more lazy.

lengthAtMost :: Transform sig => Int -> sig -> BoolSource

sliceVertical :: Transform sig => Int -> sig -> T sigSource