synthesizer-core-0.8.1.2: Audio signal processing coded in Haskell: Low level part

Safe HaskellNone
LanguageHaskell2010

Synthesizer.Plain.Wave

Synopsis

Documentation

sample :: C a => T a v -> T v -> T a v Source #

sampledTone :: C a => T a v -> T a v -> a -> T v -> a -> T a v Source #

We assume that a tone was generated by a shape modulated oscillator. We try to reconstruct the wave function (with parameters shape control and phase) from a tone by interpolation.

The unit for the shape control parameter is the sampling period. That is the shape parameter is a time parameter pointing to a momentary shape of the prototype signal. Of course this momentary shape does not exist and we can only guess it using interpolation.

At the boundaries we repeat the outermost shapes that can be reconstructed entirely from interpolated data (that is, no extrapolation is needed). This way we cannot reproduce the shape at the boundaries because we have no data for cyclically extending it. On the other hand this method guarantees a nice wave shape with the required fractional period.

It must be length tone >= Interpolation.number ipStep + Interpolation.number ipLeap * ceiling period.