Sound.Hommage.Osc
 Contents Sound Generators Functions for Lists Functions for single values Other Functions
Synopsis
 osc :: [Double] -> [Double] -> [Double] sinus :: [Double] -> [Double] cosinus :: [Double] -> [Double] rect :: [Double] -> [Double] saw :: [Double] -> [Double] tri :: [Double] -> [Double] randomList :: Random a => (a, a) -> [a] sampleAndHold :: (Ord a, Num a) => b -> [a] -> [b] -> [b] average :: Fractional a => Int -> [a] -> [a] terminateAt :: Int -> (a -> Bool) -> [a] -> [a] follow :: Double -> [Double] -> [Double] -> [Double] compress :: Double -> Double -> Double noteToFrequency :: Double -> Double -> Double adjustFrequency :: Double -> Double -> Double -> Double splitWaves :: [Double] -> [[Double]] crossfade :: [Double] -> [Double] -> [Double]
Sound Generators
 osc Source
 :: [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] Source
A sinus wave generator with a period of 1024/N for frequency N
 cosinus :: [Double] -> [Double] Source
A cosinus wave generator
 rect :: [Double] -> [Double] Source
A rectangle wave generator
 saw :: [Double] -> [Double] Source
A sawtooth wave generator
 tri :: [Double] -> [Double] Source
A triangle wave generator
 randomList :: Random a => (a, a) -> [a] Source
Functions for Lists
 sampleAndHold :: (Ord a, Num a) => b -> [a] -> [b] -> [b] Source
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] Source
Maps the values to the average of the last N values (including the actual)
 terminateAt :: Int -> (a -> Bool) -> [a] -> [a] Source
If predicate holds for N elements, list is cut.
 follow :: Double -> [Double] -> [Double] -> [Double] Source
Functions for single values
These Functions can be used with map:
 compress :: Double -> Double -> Double Source
` compress p x = x / (abs p + abs x)`
 noteToFrequency Source
 :: 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.