Safe Haskell | None |
---|---|
Language | Haskell98 |
Synopsis
- data T a
- type MV a = T (T a)
- constant :: (Aggregate ae al, C al) => ae -> T al
- fromArray :: (Natural n, C a) => ((n :*: SizeOf (Struct a)) ~ arrSize, Natural arrSize) => Exp (Array n a) -> MV a
- iterate :: C a => (Exp a -> Exp a) -> Exp a -> MV a
- takeWhile :: Aggregate ae a => (ae -> Exp Bool) -> T a -> T a
- take :: Exp Word -> T a -> T a
- tail :: T a -> T a
- drop :: Exp Word -> T a -> T a
- append :: (Phi a, Undefined a) => T a -> T a -> T a
- cycle :: (Phi a, Undefined a) => T a -> T a
- amplify :: (Aggregate ea a, C a, PseudoRing a) => ea -> T a -> T a
- osci :: (Fraction t, C t) => (forall r. T t -> CodeGenFunction r y) -> Exp t -> Exp t -> T y
- exponential2 :: C a => Real a => RationalConstant a => Transcendental a => Exp a -> Exp a -> MV a
- exponentialBounded2 :: C a => Real a => RationalConstant a => Transcendental a => Exp a -> Exp a -> Exp a -> MV a
- noise :: (C a, Transcendental a, RationalConstant a, NativeFloating a ar) => Exp Word32 -> Exp a -> MV a
- adjacentNodes02 :: C a => T a -> T (Nodes02 a)
- adjacentNodes13 :: (C a, T a ~ al) => Exp a -> T al -> T (Nodes13 al)
- interpolateConstant :: (C a, C b, IntegerConstant b, Additive b, Comparison b) => Exp b -> T a -> T a
- rampSlope :: (C a, Field a, IntegerConstant a) => Exp a -> MV a
- rampInf :: (C a, Field a, IntegerConstant a) => Exp a -> MV a
- ramp :: (C a, Field a, IntegerConstant a, NativeFloating a ar) => Exp Word -> MV a
- parabolaFadeInInf :: (C a, Field a, IntegerConstant a) => Exp a -> MV a
- parabolaFadeOutInf :: (C a, Field a, IntegerConstant a) => Exp a -> MV a
- parabolaFadeIn :: (C a, Field a, IntegerConstant a, NativeFloating a ar) => Exp Word -> MV a
- parabolaFadeOut :: (C a, Field a, IntegerConstant a, NativeFloating a ar) => Exp Word -> MV a
- parabolaFadeInMap :: (C a, Field a, IntegerConstant a, NativeFloating a ar) => Exp Word -> MV a
- parabolaFadeOutMap :: (C a, Field a, IntegerConstant a, NativeFloating a ar) => Exp Word -> MV a
Documentation
Instances
Functor T Source # | |
Applicative T Source # | |
(Field a, Real a, RationalConstant a) => Fractional (T a) Source # | |
(PseudoRing a, Real a, IntegerConstant a) => Num (T a) Source # | |
(Phi a, Undefined a) => Semigroup (T a) Source # | |
(Phi a, Undefined a) => Monoid (T a) Source # | |
(Field a, RationalConstant a) => C (T a) Source # | |
(PseudoRing a, IntegerConstant a) => C (T a) Source # | |
Additive a => C (T a) Source # | |
type ProcessOf T Source # | |
Defined in Synthesizer.LLVM.Causal.Private |
fromArray :: (Natural n, C a) => ((n :*: SizeOf (Struct a)) ~ arrSize, Natural arrSize) => Exp (Array n a) -> MV a Source #
append :: (Phi a, Undefined a) => T a -> T a -> T a Source #
Appending many signals is inefficient, since in cascadingly appended signals the parts are counted in an unary way. Concatenating infinitely many signals is impossible. If you want to concatenate a lot of signals, please render them to lazy storable vectors first.
osci :: (Fraction t, C t) => (forall r. T t -> CodeGenFunction r y) -> Exp t -> Exp t -> T y Source #
exponential2 :: C a => Real a => RationalConstant a => Transcendental a => Exp a -> Exp a -> MV a Source #
exponentialBounded2 :: C a => Real a => RationalConstant a => Transcendental a => Exp a -> Exp a -> Exp a -> MV a Source #
noise :: (C a, Transcendental a, RationalConstant a, NativeFloating a ar) => Exp Word32 -> Exp a -> MV a Source #
noise seed rate
The rate
parameter is for adjusting the amplitude
such that it is uniform across different sample rates
and after frequency filters.
The rate
is the ratio of the current sample rate to the default sample rate,
where the variance of the samples would be one.
If you want that at sample rate 22050 the variance is 1,
then in order to get a consistent volume at sample rate 44100
you have to set rate = 2
.
I use the variance as quantity and not the amplitude, because the amplitude makes only sense for uniformly distributed samples. However, frequency filters transform the probabilistic density of the samples towards the normal distribution according to the central limit theorem.
interpolateConstant :: (C a, C b, IntegerConstant b, Additive b, Comparison b) => Exp b -> T a -> T a Source #
Stretch signal in time by a certain factor.
This can be used for doing expensive computations
of filter parameters at a lower rate.
Alternatively, we could provide an adaptive map
that recomputes output values only if the input value changes,
or if the input value differs from the last processed one by a certain amount.
parabolaFadeInInf :: (C a, Field a, IntegerConstant a) => Exp a -> MV a Source #
parabolaFadeOutInf :: (C a, Field a, IntegerConstant a) => Exp a -> MV a Source #
parabolaFadeIn :: (C a, Field a, IntegerConstant a, NativeFloating a ar) => Exp Word -> MV a Source #
parabolaFadeOut :: (C a, Field a, IntegerConstant a, NativeFloating a ar) => Exp Word -> MV a Source #
parabolaFadeInMap :: (C a, Field a, IntegerConstant a, NativeFloating a ar) => Exp Word -> MV a Source #
parabolaFadeOutMap :: (C a, Field a, IntegerConstant a, NativeFloating a ar) => Exp Word -> MV a Source #