Maxmod
Loading...
Searching...
No Matches
Functions
NDS: ARM9 Sound Effects

Functions

mm_sfxhand mmEffect (mm_word sample_ID)
 Plays a sound effect with default settings.
 
void mmEffectCancel (mm_sfxhand handle)
 Stops a sound effect. The handle will be invalidated.
 
void mmEffectCancelAll (void)
 Stop all sound effects and reset the effect system.
 
mm_sfxhand mmEffectEx (mm_sound_effect *sound)
 Plays a sound effect with custom settings.
 
mm_sfxhand mmEffectExt (mm_sound_effect *sound, mm_ds_sample *sample)
 Play external sound.
 
void mmEffectPanning (mm_sfxhand handle, mm_byte panning)
 Changes the panning of a sound effect.
 
void mmEffectRate (mm_sfxhand handle, mm_word rate)
 Changes the playback rate for a sound effect.
 
void mmEffectRelease (mm_sfxhand handle)
 Marks a sound effect as unimportant.
 
void mmEffectScaleRate (mm_sfxhand handle, mm_word factor)
 Scales the rate of the sound effect by a certain factor.
 
void mmEffectVolume (mm_sfxhand handle, mm_word volume)
 Changes the volume of a sound effect.
 
void mmSetEffectsVolume (mm_word volume)
 Set master volume scale for effect playback.
 

Detailed Description

Function Documentation

◆ mmEffect()

mm_sfxhand mmEffect ( mm_word  sample_ID)

Plays a sound effect with default settings.

Default settings are: Volume=Max, Panning=Center, Rate=Center (specified in sample).

The value returned from this function is a handle and can be used to modify the sound effect while it's actively playing.

For DS, make sure the sample is loaded (mmLoadEffect).

Parameters
sample_IDIndex of sample to be played. Values are defined in the soundbank header. (prefixed with "SFX_")
Returns
Sound effect handle. This value can be used to modify parameters of the sound effect while it is playing.

◆ mmEffectCancel()

void mmEffectCancel ( mm_sfxhand  handle)

Stops a sound effect. The handle will be invalidated.

Parameters
handleSound effect handle received from mmEffect() or mmEffectEx().

◆ mmEffectEx()

mm_sfxhand mmEffectEx ( mm_sound_effect sound)

Plays a sound effect with custom settings.

Remember to load the effect via mmLoadEffect first.

Parameters
soundStructure containing information about the sound to be played.
Returns
Sound effect handle that may be used to modify the sound later.

◆ mmEffectExt()

mm_sfxhand mmEffectExt ( mm_sound_effect sound,
mm_ds_sample sample 
)

Play external sound.

Parameters
soundPointer to sound effect info.
samplePointer to external sample.
Returns
Sound effect handle that may be used to modify the sound later.

◆ mmEffectPanning()

void mmEffectPanning ( mm_sfxhand  handle,
mm_byte  panning 
)

Changes the panning of a sound effect.

Parameters
handleSound effect handle received from mmEffect() or mmEffectEx().
panningNew panning level. Ranges from 0 (left) to 255 (right).

◆ mmEffectRate()

void mmEffectRate ( mm_sfxhand  handle,
mm_word  rate 
)

Changes the playback rate for a sound effect.

The actual playback rate depends on this value and the base frequency of the sample. This parameter is a 6.10 fixed point value, passing 1024 will return the sound to its original pitch, 2048 will raise the pitch by one octave, and 512 will lower the pitch by an octave. To calculate a value from semitones: Rate = 1024 * 2^(Semitones/12). (please don't try to do that with integer maths)

Parameters
handleSound effect handle received from mmEffect() or mmEffectEx().
rateNew playback rate.

◆ mmEffectRelease()

void mmEffectRelease ( mm_sfxhand  handle)

Marks a sound effect as unimportant.

This enables the sound effect to be interrupted by music/other sound effects if the need arises. The handle will be invalidated.

Parameters
handleSound effect handle received from mmEffect() or mmEffectEx().

◆ mmEffectScaleRate()

void mmEffectScaleRate ( mm_sfxhand  handle,
mm_word  factor 
)

Scales the rate of the sound effect by a certain factor.

Parameters
handleSound effect handle received from mmEffect() or mmEffectEx().
factor6.10 fixed point factor.

◆ mmEffectVolume()

void mmEffectVolume ( mm_sfxhand  handle,
mm_word  volume 
)

Changes the volume of a sound effect.

Parameters
handleSound effect handle received from mmEffect() or mmEffectEx().
volumeNew volume level. Ranges from 0 (silent) to 255 (normal).

◆ mmSetEffectsVolume()

void mmSetEffectsVolume ( mm_word  volume)

Set master volume scale for effect playback.

Parameters
volumeMaster volume. 0->1024 representing 0%->100% volume