Safe Haskell | None |
---|---|
Language | Haskell2010 |
A wrapper around (->)
or Causal.Process
that adds amplitude handling to the Arrow paradigm.
This wrapper unifies Synthesizer.Dimensional.Map
and Synthesizer.Dimensional.Causal.Process.
- newtype T arrow sample0 sample1 = Cons (Amplitude sample0 -> (arrow (Displacement sample0) (Displacement sample1), Amplitude sample1))
- type Single arrow amp0 amp1 yv0 yv1 = T arrow (T amp0 yv0) (T amp1 yv1)
- class C arrow => Applicable arrow rate
- apply :: (Transform sig (Displacement sample0), Transform sig (Displacement sample1), Applicable arrow rate) => T arrow sample0 sample1 -> T rate (Amplitude sample0) (sig (Displacement sample0)) -> T rate (Amplitude sample1) (sig (Displacement sample1))
- applyFlat :: (C yv0 amp0, Transform sig yv0, Transform sig yv1, Applicable arrow rate) => Single arrow (Flat yv0) amp1 yv0 yv1 -> T rate amp0 (sig yv0) -> T rate amp1 (sig yv1)
- canonicalizeFlat :: (C y flat, Arrow arrow) => Single arrow flat (Flat y) y y
- applyConst :: (C amp1, C y0, C arrow) => Single arrow (Numeric amp0) amp1 y0 yv1 -> amp0 -> T (Phantom s) amp1 (T yv1)
- ($/:) :: (Applicative f, Transform sig yv0, Transform sig yv1, Applicable arrow rate) => f (Single arrow amp0 amp1 yv0 yv1) -> f (T rate amp0 (sig yv0)) -> f (T rate amp1 (sig yv1))
- ($/-) :: (C amp1, Functor f, C y0, C arrow) => f (Single arrow (Numeric amp0) amp1 y0 yv1) -> amp0 -> f (T (Phantom s) amp1 (T yv1))
- id :: Category arrow => T arrow sample sample
- compose :: Category arrow => T arrow sample0 sample1 -> T arrow sample1 sample2 -> T arrow sample0 sample2
- arr :: (Arrow arrow, Build sample0, Inspect sample1) => (sample0 -> sample1) -> T arrow sample0 sample1
- first :: Arrow arrow => T arrow sample0 sample1 -> T arrow (sample0, sample) (sample1, sample)
- second :: Arrow arrow => T arrow sample0 sample1 -> T arrow (sample, sample0) (sample, sample1)
- split :: Arrow arrow => T arrow sample0 sample1 -> T arrow sample2 sample3 -> T arrow (sample0, sample2) (sample1, sample3)
- fanout :: Arrow arrow => T arrow sample sample0 -> T arrow sample sample1 -> T arrow sample (sample0, sample1)
- independentMap :: Arrow arrow => (Amplitude sample0 -> Amplitude sample1) -> (Displacement sample0 -> Displacement sample1) -> T arrow sample0 sample1
- double :: Arrow arrow => T arrow sample (sample, sample)
- forceDimensionalAmplitude :: (C v, C y, C y yv, Arrow arrow) => T v y -> Single arrow (Dimensional v y) (Dimensional v y) yv yv
- loop :: ArrowLoop arrow => T arrow (restSampleIn, sample) (restSampleOut, sample) -> T arrow restSampleIn restSampleOut
- loopVolume :: (C y, C y yv, C v, ArrowLoop arrow) => T v y -> T arrow (restSampleIn, T (Dimensional v y) yv) (restSampleOut, T (Dimensional v y) yv) -> T arrow restSampleIn restSampleOut
- loop2Volume :: (C y0, C y0 yv0, C v0, C y1, C y1 yv1, C v1, ArrowLoop arrow) => (T v0 y0, T v1 y1) -> T arrow (restSampleIn, (T (Dimensional v0 y0) yv0, T (Dimensional v1 y1) yv1)) (restSampleOut, (T (Dimensional v0 y0) yv0, T (Dimensional v1 y1) yv1)) -> T arrow restSampleIn restSampleOut
Documentation
newtype T arrow sample0 sample1 Source #
The sample type parameters
can be arbitrarily nested tuples of Samples
.
Type functions are used for untangling amplitudes and displacements.
We use this approach in order to be able to match
(as good as possible) the Arrow type class.
Cons (Amplitude sample0 -> (arrow (Displacement sample0) (Displacement sample1), Amplitude sample1)) |
Arrow arrow => Arrow (T arrow) Source # | This instance lacks an implementation for |
Category * arrow => Category * (T arrow) Source # | |
class C arrow => Applicable arrow rate Source #
Applicable (Core s) (Phantom s) Source # | |
Applicable ((->) LiftedRep LiftedRep) rate Source # | |
apply :: (Transform sig (Displacement sample0), Transform sig (Displacement sample1), Applicable arrow rate) => T arrow sample0 sample1 -> T rate (Amplitude sample0) (sig (Displacement sample0)) -> T rate (Amplitude sample1) (sig (Displacement sample1)) infixl 9 Source #
applyFlat :: (C yv0 amp0, Transform sig yv0, Transform sig yv1, Applicable arrow rate) => Single arrow (Flat yv0) amp1 yv0 yv1 -> T rate amp0 (sig yv0) -> T rate amp1 (sig yv1) Source #
applyConst :: (C amp1, C y0, C arrow) => Single arrow (Numeric amp0) amp1 y0 yv1 -> amp0 -> T (Phantom s) amp1 (T yv1) Source #
($/:) :: (Applicative f, Transform sig yv0, Transform sig yv1, Applicable arrow rate) => f (Single arrow amp0 amp1 yv0 yv1) -> f (T rate amp0 (sig yv0)) -> f (T rate amp1 (sig yv1)) infixl 0 Source #
($/-) :: (C amp1, Functor f, C y0, C arrow) => f (Single arrow (Numeric amp0) amp1 y0 yv1) -> amp0 -> f (T (Phantom s) amp1 (T yv1)) infixl 0 Source #
compose :: Category arrow => T arrow sample0 sample1 -> T arrow sample1 sample2 -> T arrow sample0 sample2 Source #
arr :: (Arrow arrow, Build sample0, Inspect sample1) => (sample0 -> sample1) -> T arrow sample0 sample1 Source #
This implementation would work for all f
s
where the output amplitude does not depend on the input displacement.
This is true for all shuffling operations
that are needed in the translation of the arrow syntax.
However, for the implementation we would need type constraints
of the function passed to arr
and this is not allowed.
first :: Arrow arrow => T arrow sample0 sample1 -> T arrow (sample0, sample) (sample1, sample) Source #
second :: Arrow arrow => T arrow sample0 sample1 -> T arrow (sample, sample0) (sample, sample1) Source #
split :: Arrow arrow => T arrow sample0 sample1 -> T arrow sample2 sample3 -> T arrow (sample0, sample2) (sample1, sample3) Source #
fanout :: Arrow arrow => T arrow sample sample0 -> T arrow sample sample1 -> T arrow sample (sample0, sample1) Source #
map functions
independentMap :: Arrow arrow => (Amplitude sample0 -> Amplitude sample1) -> (Displacement sample0 -> Displacement sample1) -> T arrow sample0 sample1 Source #
forceDimensionalAmplitude :: (C v, C y, C y yv, Arrow arrow) => T v y -> Single arrow (Dimensional v y) (Dimensional v y) yv yv Source #
loop :: ArrowLoop arrow => T arrow (restSampleIn, sample) (restSampleOut, sample) -> T arrow restSampleIn restSampleOut Source #
I will call the connection from input to output amplitudes of type amp
the looping channel.
It is essential, that the looping channel decouples output from input amplitude.
You can achieve this by inserting one of the forceAmplitude
functions
somewhere in the looping channel.
loopVolume :: (C y, C y yv, C v, ArrowLoop arrow) => T v y -> T arrow (restSampleIn, T (Dimensional v y) yv) (restSampleOut, T (Dimensional v y) yv) -> T arrow restSampleIn restSampleOut Source #
loop2Volume :: (C y0, C y0 yv0, C v0, C y1, C y1 yv1, C v1, ArrowLoop arrow) => (T v0 y0, T v1 y1) -> T arrow (restSampleIn, (T (Dimensional v0 y0) yv0, T (Dimensional v1 y1) yv1)) (restSampleOut, (T (Dimensional v0 y0) yv0, T (Dimensional v1 y1) yv1)) -> T arrow restSampleIn restSampleOut Source #