|
|
|
|
|
|
Synopsis |
|
|
|
|
Sound Generators |
|
osc |
:: [Double] | The sound to play. Output will be finite if sound is finite. | -> [Double] | Speed, 1.0 = normal,
0.0 < X < 1.0 = slower resp. lower,
1.0 < X = faster resp. higher,
X < 0.0 => X = abs X. | -> [Double] | Output | Play given sound with variable speed resp. frequency.
(General definition: Usually a frequency of 1.0 means a period of 1024 values).
Use scratchSample or scratchSampleSignal for backward playing. |
|
|
sinus :: [Double] -> [Double] |
A sinus wave generator with a period of 1024/N for frequency N |
|
cosinus :: [Double] -> [Double] |
A cosinus wave generator |
|
rect :: [Double] -> [Double] |
A rectangle wave generator |
|
saw :: [Double] -> [Double] |
A sawtooth wave generator |
|
tri :: [Double] -> [Double] |
A triangle wave generator |
|
randomList :: (Random a) => (a, a) -> [a] |
|
Functions for Lists |
|
sampleAndHold :: (Ord a, Num a) => b -> [a] -> [b] -> [b] |
Current output value is repeatet until the first list argument value switches from zero or below
to a non-zero positive value, the actual value of the second list argument is then taken for output. |
|
average :: (Fractional a) => Int -> [a] -> [a] |
Maps the values to the average of the last N values (including the actual) |
|
terminateAt :: Int -> (a -> Bool) -> [a] -> [a] |
If predicate holds for N elements, list is cut. |
|
follow :: Double -> [Double] -> [Double] -> [Double] |
|
Functions for single values |
|
These Functions can be used with map: |
|
compress :: Double -> Double -> Double |
compress p x = x / (abs p + abs x) |
|
noteToFrequency |
:: Double | Base, | -> Double | Notenumber | -> Double | 2 ^ (Notenumber / Base) | Transforms a notevalue into a frequency. A Notevalue of 0.0 means a frequency of 1.0. |
|
|
adjustFrequency |
:: Double | Period | -> Double | New Frequency (Hz) for old frequency of 1.0 | -> Double | Input Frequency | -> Double | Output Frequency | Adjusts the frequency. If given oscillator has period X for frequency of 1.0 and you want it to
produce a wave with Y Hz at frequency of 1.0, use map (adjustFrequency X Y) to adjust the
input of the oscillator. |
|
|
Other Functions |
|
These Functions are not simple (i. e. linear) list transformers: |
|
splitWaves :: [Double] -> [[Double]] |
Splits a wave into parts. they are split when a value equal or less than zero is followed by a
value greater than zero. |
|
crossfade |
:: [Double] | w1 | -> [Double] | w2 | -> [Double] | result | Create a wave with the beginning of w1, the ending of w2 and the length of the longer one of them. |
|
|
Produced by Haddock version HADDOCK_VERSION |