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

Safe HaskellNone




newtype T s sig Source

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.




decons :: sig Bool


Monoid (sig Bool) => Monoid (T s sig) 
Read (sig Bool) => Read (T s sig) 
Transform (sig Bool) => Transform (T s sig) 

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.