Euterpea-1.1.0: Library for computer music research and education

Safe HaskellNone
LanguageHaskell98

Euterpea.Experimental

Synopsis

Documentation

asyncUISFV :: (NFData c, ArrowReader DeltaT a, ArrowCircuit a, ArrowIO a) => Double -> DeltaT -> PureAuto b c -> a b [(c, Time)] Source

asyncUISFE :: (NFData c, ArrowCircuit a, ArrowIO a, ArrowChoice a) => PureAuto b c -> a (SEvent b) (SEvent c) Source

clockedSFToUISF :: forall a b c. (NFData b, Clock c) => DeltaT -> SigFun c a b -> UISF a [(b, Time)] Source

newtype Automaton a b c :: (* -> * -> *) -> * -> * -> *

An arrow type comprising Mealy-style automata, each step of which is is a computation in the original arrow type.

Constructors

Automaton (a b (c, Automaton a b c)) 

toAutomaton :: forall a b. SF a b -> Automaton (->) a b Source

quantize :: ArrowCircuit a => Int -> Int -> a b (SEvent [b]) Source

Alternative for working with Math.FFT instead of Numeric.FFT import qualified Math.FFT as FFT import Data.Array.IArray import Data.Array.CArray myFFT n lst = elems $ (FFT.dft) (listArray (0, n-1) lst)

Returns n samples of type b from the input stream at a time, updating after k samples. This function is good for chunking data and is a critical component to fftA

presentFFT :: Double -> [Double] -> Map Double Double Source

Converts the vector result of a dft into a map from frequency to magnitude. One common use is: fftA >>> arr (fmap $ presentFFT clockRate)

fftA :: ArrowCircuit a => Int -> Int -> a Double (SEvent [Double]) Source

Given a quantization frequency (the number of samples between each successive FFT calculation) and a fundamental period, this will decompose the input signal into its constituent frequencies. NOTE: The fundamental period must be a power of two!

liftAIO :: ArrowIO a => forall b c. (b -> IO c) -> a b c

The liftAIO function lifts an IO action into an arrow.

initialAIO :: ArrowIO a => forall d b c. IO d -> (d -> a b c) -> a b c

The initialAIO function performs an IO action once when the arrow is first initialized and then uses the result of that action to generate the arrow itself.

uisfSource :: IO b -> UISF () b

Lift an IO source to UISF.

uisfSink :: (a -> IO ()) -> UISF a ()

Lift an IO sink to UISF.

uisfPipe :: (a -> IO b) -> UISF a b

Lift an IO pipe to UISF.

uisfSourceE :: IO b -> UISF (SEvent ()) (SEvent b)

Lift an IO source to an event-based UISF.

uisfSinkE :: (a -> IO ()) -> UISF (SEvent a) (SEvent ())

Lift an IO sink to an event-based UISF.

uisfPipeE :: (a -> IO b) -> UISF (SEvent a) (SEvent b)

Lift an IO pipe to an event-based UISF.