csound-expression-4.4: library to make electronic music

Safe HaskellNone
LanguageHaskell98

Csound.Air.Wav

Contents

Description

Sound file playback

Synopsis

Stereo

readSnd :: String -> (Sig, Sig) Source

Reads stereo signal from the sound-file (wav or mp3 or aiff).

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.

loopWav :: Sig -> String -> (Sig, Sig) Source

Reads th wav file and loops over it.

readSegWav :: D -> D -> Sig -> String -> (Sig, Sig) Source

Reads a segment from wav file.

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

readSnd1 :: String -> Sig Source

The mono variant of the function readSnd.

loopSnd1 :: String -> Sig Source

The mono variant of the function loopSnd.

loopSndBy1 :: D -> String -> Sig Source

The mono variant of the function loopSndBy.

readWav1 :: Sig -> String -> Sig Source

The mono variant of the function readWav.

loopWav1 :: Sig -> String -> Sig Source

The mono variant of the function loopWav.

readSegWav1 :: D -> D -> Sig -> String -> Sig Source

Reads a segment from wav file.

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

data LoopMode Source

Constructors

Once 
Loop 
Bounce 

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.

Constructors

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.

writeWav :: String -> (Sig, Sig) -> SE () Source

Writes wav files.

writeAiff :: String -> (Sig, Sig) -> SE () Source

Writes aiff files.

writeWav1 :: String -> Sig -> SE () Source

Writes mono signals to wav files.

writeAiff1 :: String -> Sig -> SE () Source

Writes mono signals to aiff files.

Utility

lengthSnd :: String -> D Source

Length in seconds of the sound file.

segments :: D -> Evt (D, Unit) Source

Produces repeating segments with the given time in seconds.

Signal manipulation

takeSnd :: Sigs a => D -> a -> a Source

Takes only given amount (in seconds) from the signal (the rest is silence).

delaySnd :: Sigs a => D -> a -> a Source

Delays signals by the given amount (in seconds).

afterSnd :: (Num b, Sigs b) => D -> b -> b -> b Source

Plays the first signal for some time (in seconds) and then switches to the next one.

afterSnd dur sig1 sig2

lineSnd :: (Num a, Sigs a) => D -> [a] -> a Source

Creates a sequence of signals. Each segment lasts for fixed amount of time given in the first argument.

loopLineSnd :: (Num a, Sigs a) => D -> [a] -> a Source

Creates a sequence of signals and loops over the sequence. Each segment lasts for fixed amount of time given in the first argument.

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).

repeatSnd :: Sigs a => D -> a -> a Source

Repeats the signal with the given period.

toMono :: (Sig, Sig) -> Sig Source

Converts stereosignal to mono with function mean.