Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell98 |
Synopsis
- data T a b
- type MV a b = T (T a) (T b)
- fromSignal :: C process => SignalOf process b -> process a b
- toSignal :: C process => process () a -> SignalOf process a
- ($<) :: C process => process (a, b) c -> SignalOf process a -> process b c
- ($>) :: C process => process (a, b) c -> SignalOf process b -> process a c
- ($*) :: C process => process a b -> SignalOf process a -> SignalOf process b
- ($<#) :: (C process, C a) => process (T a, b) c -> a -> process b c
- ($>#) :: (C process, C b) => process (a, T b) c -> b -> process a c
- ($*#) :: (C process, SignalOf process ~ signal, C a) => process (T a) b -> a -> signal b
- map :: (Aggregate ae a, Aggregate be b) => (ae -> be) -> T a b
- zipWith :: (Aggregate ae a, Aggregate be b, Aggregate ce c) => (ae -> be -> ce) -> T (a, b) c
- takeWhile :: Aggregate ae a => (ae -> Exp Bool) -> T a a
- take :: Exp Word -> T a a
- mix :: Additive a => T (a, a) a
- raise :: (C a, Additive a) => Exp a -> MV a a
- envelope :: PseudoRing a => T (a, a) a
- envelopeStereo :: PseudoRing a => T (a, T a) (T a)
- amplify :: (Aggregate ea a, C a, PseudoRing a) => ea -> T a a
- amplifyStereo :: (C a, PseudoRing a, T (T a) ~ stereo) => Exp a -> T stereo stereo
- mapLinear :: (C a, T a ~ am, PseudoRing a, IntegerConstant a) => Exp a -> Exp a -> T am am
- mapExponential :: (C a, T a ~ am, Transcendental a, RationalConstant a) => Exp a -> Exp a -> T am am
- loop :: (Aggregate ce c, C c) => ce -> T (a, c) (b, c) -> T a b
- loopZero :: (Additive c, C c) => T (a, c) (b, c) -> T a b
- integrate :: (Aggregate ae a, Additive a, C a) => ae -> T a a
- integrateZero :: (Additive a, C a) => T a a
- delay1 :: (Aggregate ae a, C a) => ae -> T a a
- delayControlled :: (Aggregate ae al, C al) => ae -> Exp Word -> T (T Word, al) al
- delayControlledInterpolated :: C nodes => T a ~ am => (NativeFloating a ar, Additive a) => (Aggregate ve v, C v) => (forall r. T r nodes am v) -> ve -> Exp Word -> T (am, v) v
- differentiate :: (Additive a, Aggregate ae a, C a) => ae -> T a a
- feedbackControlled :: (Aggregate ce c, C c) => ce -> T ((ctrl, a), c) b -> T (ctrl, b) c -> T (ctrl, a) b
- feedbackControlledZero :: (Additive c, C c) => T ((ctrl, a), c) b -> T (ctrl, b) c -> T (ctrl, a) b
- mapAccum :: (Aggregate state statel, C statel, Aggregate a al, Aggregate b bl) => (a -> state -> (b, state)) -> state -> T al bl
- fromModifier :: (Aggregate ae al, Aggregate be bl, Aggregate ce cl, Aggregate se sl, C sl) => Simple se ce ae be -> T (cl, al) bl
- osciCoreSync :: (C t, Fraction t) => T (t, t) t
- osciCore :: (C t, Fraction t) => T (t, t) t
- osci :: (C t, Fraction t) => (forall r. t -> CodeGenFunction r y) -> T (t, t) y
- shapeModOsci :: (C t, Fraction t) => (forall r. c -> t -> CodeGenFunction r y) -> T (c, (t, t)) y
- skip :: (Undefined a, Phi a, C a) => T a -> T (T Word) a
- frequencyModulation :: (C a, IntegerConstant a, Additive a, Comparison a, Undefined nodes, Phi nodes, C nodes) => (forall r. T a -> nodes -> CodeGenFunction r v) -> T nodes -> T (T a) v
- frequencyModulationLinear :: (PseudoRing a, IntegerConstant a, Comparison a, C a) => MV a -> MV a a
- quantizeLift :: (C b, C c, IntegerConstant c, Additive c, Comparison c) => T a b -> T (T c, a) b
- track :: (Aggregate ae al, C al) => ae -> Exp Word -> T al (T al)
- delay :: (Aggregate ae al, C al) => ae -> Exp Word -> T al al
- delayZero :: (Aggregate ae al, C ae, C al) => Exp Word -> T al al
- replicateControlled :: (Undefined a, Phi a) => Exp Word -> T (c, a) a -> T (c, a) a
- replicateControlledParam :: Natural n => (Undefined a, Phi a) => (C b, (n :*: SizeOf (Struct b)) ~ bSize, Natural bSize) => (Exp b -> T (c, a) a) -> Exp (Array n b) -> T (c, a) a
- stereoFromMono :: (Phi a, Undefined a, Phi b, Undefined b) => T a b -> T (T a) (T b)
- stereoFromMonoControlled :: (Phi a, Phi b, Phi c, Undefined a, Undefined b, Undefined c) => T (c, a) b -> T (c, T a) (T b)
- stereoFromMonoParameterized :: (C x, Phi a, Undefined a, Phi b, Undefined b) => ((D2 :*: SizeOf (Struct x)) ~ xSize, Natural xSize) => (Exp x -> T a b) -> T (Exp x) -> T (T a) (T b)
- comb :: (C a, PseudoRing a) => Exp a -> Exp Word -> MV a a
- combStereo :: (C a, PseudoRing a, T (T a) ~ stereo) => Exp a -> Exp Word -> T stereo stereo
- reverbExplicit :: (Natural n, (n :*: UnknownSize) ~ paramSize, Natural paramSize) => (C a, Field a, Real a, IntegerConstant a) => Exp (Array n (a, Word)) -> MV a a
- reverbParams :: (RandomGen g, Integer n, Random a) => g -> Proxy n -> (a, a) -> (Word, Word) -> Array n (a, Word)
- trigger :: (C a, Undefined b, Phi b) => (Exp a -> T b) -> T (T (T a)) (T b)
- arrayElement :: (C a, Struct a ~ aStruct, IsFirstClass aStruct, Natural i, Natural n, i :<: n) => Proxy i -> T (T (Array n a)) (T a)
- vectorize :: (Positive n, C x, T x ~ a, T n x ~ va, C y, T y ~ b, T n y ~ vb) => T a b -> T va vb
- pipeline :: (Positive n, C x, v ~ T n x, a ~ T x, Zero v, C v) => T v v -> T a a
Documentation
Instances
Arrow T Source # | |
C T Source # | |
Category T Source # | |
Applicative (T a) Source # | |
Functor (T a) Source # | |
(PseudoRing b, Real b, IntegerConstant b) => Num (T a b) Source # | |
(Field b, Real b, RationalConstant b) => Fractional (T a b) Source # | |
Additive b => C (T a b) Source # | |
(Field b, RationalConstant b) => C (T a b) Source # | |
(PseudoRing b, IntegerConstant b) => C (T a b) Source # | |
type SignalOf T Source # | |
Defined in Synthesizer.LLVM.Causal.Private |
fromSignal :: C process => SignalOf process b -> process a b #
($*#) :: (C process, SignalOf process ~ signal, C a) => process (T a) b -> a -> signal b infixl 0 Source #
provide constant input in a comfortable way
zipWith :: (Aggregate ae a, Aggregate be b, Aggregate ce c) => (ae -> be -> ce) -> T (a, b) c Source #
envelopeStereo :: PseudoRing a => T (a, T a) (T a) Source #
amplifyStereo :: (C a, PseudoRing a, T (T a) ~ stereo) => Exp a -> T stereo stereo Source #
mapExponential :: (C a, T a ~ am, Transcendental a, RationalConstant a) => Exp a -> Exp a -> T am am Source #
delayControlled :: (Aggregate ae al, C al) => ae -> Exp Word -> T (T Word, al) al Source #
Delay by a variable amount of samples.
The momentum delay must be between 0
and maxTime
, inclusively.
How about automated clipping?
delayControlledInterpolated :: C nodes => T a ~ am => (NativeFloating a ar, Additive a) => (Aggregate ve v, C v) => (forall r. T r nodes am v) -> ve -> Exp Word -> T (am, v) v Source #
Delay by a variable fractional amount of samples.
Non-integer delays are achieved by interpolation.
The momentum delay must be between 0
and maxTime
, inclusively.
feedbackControlled :: (Aggregate ce c, C c) => ce -> T ((ctrl, a), c) b -> T (ctrl, b) c -> T (ctrl, a) b Source #
feedbackControlledZero :: (Additive c, C c) => T ((ctrl, a), c) b -> T (ctrl, b) c -> T (ctrl, a) b Source #
mapAccum :: (Aggregate state statel, C statel, Aggregate a al, Aggregate b bl) => (a -> state -> (b, state)) -> state -> T al bl Source #
fromModifier :: (Aggregate ae al, Aggregate be bl, Aggregate ce cl, Aggregate se sl, C sl) => Simple se ce ae be -> T (cl, al) bl Source #
osciCoreSync :: (C t, Fraction t) => T (t, t) t Source #
Compute the phases from phase distortions and frequencies.
It's like integrate but with wrap-around performed by fraction
.
For FM synthesis we need also negative phase distortions,
thus we use addToPhase
which supports that.
osciCore :: (C t, Fraction t) => T (t, t) t Source #
Compute the phases from phase distortions and frequencies.
It's like integrate but with wrap-around performed by fraction
.
For FM synthesis we need also negative phase distortions,
thus we use addToPhase
which supports that.
shapeModOsci :: (C t, Fraction t) => (forall r. c -> t -> CodeGenFunction r y) -> T (c, (t, t)) y Source #
skip :: (Undefined a, Phi a, C a) => T a -> T (T Word) a Source #
Feeds a signal into a causal process while holding or skipping signal elements according to the process input. The skip happens after a value is passed from the fed signal.
skip x $* 0
repeats the first signal value in the output.
skip x $* 1
feeds the signal to the output as is.
skip x $* 2
feeds the signal to the output with double speed.
frequencyModulation :: (C a, IntegerConstant a, Additive a, Comparison a, Undefined nodes, Phi nodes, C nodes) => (forall r. T a -> nodes -> CodeGenFunction r v) -> T nodes -> T (T a) v Source #
frequencyModulationLinear :: (PseudoRing a, IntegerConstant a, Comparison a, C a) => MV a -> MV a a Source #
quantizeLift :: (C b, C c, IntegerConstant c, Additive c, Comparison c) => T a b -> T (T c, a) b Source #
delay :: (Aggregate ae al, C al) => ae -> Exp Word -> T al al Source #
Delay time must be non-negative.
replicateControlledParam :: Natural n => (Undefined a, Phi a) => (C b, (n :*: SizeOf (Struct b)) ~ bSize, Natural bSize) => (Exp b -> T (c, a) a) -> Exp (Array n b) -> T (c, a) a Source #
stereoFromMono :: (Phi a, Undefined a, Phi b, Undefined b) => T a b -> T (T a) (T b) Source #
Run a causal process independently on each stereo channel.
stereoFromMonoControlled :: (Phi a, Phi b, Phi c, Undefined a, Undefined b, Undefined c) => T (c, a) b -> T (c, T a) (T b) Source #
stereoFromMonoParameterized :: (C x, Phi a, Undefined a, Phi b, Undefined b) => ((D2 :*: SizeOf (Struct x)) ~ xSize, Natural xSize) => (Exp x -> T a b) -> T (Exp x) -> T (T a) (T b) Source #
comb :: (C a, PseudoRing a) => Exp a -> Exp Word -> MV a a Source #
Delay time must be greater than zero!
combStereo :: (C a, PseudoRing a, T (T a) ~ stereo) => Exp a -> Exp Word -> T stereo stereo Source #
reverbExplicit :: (Natural n, (n :*: UnknownSize) ~ paramSize, Natural paramSize) => (C a, Field a, Real a, IntegerConstant a) => Exp (Array n (a, Word)) -> MV a a Source #
reverbParams :: (RandomGen g, Integer n, Random a) => g -> Proxy n -> (a, a) -> (Word, Word) -> Array n (a, Word) Source #
arrayElement :: (C a, Struct a ~ aStruct, IsFirstClass aStruct, Natural i, Natural n, i :<: n) => Proxy i -> T (T (Array n a)) (T a) Source #
Read the i-th element from each array.
vectorize :: (Positive n, C x, T x ~ a, T n x ~ va, C y, T y ~ b, T n y ~ vb) => T a b -> T va vb Source #
pipeline :: (Positive n, C x, v ~ T n x, a ~ T x, Zero v, C v) => T v v -> T a a Source #
This allows to compute a chain of equal processes efficiently, if all of these processes can be bundled in one vectorial process. Applications are an allpass cascade or an FM operator cascade.
The function expects that the vectorial input process works like parallel scalar processes. The different pipeline stages may be controlled by different parameters, but the structure of all pipeline stages must be equal. Our function feeds the input of the pipelined process to the zeroth element of the Vector. The result of processing the i-th element (the i-th channel, so to speak) is fed to the (i+1)-th element. The (n-1)-th element of the vectorial process is emitted as output of the pipelined process.
The pipeline necessarily introduces a delay of (n-1) values.
For simplification we extend this to n values delay.
If you need to combine the resulting signal from the pipeline
with another signal in a zip
-like way,
you may delay that signal with pipeline id
.
The first input values in later stages of the pipeline
are initialized with zero.
If this is not appropriate for your application,
then we may add a more sensible initialization.