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

Safe HaskellNone
LanguageHaskell2010

Synthesizer.Dimensional.Rate.Dirac

Synopsis

Documentation

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.

Constructors

Cons 

Fields

Instances

Semigroup (sig Bool) => Semigroup (T s sig) Source # 

Methods

(<>) :: T s sig -> T s sig -> T s sig #

sconcat :: NonEmpty (T s sig) -> T s sig #

stimes :: Integral b => b -> T s sig -> T s sig #

Monoid (sig Bool) => Monoid (T s sig) Source # 

Methods

mempty :: T s sig #

mappend :: T s sig -> T s sig -> T s sig #

mconcat :: [T s sig] -> T s sig #

Read (sig Bool) => Read (T s sig) Source # 

Methods

null :: T s sig -> Bool #

length :: T s sig -> Int #

Transform (sig Bool) => Transform (T s sig) Source # 

Methods

take :: Int -> T s sig -> T s sig #

drop :: Int -> T s sig -> T s sig #

dropMarginRem :: Int -> Int -> T s sig -> (Int, T s sig) #

splitAt :: Int -> T s sig -> (T s sig, T s sig) #

reverse :: T s sig -> 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.