The lookup table, which is part of the header of the song or sound effect, is the list of sample waveform data types used by those sounds. You can determine the address of the lookup table with MusHandleWaveAddress and the size of the lookup table (the number of listed samples) with MusHandleWaveCount.
Return the address of the lookup table
Function name: | MusHandleWaveAddress | |
Syntax: | u16 *MusHandleWaveAddress(musHandle handle) | |
Arguments: | handle | Sound handle |
Return value: | Address of lookup table |
Return the size of the lookup table
Function name: | MusHandleWaveCount | |
Syntax: | s32 MusHandleWaveCount(musHandle handle) | |
Arguments: | handle | Sound handle |
Return value: | Size of lookup table (number of entries) |
The following example demonstrates how these functions can be used.
|
In this program, the samples numbered swap1 and swap2 in the specified sound handle are switched.
This can be used in a two-instrument duet to swap parts based on specific timing.
(*) | Be careful because the order can change when the data is edited. |