Safe Haskell | None |
---|---|
Language | Haskell2010 |
Documentation
We want to represent streams of discrete events
in a manner that is more safe than plain [Bool]
.
Each peak can be imagined as a Dirac impulse.
A [Bool]
could be used accidentally for selectBool
,
where selectBool
is intended for piecewise constant control curves.
You may think that a type like Peak = Peak Bool
as sample type
in T s Peak
would also do the job.
Actually, this wouldn't be a good idea
since you can apply constant interpolation on it,
which obviously fools the idea of a peak.
This type is so level that it could be moved to Synthesizer.Generic.Dirac.
toAmplitudeSignal :: (C q, C u, Functor sig) => T s u q (T s sig -> T (Phantom s) (Numeric (T (Recip u) q)) (sig q)) Source #
This is the most frequently needed transformation of a stream of peaks, if not the only one. It converts to a signal of peaks with area 1. This convention is especially useful for smoothing filters that produce frequency progress curves from zero crossings.