Copyright | (c) Henning Thielemann 2006 |
---|---|
License | GPL |
Maintainer | synthesizer@henning-thielemann.de |
Stability | provisional |
Portability | requires multi-parameter type classes |
Safe Haskell | None |
Language | Haskell2010 |
Waveforms which are smoothed according to the oscillator frequency in order to suppress aliasing effects.
Synopsis
- data T t y
- fromFunction :: (t -> t -> y) -> T t y
- fromWave :: (C t, C t, C y) => T t y -> T t y
- fromControlledWave :: (C t, C t, C y) => (t -> T t y) -> T t y
- raise :: C y => y -> T t y -> T t y
- amplify :: C y => y -> T t y -> T t y
- distort :: (y -> z) -> T t y -> T t z
- apply :: T t y -> t -> T t -> y
- sine :: (C a, C a) => T a a
- cosine :: (C a, C a) => T a a
- saw :: (C a, C a) => T a a
- square :: (C a, C a) => T a a
- triangle :: (C a, C a) => T a a
- data Harmonic a
- harmonic :: T a -> a -> Harmonic a
- composedHarmonics :: (C a, C a) => [Harmonic a] -> T a a
Documentation
fromFunction :: (t -> t -> y) -> T t y Source #
fromWave :: (C t, C t, C y) => T t y -> T t y Source #
Use this function for waves which are sufficiently smooth. If the Nyquist frequency is exceeded the wave is simply replaced by a constant zero wave.
saw :: (C a, C a) => T a a Source #
saw tooth, it's a ramp down in order to have a positive coefficient for the first partial sine
This is similar to Polar coordinates,
but the range of the phase is from 0
to 1
, not 0
to 2*pi
.
If you need to represent a harmonic by complex coefficients
instead of the polar representation,
then please build a complex valued polynomial from your coefficients
and use it to distort a helix
.
distort (Poly.evaluate (Poly.fromCoeffs complexCoefficients)) helix