lambdasound-1.2.0: A libary for generating low-level sounds with high-level combinators
Safe HaskellSafe-Inferred
LanguageGHC2021

LambdaSound.Create

Synopsis

Basic sounds

time :: Sound I Time Source #

Get the time for each sample which can be used for sinus wave calculations (e.g. sineWave)

progress :: Sound I Progress Source #

Get the Progress of a Sound. Progress of '0' means that the sound has just started. Progress of '1' means that the sound has finished. Progress greater than '1' or smaller than '0' is invalid.

sampleIndex :: Sound I Int Source #

Tells you the sample index for each sample

constant :: a -> Sound I a Source #

A constant Sound

silence :: Sound I Pulse Source #

A Sound with 0 volume

Iterating

iterateSound :: (a -> a) -> a -> Sound I a Source #

Iterate over the samples to create the sound.

iterateSoundPulse :: (Pulse -> Pulse) -> Pulse -> Sound I Pulse Source #

Iterate over the samples to create the sound.

The Pulse version is faster then the non-Pulse version

Unfolding

unfoldlSound :: (s -> (s, a)) -> s -> Sound I a Source #

Unfold the samples of a sound from the start to the end

unfoldlSoundPulse :: (s -> (s, Pulse)) -> s -> Sound I Pulse Source #

Unfold the samples of a sound from the start to the end

The Pulse version is faster then the non-Pulse version

unfoldrSound :: (s -> (a, s)) -> s -> Sound I a Source #

Unfold the samples of a sound from the end to start

unfoldrSoundPulse :: (s -> (Pulse, s)) -> s -> Sound I Pulse Source #

Unfold the samples of a sound from the end to start

The Pulse version is faster then the non-Pulse version

iUnfoldlSound :: (Int -> s -> (s, a)) -> s -> Sound I a Source #

Unfold the samples of a sound from the start to the end with the index starting at 0

iUnfoldlSoundPulse :: (Int -> s -> (s, Pulse)) -> s -> Sound I Pulse Source #

Unfold the samples of a sound from the start to the end with the index starting at 0

The Pulse version is faster then the non-Pulse version

iUnfoldrSound :: (s -> Int -> (a, s)) -> s -> Sound I a Source #

Unfold the samples of a sound from the end to the start with the index starting at 0

iUnfoldrSoundPulse :: (s -> Int -> (Pulse, s)) -> s -> Sound I Pulse Source #

Unfold the samples of a sound from the end to the start with the index starting at 0

The Pulse version is faster then the non-Pulse version