pl-synth-0.1.0.0: Bindings and wrappers for PL_SYNTH - no-deps sound effects synthesizer and tracker.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Sound.PlSynth

Description

Convenience wrappers for pl_synth C API.

The generator is always using the 44100 s16le stereo format.

The generator is using static pointers inside and is NOT thread-safe.

Synopsis

Documentation

withPlSynth :: IO a -> IO a Source #

Initialize generator using a temporary buffer.

pattern SIN :: Word8 Source #

pattern SAW :: Word8 Source #

pattern SQR :: Word8 Source #

pattern TRI :: Word8 Source #

writeSound :: FilePath -> PlSynthSoundT -> IO () Source #

Generate samples and write into a file.

If file extension is .wav, then the file would be WAV-wrapped. Otherwise, raw PCM data would be dumped.

withSound :: PlSynthSoundT -> (Ptr Word8 -> Int -> IO a) -> IO a Source #

Generate sound samples in a temporary buffer.

Copy the pointer contents before using.

writeSong :: FilePath -> PlSynthSongT -> IO () Source #

Generate song samples and write into a file.

If file extension is .wav, then the file would be WAV-wrapped. Otherwise, raw PCM data would be dumped.

withSong :: PlSynthSongT -> (Ptr Word8 -> Int -> IO a) -> IO a Source #

Generate song samples in a temporary buffer.

Copy the pointer contents before using.

withSongTracks Source #

Arguments

:: Word32 
-> [([Word8], [[Word8]], PlSynthT)]

args for newTrack: sequence, patterns, synth

-> (PlSynthSongT -> IO a) 
-> IO a 

Prepare temporary buffers from track definitions.

newSong Source #

Arguments

:: Word32

row length

-> [PlSynthTrackT]

track buffers

-> IO PlSynthSongT 

freeSongTracks :: PlSynthSongT -> IO () Source #

Free song buffers AND all of its tracks.

newTrack Source #

Arguments

:: [Word8]

Sequences (1-based pattern numbers to play, 0 - silent sequence)

-> [[Word8]]

Patterns (at most 32 note numbers to play, 0 to skip)

-> PlSynthT

An instrument to play

-> IO PlSynthTrackT