Maxmod
Functions
GBA: Module Playback

Functions

mm_bool mmActive (void)
 Used to determine if a module is playing. More...
 
mm_bool mmActiveSub (void)
 Check if a jingle is playing or not. More...
 
mm_word mmGetPosition (void)
 Get current pattern order being played. More...
 
mm_word mmGetPositionRow (void)
 Get current row being played. More...
 
mm_word mmGetPositionTick (void)
 Get current number of elapsed ticks in the row being played. More...
 
void mmJingle (mm_word module_ID)
 Plays a jingle. More...
 
void mmPause (void)
 Pauses playback of the active module. More...
 
void mmPlayModule (mm_word address, mm_word mode, mm_word layer)
 Play direct MAS file. More...
 
void mmPosition (mm_word position)
 Set the current sequence [aka order-list] position for the active module. More...
 
void mmResume (void)
 Resume module playback. More...
 
void mmSetJingleVolume (mm_word volume)
 Use this function to change the master volume scale for jingle playback. More...
 
void mmSetModulePitch (mm_word pitch)
 Change the master pitch scale for module playback. More...
 
void mmSetModuleTempo (mm_word tempo)
 Change the master tempo for module playback. More...
 
void mmSetModuleVolume (mm_word volume)
 Use this function to change the master volume scale for module playback. More...
 
static void mmSetPosition (mm_word position)
 Set playback position (alias for mmPosition()). More...
 
void mmStart (mm_word id module_ID, mm_pmode mode)
 Begins playback of a module. More...
 
void mmStop (void)
 Stops playback of the active module. More...
 

Detailed Description

Function Documentation

◆ mmActive()

mm_bool mmActive ( void  )

Used to determine if a module is playing.

Returns
Nonzero if a module is currently playing.

◆ mmActiveSub()

mm_bool mmActiveSub ( void  )

Check if a jingle is playing or not.

Returns
Returns nonzero if a jingle is actively playing.

◆ mmGetPosition()

mm_word mmGetPosition ( void  )

Get current pattern order being played.

Returns
The current pattern.

◆ mmGetPositionRow()

mm_word mmGetPositionRow ( void  )

Get current row being played.

Returns
The current row.

◆ mmGetPositionTick()

mm_word mmGetPositionTick ( void  )

Get current number of elapsed ticks in the row being played.

Returns
Number of elapsed ticks.

◆ mmJingle()

void mmJingle ( mm_word  module_ID)

Plays a jingle.

Jingles are normal modules that can be mixed with the normal module playback.

For GBA, the module is read directly from the cartridge space. For jingles, the playback mode is fixed to MM_PLAY_ONCE.

Note that jingles must be limited to 4 channels only.

Parameters
module_IDIndex of module to be played. (Defined in soundbank header)

◆ mmPause()

void mmPause ( void  )

Pauses playback of the active module.

Resume with mmResume().

◆ mmPlayModule()

void mmPlayModule ( mm_word  address,
mm_word  mode,
mm_word  layer 
)

Play direct MAS file.

Parameters
addressTODO
modeTODO
layerTODO

◆ mmPosition()

void mmPosition ( mm_word  position)

Set the current sequence [aka order-list] position for the active module.

Parameters
positionNew position in module sequence.

◆ mmResume()

void mmResume ( void  )

Resume module playback.

Pause with mmPause().

◆ mmSetJingleVolume()

void mmSetJingleVolume ( mm_word  volume)

Use this function to change the master volume scale for jingle playback.

Parameters
volumeNew volume level. Ranges from 0 (silent) to 1024 (normal).

◆ mmSetModulePitch()

void mmSetModulePitch ( mm_word  pitch)

Change the master pitch scale for module playback.

Specifying 1024 will play the module at its normal pitch. Minimum/Maximum range of the pitch change is +-1 octave.

Range = 0x200 -> 0x800 = 0.5 -> 2.0

Parameters
pitchNew pitch scale. Value = 1024 * 2^(semitones/12)

◆ mmSetModuleTempo()

void mmSetModuleTempo ( mm_word  tempo)

Change the master tempo for module playback.

Specifying 1024 will play the module at its normal speed. Minimum and maximum values are 50% (512) and 200% (2048). Note that increasing the tempo will also increase the module processing load.

It uses a fixed point (Q10) value representing tempo.

Range = 0x200 -> 0x800 = 0.5 -> 2.0

Parameters
tempoNew tempo value. Tempo = (speed_percentage * 1024) / 100.

◆ mmSetModuleVolume()

void mmSetModuleVolume ( mm_word  volume)

Use this function to change the master volume scale for module playback.

Parameters
volumeNew volume level. Ranges from 0 (silent) to 1024 (normal).

◆ mmSetPosition()

static void mmSetPosition ( mm_word  position)
inlinestatic

Set playback position (alias for mmPosition()).

Parameters
positionNew position in module sequence.

◆ mmStart()

void mmStart ( mm_word id  module_ID,
mm_pmode  mode 
)

Begins playback of a module.

For GBA, the module data is read directly from the cartridge space, so no loading is needed.

Parameters
module_IDIndex of module to be played. Values are defined in the soundbank header output. (prefixed with "MOD_")
modeMode of playback. Can be MM_PLAY_LOOP (play and loop until stopped manually) or MM_PLAY_ONCE (play until end).

◆ mmStop()

void mmStop ( void  )

Stops playback of the active module.

Start again (from the beginning) with mmStart().

Any channels used by the active module will be freed.