liberis
Enumerations | Functions
soundbox.h File Reference

Low-level access to the SoundBox. More...

Go to the source code of this file.

Enumerations

enum  adpcm_rate { ADPCM_RATE_32000 = 0, ADPCM_RATE_16000 = 1, ADPCM_RATE_8000 = 2, ADPCM_RATE_4000 = 3 }
 ADPCM sample rate. More...

Functions

void eris_low_psg_set_main_volume (u8 left, u8 right)
 Set main volume.
void eris_low_psg_set_channel (u8 chan)
 Set the active channel to operate on.
void eris_low_psg_set_freq (u16 freq)
 Set the frequency of the active channel.
void eris_low_psg_set_volume (u8 vol, u8 on, u8 dda)
 Set the volume (and some controls) of the active channel.
void eris_low_psg_set_balance (u8 left, u8 right)
 Set the balance on the active channel.
void eris_low_psg_waveform_data (u8 sample)
 Write waveform data for the active channel.
void eris_low_psg_set_noise (u8 freq, u8 enabled)
 Set noise control data for the active channel.
void eris_low_psg_set_lfo_freq (u8 freq)
 Set LFO frequency.
void eris_low_psg_set_lfo_control (int on, int ctrl)
 Set LFO controls.
void eris_low_adpcm_set_control (adpcm_rate rate, u8 ch0_interp, u8 ch1_interp, u8 ch0_reset, u8 ch1_reset)
 Set ADPCM controls.
void eris_low_adpcm_set_volume (u8 chan, u8 left, u8 right)
 Set ADPCM channel volume.
void eris_low_cdda_set_volume (u8 left, u8 right)
 Set CDDA volume.

Detailed Description

Low-level access to the SoundBox.


Enumeration Type Documentation

enum adpcm_rate

ADPCM sample rate.

Enumerator:
ADPCM_RATE_32000 

32kHz sample rate

ADPCM_RATE_16000 

16kHz sample rate

ADPCM_RATE_8000 

8kHz sample rate

ADPCM_RATE_4000 

4kHz sample rate


Function Documentation

void eris_low_adpcm_set_control ( adpcm_rate  rate,
u8  ch0_interp,
u8  ch1_interp,
u8  ch0_reset,
u8  ch1_reset 
)

Set ADPCM controls.

Parameters:
rateSample rate for the ADPCM.
ch0_interpWhether Channel 0 has linear interpolation enabled.
ch1_interpWhether Channel 1 has linear interpolation enabled.
ch0_resetIf set, reset Channel 0.
ch1_resetIf set, reset Channel 1.
void eris_low_adpcm_set_volume ( u8  chan,
u8  left,
u8  right 
)

Set ADPCM channel volume.

Parameters:
chanWhich channel to set the volume of.
leftLeft speaker volume. (0 ~ 63)
rightRight speaker volume. (0 ~ 63)
void eris_low_cdda_set_volume ( u8  left,
u8  right 
)

Set CDDA volume.

Parameters:
leftLeft speaker volume. (0 ~ 63)
rightRight speaker volume. (0 ~ 63)
void eris_low_psg_set_balance ( u8  left,
u8  right 
)

Set the balance on the active channel.

Parameters:
leftLeft speaker output volume. (0 ~ 15)
rightRight speaker output volume. (0 ~ 15)
void eris_low_psg_set_channel ( u8  chan)

Set the active channel to operate on.

This affects which channel is changed for the functions eris_low_psg_set_freq(), eris_low_psg_set_volume(), eris_low_psg_set_balance(), eris_low_psg_waveform_data(), and eris_low_psg_set_noise().

Parameters:
chanThe channel to become active. (0 ~ 5)
void eris_low_psg_set_freq ( u16  freq)

Set the frequency of the active channel.

Parameters:
freqThe frequency of the channel. 12bit. Calculated as n = (3580000 / 32) / freq
void eris_low_psg_set_lfo_control ( int  on,
int  ctrl 
)

Set LFO controls.

Parameters:
onWhether the LFO is enabled or not.
ctrlLFO control. Influence is not simple; see hardware documentation.
void eris_low_psg_set_lfo_freq ( u8  freq)

Set LFO frequency.

Parameters:
freqThe LFO's new frequency value. Influence is not simple; see hardware documentation.
void eris_low_psg_set_main_volume ( u8  left,
u8  right 
)

Set main volume.

Parameters:
leftLeft speaker output volume. (0 ~ 15)
rightRight speaker output volume. (0 ~ 15)
void eris_low_psg_set_noise ( u8  freq,
u8  enabled 
)

Set noise control data for the active channel.

Only works on the last 2 channels (4 and 5).

Parameters:
freqFrequency of the noise. 5bit. Calculated as n = (3580000 / 32) / freq
enabledWhether the channel should or should not output noise.
void eris_low_psg_set_volume ( u8  vol,
u8  on,
u8  dda 
)

Set the volume (and some controls) of the active channel.

Parameters:
volVolume of the channel. (0 ~ 31)
onControls whether the channel is on or off.
ddaDirect DAC access control. When enabled, waveform data is streamed through eris_low_psg_waveform_data().
void eris_low_psg_waveform_data ( u8  sample)

Write waveform data for the active channel.

If DDA is off, writes to the waveform buffer and increases the index. If it's on, it changes the current sample being played.

Parameters:
sampleA 5bit unsigned sample. (0 ~ 31)
 All Files Functions Typedefs Enumerations Enumerator Defines