synthesizer-dimensional-0.8.1: Audio signal processing with static physical dimensions

Safe HaskellNone
LanguageHaskell2010

Synthesizer.Dimensional.Signal.Private

Contents

Description

Signals equipped with volume and sample rate information that may carry a unit. Kind of volume and sample rate is configurable by types.

Synopsis

Documentation

data T rate amplitude body Source #

A signal value 0.5 at global amplitude 1 and signal value 1 at global amplitude 0.5 shall represent the same signal. Thus observing the amplitude breaks the abstraction.

Cyclic nature such as needed for Fourier transform must be expressend in the body. It would be nice to use the data type for waveforms, too, but for waveforms the rate parameter makes no sense.

Constructors

Cons 

Fields

type R s v y yv = T (Phantom s) (Dimensional v y) (T yv) Source #

actualSampleRate :: T (Actual rate) amp sig -> rate Source #

actualAmplitude :: T rate (Numeric amp) sig -> amp Source #

toAmplitudeScalar :: (C y, C v) => T rate (Dimensional v y) sig -> T v y -> y Source #

rewriteAmplitudeDimension :: (C v0, C v1) => (v0 -> v1) -> T rate (Dimensional v0 y) sig -> T rate (Dimensional v1 y) sig Source #

asTypeOfAmplitude :: y -> T rate (Dimensional v y) sig -> y Source #

scalarSamples :: (C y, Transform sig y) => (amp -> y) -> T rate (Numeric amp) (sig y) -> sig y Source #

vectorSamples :: (C y yv, Transform sig yv) => (amp -> y) -> T rate (Numeric amp) (sig yv) -> sig yv Source #

embedSampleRate :: C u => T s u t (T (Phantom s) amp sig -> T (Dimensional u t) amp sig) Source #

render :: C u => T (Recip u) t -> (forall s. T s u t (T (Phantom s) amp sig)) -> T (Dimensional u t) amp sig Source #

apply :: C u => (forall s. T s u t (T (Phantom s) amp0 sig0 -> T (Phantom s) amp1 sig1)) -> T (Dimensional u t) amp0 sig0 -> T (Dimensional u t) amp1 sig1 Source #

zip :: (Transform sig y1, Transform sig (y0, y1), Read sig y0) => T (Phantom s) amp0 (sig y0) -> T (Phantom s) amp1 (sig y1) -> T (Phantom s) (amp0, amp1) (sig (y0, y1)) Source #

processBody :: (sig0 -> sig1) -> T rate amp sig0 -> T rate amp sig1 Source #

replaceBody :: sig1 -> T rate amp sig0 -> T rate amp sig1 Source #

fromBody :: amp -> sig -> T (Phantom s) (Numeric amp) sig Source #

flatFromBody :: sig -> T (Phantom s) (Flat y) sig Source #

primitiveFromBody :: Primitive amp => sig -> T (Phantom s) amp sig Source #

caching

cache :: Storable yv => T rate amp (T yv) -> T rate amp (T yv) Source #

bindCached :: Storable yv => T s u t (T rate amp (T yv)) -> (T rate amp (T yv) -> T s u t b) -> T s u t b Source #

share :: Storable yv => T s u t (T rate amp (T yv)) -> (T s u t (T rate amp (T yv)) -> T s u t b) -> T s u t b Source #

store :: (C t, C u, Storable yv) => T u t -> T s u t (T (Phantom s) amp (T yv) -> T (Phantom s) amp (T yv)) Source #

restore :: Read sig yv => T rate amp (sig yv) -> T rate amp (T yv) Source #

toStorableInt16Stereo :: (C a a, C a) => T rate (Dimensional Voltage a) (T (T a)) -> T (T Int16) Source #