Signals equipped with volume and sample rate information that may carry a unit. Kind of volume and sample rate is configurable by types.
- data T rate amplitude body
- type R s v y yv = T (Phantom s) (Dimensional v y) (T yv)
- asTypeOfAmplitude :: y -> T rate (Dimensional v y) sig -> y
- cache :: Storable yv => T rate amp (T yv) -> T rate amp (T yv)
- 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
- 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
- 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))
- restore :: Read sig yv => T rate amp (sig yv) -> T rate amp (T yv)
- ($-) :: (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 a
- ($&) :: Applicative f => f (a -> b) -> f a -> f b
- (&*^) :: (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))
- (&*>^) :: amp -> T s u t (T rate (Flat y) sig) -> T s u t (T rate (Numeric amp) sig)
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.
ToDo:
Maybe we should support zipped signals with mixed amplitudes,
e.g. T rate (amp0, amp1) (Sig.T (y0,y1))
in order to be compliant with the way
Causal
and Wave.Controlled
handle multiple sources.
However, this is dangerous, since T rate amp (Sig.T (y0,y1))
might be used for stereo signals.
Of course, for stereo signals Stereo.T
should be prefered.
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.
asTypeOfAmplitude :: y -> T rate (Dimensional v y) sig -> ySource
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
($-) :: (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