Main Page | Data Structures | File List | Data Fields | Globals

sound/sound.h File Reference

Sound driver. More...


Defines

#define VOICE_16   (1<<31)
#define VOICE_BALANCE(r)   (r << 24)
#define VOICE_VOLUME(v)   (v << 16)
#define VOICE_FREQ(replay_freq, freq)   (((freq * 4096) / replay_freq) & 0xffff)

Functions

int init_sound_driver (int frequency)
void set_voice (int voice_num, int control, char *start, int len, char *loop_start, int loop_len)
void set_panning (int voice_num, int panning)
void set_volume (int voice_num, int volume)
int init_module (char *module, int tempo_enabled)
void play_module ()
void clear_module ()
void pause_module ()
int enable_module_voices (int mask)
void jump_dsp_subroutine (void *addr)

Variables

long _DSP_FREE_RAM
short int amiga_frequencies [MAX_PERIOD]


Detailed Description

Sound driver.


Define Documentation

#define VOICE_16   (1<<31)
 

16 bits sound

#define VOICE_BALANCE  )     (r << 24)
 

Balance [0..16]

#define VOICE_FREQ replay_freq,
freq   )     (((freq * 4096) / replay_freq) & 0xffff)
 

Frequency increment [0..0xffff]

#define VOICE_VOLUME  )     (v << 16)
 

Volume [0..64]


Function Documentation

void clear_module  ) 
 

Clear the module

int enable_module_voices int  mask  ) 
 

Set modules voices mask. It returns the mask set.

Parameters:
mask  Mask to enable/disable voice of a module. Bit 0 = Voice 0, Bit 1 = Voice 1, ...

int init_module char *  module,
int  tempo_enabled
 

Initialise the Protracker player. The length in bytes of the module is not checked and is thus assumed correct. For safety reasons, you should add a buffer of 31*2 bytes at the end of the module since some values are fixed in the module by this function. It returns the number of voices of the music.

Parameters:
module  address of the music
tempo_enabled  enable/disable tempo commands

int init_sound_driver int  frequency  ) 
 

Initialises the display driver and the DSP subroutine manager. It returns back the real replay frequency.

Parameters:
frequency  desired replay frequency

void jump_dsp_subroutine void *  addr  ) 
 

Call a DSP subroutine in DSP ram.

Parameters:
addr  Address of the subroutine

void pause_module  ) 
 

Play/Pause the replay of the current music

void play_module  ) 
 

Protracker routine to be called each VBL (50 or 60 Hz)

void set_panning int  voice_num,
int  panning
 

Set voice panning

Parameters:
voice_num  voice
panning  panning

void set_voice int  voice_num,
int  control,
char *  start,
int  len,
char *  loop_start,
int  loop_len
 

Play a sample

Parameters:
voice_num  voice
control  voice control (i.e. 8/16 bits, panning, volume, frequency)
start  start of sample
len  length in bytes
loop_start  re-start address of sample (or NULL if no re-play)
loop_len  lenght in bytes of the loop

void set_volume int  voice_num,
int  volume
 

Set voice volume

Parameters:
voice_num  voice
volume  volume


Variable Documentation

long _DSP_FREE_RAM
 

Free DSP ram is available at &_DSP_FREE_RAM.

short int amiga_frequencies[MAX_PERIOD]
 

Amiga period to frequencies increment. Initialised by init_sound_driver since it depends on the replay frequency.


Generated on Wed Jan 10 03:11:03 2007 for The Removers Libraries by  doxygen 1.4.4