|
|
|
|
|
Description |
Dieses Module stellt Datentypen und Funktionen zum Umgang mit Mono- und
Stereodaten zur Verfügung. Speziell im Falle des Öffnens einer WAV-Datei
ist erst zur Laufzeit bekannt, ob es sich um eine Mono- oder Stereodatei
handelt, hier wird der Typ Signal benötigt. |
|
Synopsis |
|
|
|
|
Mono and Stereo Values |
|
type Mono = Double |
A mono value. |
|
data Stereo |
A stereo value with left and right part. It is an instance of class Num
and Fractional. | Constructors | | Instances | |
|
|
leftStereo :: Stereo -> Mono |
Access to the left part of a Stereo value. |
|
rightStereo :: Stereo -> Mono |
Access to the right part of a Stereo value. |
|
stereoToMono :: Stereo -> Mono |
Converts a Stereo value to a Mono value (Double) |
|
monoToStereo :: Mono -> Stereo |
Converts a Mono value (Double) to a Stereo value |
|
balance :: Double -> Stereo -> Stereo |
The range of the Double value must be between -1 and 1. If it is below 0
the left channel is turned down, if it is greater than 0 the right channel
is turned down. NOTE: This function should be replaced by a better one. |
|
Signal datatype |
|
data Signal |
A Signal is either a list of Mono values or a list of Stereo values. | Constructors | | Instances | |
|
|
readWavSignal :: FilePath -> IO Signal |
Reads a Signal from a WAV-File. |
|
openWavSignal :: FilePath -> Signal |
Opens a Signal from a WAV-File. |
|
writeWavMono :: FilePath -> [Mono] -> IO () |
Writes a list of mono values to a WAV-File. |
|
writeWavStereo :: FilePath -> [Stereo] -> IO () |
Writes a list of stereo values to a WAV-File. |
|
writeWavSignal :: FilePath -> Signal -> IO () |
Writes a Signal to a WAV-File. |
|
writeTracks :: FilePath -> [Signal] -> IO () |
|
signalToMono :: Signal -> [Mono] |
Transfroms a signal to a list of mono values. |
|
signalToStereo :: Signal -> [Stereo] |
Transfroms a signal to a list of stereo values. |
|
eitherSignal :: ([Mono] -> a) -> ([Stereo] -> a) -> Signal -> a |
|
liftSignal :: ([Mono] -> [Mono]) -> Signal -> Signal |
Applies the function to the input signal. If it is a stereo signal, the
function is applied to both channels seperately. |
|
mergeSignal :: Signal -> Signal -> Signal |
The sum of two signals |
|
mergeSignals :: [Signal] -> Signal |
The sum of a set of signals. If all signals are mono, the result will be mono.
Otherwise it will be stereo. |
|
multSignal :: Signal -> Signal -> Signal |
Multiplies two signals. |
|
infiniteSignal :: Double -> Signal -> Signal |
The Double value is added to the input signal (offset). The resulting signal will be infinie
in any case. |
|
Produced by Haddock version HADDOCK_VERSION |