synthesizer-llvm-0.9: Efficient signal processing using runtime compilation

Safe HaskellNone

Synthesizer.LLVM.CausalParameterized.Helix

Contents

Description

Synopsis

time and phase control based on the helix model

static :: (C vh, ValueOf vh ~ v, C nodesStep, C nodesLeap, RationalConstant a, Fraction a, C a, ValueOf a ~ Value a, IsPrimitive a) => (forall r. T r nodesLeap (Value a) v) -> (forall r. T r nodesStep (Value a) v) -> T p Int -> T p a -> T p (Vector vh) -> T p (Value a, Value a) vSource

Inputs are (shape, phase).

The shape parameter is limited at the beginning and at the end such that only available data is used for interpolation. Actually, we allow almost one step less than possible, since the right boundary of the interval of admissible shape values is open.

staticPacked :: (C vh, ValueOf vh ~ ve, Element v ~ ve, C nodesStep, C nodesLeap, Size (nodesLeap (nodesStep v)) ~ n, C (nodesLeap (nodesStep v)), Element (nodesLeap (nodesStep v)) ~ nodesLeap (nodesStep (Element v)), Positive n, RationalConstant a, Fraction a, Real a, C a, ValueOf a ~ Value a, IsPrimitive a) => (forall r. T r nodesLeap (Value n a) v) -> (forall r. T r nodesStep (Value n a) v) -> T p Int -> T p a -> T p (Vector vh) -> T p (Value n a, Value n a) vSource

dynamic :: (C nodesStep, C nodesLeap, Additive v, C v, RationalConstant a, Fraction a, C a, ValueOf a ~ Value a, IsPrimitive a, CmpRet a) => (forall r. T r nodesLeap (Value a) v) -> (forall r. T r nodesStep (Value a) v) -> T p Int -> T p a -> T p v -> T p (Value a, Value a) vSource

If the time control exceeds the end of the input signal, then the last waveform is locked. This is analogous to static.

dynamicLimited :: (C nodesStep, C nodesLeap, Additive v, C v, RationalConstant a, Fraction a, C a, ValueOf a ~ Value a, IsPrimitive a, CmpRet a) => (forall r. T r nodesLeap (Value a) v) -> (forall r. T r nodesStep (Value a) v) -> T p Int -> T p a -> T p v -> T p (Value a, Value a) vSource

In contrast to dynamic this one ends when the end of the manipulated signal is reached.

useful control curves

zigZag :: (C a, ValueOf a ~ Value a, Fraction a, IsFloating a, RationalConstant a, CmpRet a) => T p a -> T p (Value a) (Value a)Source

zigZag start creates a zig-zag curve with values between 0 and 1, inclusively, that is useful as shape control for looping a sound. Input of the causal process is the slope (or frequency) control. Slope values must not be negative. The start value must be at most 2 and may be negative.

zigZagPacked :: (C a, ValueOf a ~ Value a, Fraction a, IsFloating a, Real a, RationalConstant a, CmpRet a, Positive n) => T p a -> T p (Value n a) (Value n a)Source

zigZagLong :: (C a, ValueOf a ~ Value a, Fraction a, IsFloating a, RationalConstant a, CmpRet a, C a) => T p a -> T p a -> T p (Value a) (Value a)Source

zigZagLong loopStart loopLength creates a curve that starts at 0 and is linear until it reaches loopStart+loopLength. Then it begins looping in a ping-pong manner between loopStart+loopLength and loopStart. It is useful as shape control for looping a sound. Input of the causal process is the slope (or frequency) control. Slope values must not be negative.

  • Main> Sig.renderChunky SVL.defaultChunkSize (Causal.take 25 <<< Helix.zigZagLong 6 10 $* 2) () :: SVL.Vector Float VectorLazy.fromChunks [Vector.pack [0.0,1.999999,3.9999995,6.0,8.0,10.0,12.0,14.0,15.999999,14.000001,12.0,10.0,7.999999,6.0,8.0,10.0,12.0,14.0,16.0,14.0,11.999999,9.999998,7.999998,6.0000024,8.000002]]

zigZagLongPacked :: (C a, ValueOf a ~ Value a, Vector n a, VectorValueOf n a ~ Value (Vector n a), Fraction a, RationalConstant a, Real a, IsPrimitive a, C a, (n :*: SizeOf a) ~ asize, Positive asize, Positive n) => T p a -> T p a -> T p (Value n a) (Value n a)Source