Safe Haskell | None |
---|---|
Language | Haskell98 |
Sound file playback
- readSnd :: String -> (Sig, Sig)
- loopSnd :: String -> (Sig, Sig)
- loopSndBy :: D -> String -> (Sig, Sig)
- readWav :: Sig -> String -> (Sig, Sig)
- loopWav :: Sig -> String -> (Sig, Sig)
- readSegWav :: D -> D -> Sig -> String -> (Sig, Sig)
- tempoLoopWav :: Sig -> String -> (Sig, Sig)
- tempoReadWav :: Sig -> String -> (Sig, Sig)
- readSnd1 :: String -> Sig
- loopSnd1 :: String -> Sig
- loopSndBy1 :: D -> String -> Sig
- readWav1 :: Sig -> String -> Sig
- loopWav1 :: Sig -> String -> Sig
- readSegWav1 :: D -> D -> Sig -> String -> Sig
- tempoLoopWav1 :: Sig -> String -> Sig
- tempoReadWav1 :: Sig -> String -> Sig
- data LoopMode
- ramSnd :: LoopMode -> Sig -> String -> Sig2
- ramSnd1 :: LoopMode -> Sig -> String -> Sig
- data SampleFormat
- writeSigs :: FormatType -> SampleFormat -> String -> [Sig] -> SE ()
- writeWav :: String -> (Sig, Sig) -> SE ()
- writeAiff :: String -> (Sig, Sig) -> SE ()
- writeWav1 :: String -> Sig -> SE ()
- writeAiff1 :: String -> Sig -> SE ()
- lengthSnd :: String -> D
- segments :: D -> Evt (D, Unit)
- takeSnd :: Sigs a => D -> a -> a
- delaySnd :: Sigs a => D -> a -> a
- segmentSnd :: Sigs a => D -> D -> a -> a
- repeatSnd :: Sigs a => D -> a -> a
- toMono :: (Sig, Sig) -> Sig
Stereo
loopSnd :: String -> (Sig, Sig) Source
Reads stereo signal from the sound-file (wav or mp3 or aiff) and loops it with the file length.
loopSndBy :: D -> String -> (Sig, Sig) Source
Reads stereo signal from the sound-file (wav or mp3 or aiff) and loops it with the given period (in seconds).
readWav :: Sig -> String -> (Sig, Sig) Source
Reads the wav file with the given speed (if speed is 1 it's a norma playback). We can use negative speed to read file in reverse.
tempoLoopWav :: Sig -> String -> (Sig, Sig) Source
Reads th wav file and loops over it. Scales the tempo with first argument.
tempoReadWav :: Sig -> String -> (Sig, Sig) Source
Reads the wav file with the given speed (if speed is 1 it's a norma playback). We can use negative speed to read file in reverse. Scales the tempo with first argument.
Mono
loopSndBy1 :: D -> String -> Sig Source
The mono variant of the function loopSndBy
.
tempoLoopWav1 :: Sig -> String -> Sig Source
Reads th mono wav file and loops over it. Scales the tempo with first argument.
tempoReadWav1 :: Sig -> String -> Sig Source
Reads the mono wav file with the given speed (if speed is 1 it's a norma playback). We can use negative speed to read file in reverse. Scales the tempo with first argument.
Read sound with RAM
ramSnd :: LoopMode -> Sig -> String -> Sig2 Source
Loads the sample in the table. The sample should be short. The size of the table is limited. It's up to 6 minutes for
Writing sound files
data SampleFormat Source
The sample format.
NoHeaderFloat32 | 32-bit floating point samples without header |
NoHeaderInt16 | 16-bit integers without header |
HeaderInt16 | 16-bit integers with a header. The header type depends on the render (-o) format |
UlawSamples | u-law samples with a header |
Int16 | 16-bit integers with a header |
Int32 | 32-bit integers with a header |
Float32 | 32-bit floats with a header |
Uint8 | 8-bit unsigned integers with a header |
Int24 | 24-bit integers with a header |
Float64 | 64-bit floats with a header |
writeSigs :: FormatType -> SampleFormat -> String -> [Sig] -> SE () Source
Writes a sound signal to the file with the given format. It supports only four formats: Wav, Aiff, Raw and Ircam.
writeAiff1 :: String -> Sig -> SE () Source
Writes mono signals to aiff files.
Utility
Signal manipulation
takeSnd :: Sigs a => D -> a -> a Source
Takes only given amount (in seconds) from the signal (the rest is silence).
segmentSnd :: Sigs a => D -> D -> a -> a Source
Delays a signal by the first argument and takes only second argument amount of signal (everything is measured in seconds).