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

Safe HaskellNone
LanguageHaskell2010

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 where Source #

Minimal complete definition

null, length

Methods

null :: sig -> Bool Source #

length :: sig -> Int Source #

Instances

Read LazySize Source # 
Read [y] Source # 

Methods

null :: [y] -> Bool Source #

length :: [y] -> Int Source #

Integral a => Read (T a) Source # 

Methods

null :: T a -> Bool Source #

length :: T a -> Int Source #

(C a, C a) => Read (T a) Source # 

Methods

null :: T a -> Bool Source #

length :: T a -> Int Source #

Storable y => Read (Vector y) Source # 

Methods

null :: Vector y -> Bool Source #

length :: Vector y -> Int Source #

Storable y => Read (Vector y) Source # 

Methods

null :: Vector y -> Bool Source #

length :: Vector y -> Int Source #

Read (T y) Source # 

Methods

null :: T y -> Bool Source #

length :: T y -> Int Source #

Read (Chunk a) Source # 

Methods

null :: Chunk a -> Bool Source #

length :: Chunk a -> Int Source #

Integral t => Read (T t y) Source # 

Methods

null :: T t y -> Bool Source #

length :: T t y -> Int Source #

Integral t => Read (T t y) Source #

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

Methods

null :: T t y -> Bool Source #

length :: T t y -> Int Source #

(Read a, Read b) => Read (T a b) Source # 

Methods

null :: T a b -> Bool Source #

length :: T a b -> Int Source #

class Read sig => NormalForm sig where Source #

Minimal complete definition

evaluateHead

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] Source # 

Methods

evaluateHead :: [y] -> () Source #

(Integral a, C a, NFData a) => NormalForm (T a) Source # 

Methods

evaluateHead :: T a -> () Source #

(C a, C a, NFData a) => NormalForm (T a) Source # 

Methods

evaluateHead :: T a -> () Source #

Storable y => NormalForm (Vector y) Source # 

Methods

evaluateHead :: Vector y -> () Source #

Storable y => NormalForm (Vector y) Source # 

Methods

evaluateHead :: Vector y -> () Source #

NFData y => NormalForm (T y) Source # 

Methods

evaluateHead :: T y -> () Source #

NormalForm (Chunk a) Source # 

Methods

evaluateHead :: Chunk a -> () Source #

(Integral t, NFData y) => NormalForm (T t y) Source # 

Methods

evaluateHead :: T t y -> () Source #

(NormalForm a, NormalForm b) => NormalForm (T a b) Source # 

Methods

evaluateHead :: T a b -> () Source #

class (Read sig, Monoid sig) => Transform sig where Source #

Minimal complete definition

take, drop, dropMarginRem, splitAt, reverse

Methods

take :: Int -> sig -> sig Source #

drop :: Int -> sig -> sig Source #

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

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

reverse :: sig -> sig Source #

Instances

Transform LazySize Source # 
Transform [y] Source # 

Methods

take :: Int -> [y] -> [y] Source #

drop :: Int -> [y] -> [y] Source #

dropMarginRem :: Int -> Int -> [y] -> (Int, [y]) Source #

splitAt :: Int -> [y] -> ([y], [y]) Source #

reverse :: [y] -> [y] Source #

(Integral a, C a) => Transform (T a) Source # 

Methods

take :: Int -> T a -> T a Source #

drop :: Int -> T a -> T a Source #

dropMarginRem :: Int -> Int -> T a -> (Int, T a) Source #

splitAt :: Int -> T a -> (T a, T a) Source #

reverse :: T a -> T a Source #

(C a, C a) => Transform (T a) Source # 

Methods

take :: Int -> T a -> T a Source #

drop :: Int -> T a -> T a Source #

dropMarginRem :: Int -> Int -> T a -> (Int, T a) Source #

splitAt :: Int -> T a -> (T a, T a) Source #

reverse :: T a -> T a Source #

Storable y => Transform (Vector y) Source # 

Methods

take :: Int -> Vector y -> Vector y Source #

drop :: Int -> Vector y -> Vector y Source #

dropMarginRem :: Int -> Int -> Vector y -> (Int, Vector y) Source #

splitAt :: Int -> Vector y -> (Vector y, Vector y) Source #

reverse :: Vector y -> Vector y Source #

Storable y => Transform (Vector y) Source # 

Methods

take :: Int -> Vector y -> Vector y Source #

drop :: Int -> Vector y -> Vector y Source #

dropMarginRem :: Int -> Int -> Vector y -> (Int, Vector y) Source #

splitAt :: Int -> Vector y -> (Vector y, Vector y) Source #

reverse :: Vector y -> Vector y Source #

Transform (T y) Source # 

Methods

take :: Int -> T y -> T y Source #

drop :: Int -> T y -> T y Source #

dropMarginRem :: Int -> Int -> T y -> (Int, T y) Source #

splitAt :: Int -> T y -> (T y, T y) Source #

reverse :: T y -> T y Source #

Transform (Chunk a) Source # 

Methods

take :: Int -> Chunk a -> Chunk a Source #

drop :: Int -> Chunk a -> Chunk a Source #

dropMarginRem :: Int -> Int -> Chunk a -> (Int, Chunk a) Source #

splitAt :: Int -> Chunk a -> (Chunk a, Chunk a) Source #

reverse :: Chunk a -> Chunk a Source #

(Integral t, C t) => Transform (T t y) Source # 

Methods

take :: Int -> T t y -> T t y Source #

drop :: Int -> T t y -> T t y Source #

dropMarginRem :: Int -> Int -> T t y -> (Int, T t y) Source #

splitAt :: Int -> T t y -> (T t y, T t y) Source #

reverse :: T t y -> T t y Source #

(Integral t, C t) => Transform (T t y) Source #

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.

However, sometimes we also need lists of events. In this case the reverse method would be different. For an event-oriented instance of EventList.TimeTime see NoteOffList in synthesizer-alsa package.

Methods

take :: Int -> T t y -> T t y Source #

drop :: Int -> T t y -> T t y Source #

dropMarginRem :: Int -> Int -> T t y -> (Int, T t y) Source #

splitAt :: Int -> T t y -> (T t y, T t y) Source #

reverse :: T t y -> T t y Source #

(Transform a, Transform b) => Transform (T a b) Source # 

Methods

take :: Int -> T a b -> T a b Source #

drop :: Int -> T a b -> T a b Source #

dropMarginRem :: Int -> Int -> T a b -> (Int, T a b) Source #

splitAt :: Int -> T a b -> (T a b, T a b) Source #

reverse :: T a b -> T a b Source #

dropMarginRemChunky :: Transform sig => (sig -> [Int]) -> Int -> Int -> sig -> (Int, sig) Source #

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

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

empty :: Monoid sig => sig Source #

cycle :: Monoid sig => sig -> sig Source #

append :: Monoid sig => sig -> sig -> sig Source #

concat :: Monoid sig => [sig] -> sig Source #

lengthAtLeast :: Transform sig => Int -> sig -> Bool Source #

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

lengthAtMost :: Transform sig => Int -> sig -> Bool Source #

sliceVertical :: Transform sig => Int -> sig -> T sig Source #