synthesizer-llvm-0.8.2: 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 :: (Storable vh, MakeValueTuple vh, ValueTuple vh ~ v, C v, C nodesStep, C nodesLeap, RationalConstant a, Fraction a, Storable a, MakeValueTuple a, ValueTuple a ~ Value a, FirstClass a, Stored a ~ am, IsSized am, NumberOfElements a ~ D1) => (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 :: (Storable vh, MakeValueTuple vh, ValueTuple vh ~ ve, Element v ~ ve, C 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, Storable a, MakeValueTuple a, ValueTuple a ~ Value a, FirstClass a, Stored a ~ am, IsSized am, IsPrimitive a, IsPrimitive am) => (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, CmpRet a, CmpResult a ~ Bool, Storable a, MakeValueTuple a, ValueTuple a ~ Value a, FirstClass a, Stored a ~ am, IsSized am, NumberOfElements a ~ D1) => (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, CmpRet a, CmpResult a ~ Bool, Storable a, MakeValueTuple a, ValueTuple a ~ Value a, FirstClass a, Stored a ~ am, IsSized am, NumberOfElements a ~ D1) => (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 :: (Storable a, MakeValueTuple a, ValueTuple a ~ Value a, FirstClass a, Stored a ~ am, IsSized am, 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.

zigZagLong :: (Storable a, MakeValueTuple a, ValueTuple a ~ Value a, FirstClass a, Stored a ~ am, IsSized am, 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 :: (Storable a, MakeValueTuple a, ValueTuple a ~ Value a, Fraction a, RationalConstant a, Real a, FirstClass a, Stored a ~ am, IsSized am, IsPrimitive am, C a, (n :*: SizeOf am) ~ amsize, Positive amsize, Positive n) => T p a -> T p a -> T p (Value n a) (Value n a)Source