Safe Haskell | None |
---|---|
Language | Haskell2010 |
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 = Cons {
- sampleRate :: rate
- amplitude :: amplitude
- body :: body
- type R s v y yv = T (Phantom s) (Dimensional v y) (T yv)
- actualSampleRate :: T (Actual rate) amp sig -> rate
- actualAmplitude :: T rate (Numeric amp) sig -> amp
- toAmplitudeScalar :: (C y, C v) => T rate (Dimensional v y) sig -> T v y -> y
- rewriteAmplitudeDimension :: (C v0, C v1) => (v0 -> v1) -> T rate (Dimensional v0 y) sig -> T rate (Dimensional v1 y) sig
- asTypeOfAmplitude :: y -> T rate (Dimensional v y) sig -> y
- scalarSamples :: (C y, Transform sig y) => (amp -> y) -> T rate (Numeric amp) (sig y) -> sig y
- vectorSamples :: (C y yv, Transform sig yv) => (amp -> y) -> T rate (Numeric amp) (sig yv) -> sig yv
- embedSampleRate :: C u => T s u t (T (Phantom s) amp sig -> T (Dimensional u t) amp sig)
- render :: C u => T (Recip u) t -> (forall s. T s u t (T (Phantom s) amp sig)) -> T (Dimensional u t) amp sig
- 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
- 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))
- processBody :: (sig0 -> sig1) -> T rate amp sig0 -> T rate amp sig1
- replaceBody :: sig1 -> T rate amp sig0 -> T rate amp sig1
- fromBody :: amp -> sig -> T (Phantom s) (Numeric amp) sig
- flatFromBody :: sig -> T (Phantom s) (Flat y) sig
- abstractFromBody :: sig -> T (Phantom s) Abstract sig
- primitiveFromBody :: Primitive amp => sig -> T (Phantom s) amp sig
- 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)
- toStorableInt16Mono :: C a => T rate (Dimensional Voltage a) (T a) -> T Int16
- toStorableInt16Stereo :: (C a a, C a) => T rate (Dimensional Voltage a) (T (T a)) -> T (T Int16)
- defaultChunkSize :: ChunkSize
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.
Cons | |
|
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 #
caching
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 #
toStorableInt16Mono :: C a => T rate (Dimensional Voltage a) (T a) -> T Int16 Source #