|Portability||requires multi-parameter type classes|
- amplify :: C a => a -> T a -> T a
- amplifyVector :: C a v => a -> T v -> T v
- envelope :: C a => T a -> T a -> T a
- envelopeVector :: C a v => T a -> T v -> T v
- fadeInOut :: C a => Int -> Int -> Int -> T a -> T a
- generic :: C a v => T a -> T v -> T v
- binomial :: (C a, C a, C a v) => a -> a -> T v -> T v
- ratioFreqToVariance :: C a => a -> a -> a
- binomial1 :: C v => T v -> T v
- sums :: C v => Int -> T v -> T v
- inverseFrequencyModulationFloor :: (Ord t, C t) => T t -> T v -> T v
- inverseFrequencyModulationCeiling :: (Ord t, C t) => T t -> T v -> T v
- inverseFrequencyModulationGen :: (Ord t, C t) => (t -> Bool) -> T t -> T v -> T v
- differentiate :: C v => T v -> T v
- differentiateCenter :: C v => T v -> T v
- differentiate2 :: C v => T v -> T v
Compute the variance of the Gaussian
such that its Fourier transform has value
ratio at frequency
Moving (uniformly weighted) average in the most trivial form.
This is very slow and needs about
n * length x operations.
This is inverse to frequency modulation.
If all control values in
ctrl are above one, then it holds:
frequencyModulation ctrl (inverseFrequencyModulationFloor ctrl xs) == xs .
inverseFrequencyModulationFloor is lossy.
For the precise property
we refer to Test.Sound.Synthesizer.Plain.Interpolation.
The modulation uses constant interpolation.
Other interpolation types are tricky to implement,
since they would need interpolation on non-equidistant grids.
Ok, at least linear interpolation could be supported
with acceptable effort,
but perfect reconstruction would be hard to get.
The process is not causal in any of its inputs,
however control and input are aligned.
If you use interpolation for resampling or frequency modulation, you may want to smooth the signal before resampling according to the local resampling factor. However you cannot simply use the resampling control to also control the smoothing, because of the subsequent distortion by resampling. Instead you have to stretch the control inversely to the resampling factor. This is the task of this function. It may be applied like:
frequencyModulation ctrl (smooth (inverseFrequencyModulationFloor ctrl ctrl) xs)
Filter operators from calculus
Forward difference quotient.
Shortens the signal by one.
Synthesizer.State.Filter.Recursive.Integration.run in the sense that
differentiate (zero : integrate x) == x.
The signal is shifted by a half time unit.
Central difference quotient.
Shortens the signal by two elements,
and shifts the signal by one element.
(Which can be fixed by prepending an appropriate value.)
For linear functions this will yield
essentially the same result as
You obtain the result of
if you smooth the one of
by averaging pairs of adjacent values.
ToDo: Vector variant