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

Safe HaskellNone

Synthesizer.Dimensional.Signal

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 it is unsafe to observe the amplitude.

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.

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

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

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

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 sig1Source

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 bSource

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 bSource

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

($-) :: (C y, C y, C u, C v) => T s u t (R s v y y -> a) -> T v y -> T s u t aSource

Take a scalar argument where a process expects a signal. Only possible for non-negative values so far.

($&) :: Applicative f => f (a -> b) -> f a -> f bSource

(&*^) :: (C y flat, Transform sig y) => amp -> T s u t (T rate flat (sig y)) -> T s u t (T rate (Numeric amp) (sig y))Source

(&*>^) :: amp -> T s u t (T rate (Flat y) sig) -> T s u t (T rate (Numeric amp) sig)Source