Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Sound.PlSynth.FFI
Synopsis
- plSynthInit :: Ptr CFloat -> IO ()
- plSynthTabSize :: Int
- plSynthSoundLen :: Ptr PlSynthSoundT -> IO Int
- plSynthSound :: Ptr PlSynthSoundT -> Ptr Int16 -> IO Int
- plSynthSongLen :: Ptr PlSynthSongT -> IO Int
- plSynthSong :: Ptr PlSynthSongT -> Ptr Int16 -> Ptr Int16 -> IO Int
- plSynthWavWrite :: CString -> Ptr Int16 -> Int -> Int16 -> Int -> IO ()
- data PlSynthT = PlSynthT {
- osc0_oct :: Word8
- osc0_det :: Word8
- osc0_detune :: Word8
- osc0_xenv :: Word8
- osc0_vol :: Word8
- osc0_waveform :: Word8
- osc1_oct :: Word8
- osc1_det :: Word8
- osc1_detune :: Word8
- osc1_xenv :: Word8
- osc1_vol :: Word8
- osc1_waveform :: Word8
- noise_fader :: Word8
- env_attack :: Word32
- env_sustain :: Word32
- env_release :: Word32
- env_master :: Word32
- fx_filter :: Word8
- fx_freq :: Word32
- fx_resonance :: Word8
- fx_delay_time :: Word8
- fx_delay_amt :: Word8
- fx_pan_freq :: Word8
- fx_pan_amt :: Word8
- lfo_osc_freq :: Word8
- lfo_fx_freq :: Word8
- lfo_freq :: Word8
- lfo_amt :: Word8
- lfo_waveform :: Word8
- emptyPlSynthT :: PlSynthT
- pattern SIN :: Word8
- pattern SAW :: Word8
- pattern SQR :: Word8
- pattern TRI :: Word8
- data PlSynthSoundT = PlSynthSoundT {}
- data PlSynthPatternT = PlSynthPatternT {}
- data PlSynthTrackT = PlSynthTrackT {}
- data PlSynthSongT = PlSynthSongT {
- row_len :: Word32
- num_tracks :: Word8
- tracks :: Ptr PlSynthTrackT
- pattern PL_SYNTH_SAMPLERATE :: Int
- pattern PL_SYNTH_TAB_LEN :: Int
- pattern PL_SYNTH_PATTERN_LEN :: Int
Documentation
plSynthInit :: Ptr CFloat -> IO () Source #
Initialize the lookup table for all instruments. This needs to be done only once.
The table will be written to the memory pointed to by tab_buffer, which must be PL_SYNTH_TAB_LEN elements long or PL_SYNTH_TAB_SIZE bytes in size.
plSynthTabSize :: Int Source #
Amount of memory needed for plSynthInit
.
plSynthSoundLen :: Ptr PlSynthSoundT -> IO Int Source #
Determine the number of samples needed for one channel of a particular sound effect.
plSynthSound :: Ptr PlSynthSoundT -> Ptr Int16 -> IO Int Source #
Generate a stereo sound into the buffer pointed to by samples.
The buffer must be at least pl_synth_sound_len() * 2 elements long.
plSynthSongLen :: Ptr PlSynthSongT -> IO Int Source #
Determine the number of samples needed for one channel of a particular song.
plSynthSong :: Ptr PlSynthSongT -> Ptr Int16 -> Ptr Int16 -> IO Int Source #
Generate a stereo song into the buffer pointed to by samples, with temporary storage provided to by temp_samples.
The buffers samples and temp_samples must each be at least pl_synth_song_len() * 2 elements long.
Arguments
:: CString | path |
-> Ptr Int16 | samples |
-> Int | samples_len |
-> Int16 | channels (2) |
-> Int | samplerate (44100) |
-> IO () |
Write generated samples ta WAV-formatted file.
Not a part of the pl_synth API. Lifted from the example.c
.
Constructors
PlSynthT | |
Fields
|
Instances
Storable PlSynthT Source # | |
Defined in Sound.PlSynth.FFI | |
Show PlSynthT Source # | |
Eq PlSynthT Source # | |
data PlSynthSoundT Source #
Instances
Storable PlSynthSoundT Source # | |
Defined in Sound.PlSynth.FFI Methods sizeOf :: PlSynthSoundT -> Int # alignment :: PlSynthSoundT -> Int # peekElemOff :: Ptr PlSynthSoundT -> Int -> IO PlSynthSoundT # pokeElemOff :: Ptr PlSynthSoundT -> Int -> PlSynthSoundT -> IO () # peekByteOff :: Ptr b -> Int -> IO PlSynthSoundT # pokeByteOff :: Ptr b -> Int -> PlSynthSoundT -> IO () # peek :: Ptr PlSynthSoundT -> IO PlSynthSoundT # poke :: Ptr PlSynthSoundT -> PlSynthSoundT -> IO () # | |
Show PlSynthSoundT Source # | |
Defined in Sound.PlSynth.FFI Methods showsPrec :: Int -> PlSynthSoundT -> ShowS # show :: PlSynthSoundT -> String # showList :: [PlSynthSoundT] -> ShowS # | |
Eq PlSynthSoundT Source # | |
Defined in Sound.PlSynth.FFI Methods (==) :: PlSynthSoundT -> PlSynthSoundT -> Bool # (/=) :: PlSynthSoundT -> PlSynthSoundT -> Bool # |
data PlSynthPatternT Source #
Constructors
PlSynthPatternT | |
Instances
Storable PlSynthPatternT Source # | |
Defined in Sound.PlSynth.FFI Methods sizeOf :: PlSynthPatternT -> Int # alignment :: PlSynthPatternT -> Int # peekElemOff :: Ptr PlSynthPatternT -> Int -> IO PlSynthPatternT # pokeElemOff :: Ptr PlSynthPatternT -> Int -> PlSynthPatternT -> IO () # peekByteOff :: Ptr b -> Int -> IO PlSynthPatternT # pokeByteOff :: Ptr b -> Int -> PlSynthPatternT -> IO () # peek :: Ptr PlSynthPatternT -> IO PlSynthPatternT # poke :: Ptr PlSynthPatternT -> PlSynthPatternT -> IO () # | |
Show PlSynthPatternT Source # | |
Defined in Sound.PlSynth.FFI Methods showsPrec :: Int -> PlSynthPatternT -> ShowS # show :: PlSynthPatternT -> String # showList :: [PlSynthPatternT] -> ShowS # | |
Eq PlSynthPatternT Source # | |
Defined in Sound.PlSynth.FFI Methods (==) :: PlSynthPatternT -> PlSynthPatternT -> Bool # (/=) :: PlSynthPatternT -> PlSynthPatternT -> Bool # |
data PlSynthTrackT Source #
Constructors
PlSynthTrackT | |
Fields
|
Instances
Storable PlSynthTrackT Source # | |
Defined in Sound.PlSynth.FFI Methods sizeOf :: PlSynthTrackT -> Int # alignment :: PlSynthTrackT -> Int # peekElemOff :: Ptr PlSynthTrackT -> Int -> IO PlSynthTrackT # pokeElemOff :: Ptr PlSynthTrackT -> Int -> PlSynthTrackT -> IO () # peekByteOff :: Ptr b -> Int -> IO PlSynthTrackT # pokeByteOff :: Ptr b -> Int -> PlSynthTrackT -> IO () # peek :: Ptr PlSynthTrackT -> IO PlSynthTrackT # poke :: Ptr PlSynthTrackT -> PlSynthTrackT -> IO () # | |
Show PlSynthTrackT Source # | |
Defined in Sound.PlSynth.FFI Methods showsPrec :: Int -> PlSynthTrackT -> ShowS # show :: PlSynthTrackT -> String # showList :: [PlSynthTrackT] -> ShowS # | |
Eq PlSynthTrackT Source # | |
Defined in Sound.PlSynth.FFI Methods (==) :: PlSynthTrackT -> PlSynthTrackT -> Bool # (/=) :: PlSynthTrackT -> PlSynthTrackT -> Bool # |
data PlSynthSongT Source #
Constructors
PlSynthSongT | |
Fields
|
Instances
Storable PlSynthSongT Source # | |
Defined in Sound.PlSynth.FFI Methods sizeOf :: PlSynthSongT -> Int # alignment :: PlSynthSongT -> Int # peekElemOff :: Ptr PlSynthSongT -> Int -> IO PlSynthSongT # pokeElemOff :: Ptr PlSynthSongT -> Int -> PlSynthSongT -> IO () # peekByteOff :: Ptr b -> Int -> IO PlSynthSongT # pokeByteOff :: Ptr b -> Int -> PlSynthSongT -> IO () # peek :: Ptr PlSynthSongT -> IO PlSynthSongT # poke :: Ptr PlSynthSongT -> PlSynthSongT -> IO () # | |
Show PlSynthSongT Source # | |
Defined in Sound.PlSynth.FFI Methods showsPrec :: Int -> PlSynthSongT -> ShowS # show :: PlSynthSongT -> String # showList :: [PlSynthSongT] -> ShowS # | |
Eq PlSynthSongT Source # | |
Defined in Sound.PlSynth.FFI |
pattern PL_SYNTH_SAMPLERATE :: Int Source #
pattern PL_SYNTH_TAB_LEN :: Int Source #
pattern PL_SYNTH_PATTERN_LEN :: Int Source #