Maxmod
|
Data Structures | |
struct | mmreverbcfg |
Reverb configuration settings. More... | |
struct | t_mmdssample |
Sample structure. More... | |
struct | t_mmdssystem |
DS setup information. More... | |
struct | t_mmgbasystem |
GBA setup information, passed to mmInit(). More... | |
struct | t_mmsoundeffect |
Information for playing a sound effect. More... | |
struct | t_mmstream |
Information about a stream to be opened. More... | |
Typedefs | |
typedef void * | mm_addr |
Memory address (pointer) | |
typedef unsigned char | mm_bool |
Boolean. Non-zero = true, zero = false. | |
typedef unsigned char | mm_byte |
Generic 8-bit value. | |
typedef mm_word(* | mm_callback) (mm_word msg, mm_word param) |
Function pointer definition for handling song events. | |
typedef struct t_mmdssample | mm_ds_sample |
Sample structure. | |
typedef struct t_mmdssystem | mm_ds_system |
DS setup information. | |
typedef struct t_mmgbasystem | mm_gba_system |
GBA setup information, passed to mmInit(). | |
typedef unsigned short | mm_hword |
Generic 16-bit value. | |
typedef void * | mm_reg |
Hardware register (pointer) | |
typedef struct mmreverbcfg | mm_reverb_cfg |
Reverb configuration settings. | |
typedef unsigned short | mm_sfxhand |
Sound effect handle. | |
typedef struct t_mmsoundeffect | mm_sound_effect |
Information for playing a sound effect. | |
typedef struct t_mmstream | mm_stream |
Information about a stream to be opened. | |
typedef mm_word(* | mm_stream_func) (mm_word length, mm_addr dest, mm_stream_formats format) |
Function pointer definition for handling stream fill requests (DS mode). | |
typedef unsigned int | mm_word |
Generic 32-bit value. | |
Function pointer definition for handling song events.
msg | Message type. |
param | Additional data about the message. |
typedef struct t_mmdssample mm_ds_sample |
Sample structure.
If the sample loops, then loop_start should be set to the position of the loop starting point, and loop_length should be set to the length of the loop. Otherwise, loop_start should be set to zero, and length should be set to the length of the sample.
The length and position values are measured in words. That is, samples/4 for 8-bit, and samples/2 for 16-bit (and samples/8 for 4-bit compressed). The sample data must be aligned and maybe resampled or padded to fit along the boundaries.
typedef struct t_mmdssystem mm_ds_system |
DS setup information.
More about mem_bank: Maxmod needs some memory to manage samples and modules that are loaded/unloaded into/from memory. This pointer should reference an area of memory that is mod_count+samp_count WORDS in size:
MSL_BANKSIZE is defined as the sum of the module and sample count in the soundbank.
The mmInitDefault()/mmInitDefaultMem() functions may be used to quickly initialize maxmod default settings. Using these functions, mod_count and samp_count will be automatically filled using data from the soundbank, and mem_bank will be allocated with malloc().
typedef struct t_mmgbasystem mm_gba_system |
GBA setup information, passed to mmInit().
About mixing_memory: The mixing memory is a heavily used area of memory and should most definitely be located in the fast IWRAM. By default, devkitARM will place any global variables in IWRAM. The size of this buffer depeds on the mixing rate selected.
Check the mm_mixlen_enum values. These values contain the size of the mixing buffer in bytes. If you're using 16KHz mixing rate, your mixing buffer should be defined like this (as a global array):
Notice also that the mixing buffer should be aligned by 4 bytes.
About the wave buffer: The wave buffer is a not-so-heavily used area of memory and can be placed in EWRAM. The wave buffer contains the final waveform data that is DMA copied to the sound FIFO. The size of the waveform buffer must be equal to the size of the mixing buffer. By default (devkitARM), the malloc function can be used to allocate the wave buffer in EWRAM. The wave buffer must be aligned by 4 bytes too.
typedef struct mmreverbcfg mm_reverb_cfg |
Reverb configuration settings.
The flags entry selects which data in the struct is valid. It also selects which reverb channels to apply the settings to, and also some other commands.
typedef unsigned short mm_sfxhand |
Sound effect handle.
Returned by mmEffect() and mmEffectEx(). May be used to modify a sound effect while it is playing.
typedef struct t_mmsoundeffect mm_sound_effect |
Information for playing a sound effect.
The sample entry is only supported on DS and may be used to play an external sample source.
typedef struct t_mmstream mm_stream |
Information about a stream to be opened.
More about manual mode: If this is set, then you must call mmStreamUpdate() periodically to push data into the stream buffer (mmStreamUpdate makes requests to your callback function to fill the stream). Manual mode can be used to have control over when the stream is filled.
typedef mm_word(* mm_stream_func) (mm_word length, mm_addr dest, mm_stream_formats format) |
Function pointer definition for handling stream fill requests (DS mode).
length | Number of samples to write to the output. |
dest | Output address. |
format | Stream format. |
enum mm_mixmode |
Software mixing rates for GBA system.
enum mm_mode_enum |
Audio modes for the DS system. Pass to mmSelectMode().
Enumerator | |
---|---|
MM_MODE_A | Selects the full-hardware audio mode. |
MM_MODE_B | Selects the interpolated audio mode. |
MM_MODE_C | Selects the extended mixing audio mode. |
enum mm_pmode |
Module looping modes for mmStart().
Enumerator | |
---|---|
MM_PLAY_LOOP | Loop module forever (until stopped). |
MM_PLAY_ONCE | Stop module after playing the last pattern. |
enum mm_reverbch |
enum mm_reverbflags |
Reverb configuration flags.
The first few flags enable the values in the mm_reverb_cfg struct (to be applied to the channels select with MMRF_LEFT/RIGHT). The rest of the flags are actually commands.
enum mm_stream_formats |
Formats for software streaming.
ADPCM streaming is not supported by the DS hardware. The loop point data gets recorded so ring buffers are not possible.