BASS_MusicLoad

Loads a MOD music.

HMUSIC WINAPI BASS_MusicLoad(
    BOOL mem,
    void *file,
    DWORD offset,
    DWORD length,
    DWORD flags
);

Parameters
memTRUE = load the MOD music from memory.
fileFilename (mem = FALSE) or a memory location (mem = TRUE).
offsetFile offset to load the MOD music from (only used if mem = FALSE).
lengthData length (only used if mem = FALSE)... 0 = use all data up to the end of file. If length over-runs the end of the file, it'll automatically be lowered to the end of the file.
flagsA combination of these flags.
BASS_MUSIC_LOOPLoop the music.
BASS_MUSIC_RAMPUse "normal" ramping (as used in FastTracker 2).
BASS_MUSIC_RAMPSUse "sensitive" ramping.
BASS_MUSIC_FT2MODPlay .MOD file as FastTracker 2 would.
BASS_MUSIC_PT1MODPlay .MOD file as ProTracker 1 would.
BASS_MUSIC_MONOForce mono mixing (uses less CPU than stereo).
BASS_MUSIC_3DEnable 3D functionality. This is ignored if BASS_DEVICE_3D wasn't specified when calling BASS_Init.
BASS_MUSIC_POSRESETStop all notes when moving position (using BASS_ChannelSetPosition or BASS_MusicPlayEx).

Return value
If successful, the loaded music's handle is returned, else 0 is returned. Use BASS_ErrorGetCode to get the error code.

Error codes
BASS_ERROR_INITBASS_Init has not been successfully called.
BASS_ERROR_FILEOPENThe file could not be opened.
BASS_ERROR_FORMATThe file's format is not recognised/supported.
BASS_ERROR_MEMThere is insufficent memory.
BASS_ERROR_NO3DCouldn't initialize 3D support.
BASS_ERROR_UNKNOWNSome other mystery problem!

Remarks
BASS uses the XMPlay engine for it's MOD music support, giving the most accurate reproduction of XM / IT / MOD / S3M / MTM files available from any sound system. The samples are interpolated during mixing for a superior sound quality.

Ramping doesn't take a lot of extra processing and improves the sound quality by removing "clicks". Sensitive ramping leaves sharp attacked samples, while normal ramping can cause them to lose a bit of their impact. Generally, normal ramping is recommended for XMs, and sensitive ramping for the other formats. But, some XMs may also sound better using sensitive ramping.

When loading a MOD music from memory, BASS does not use the memory after it's loaded the MOD music. So you can do whatever you want with the memory after calling this function.

See also
BASS_ChannelSet3DAttributes, BASS_ChannelSet3DPosition, BASS_ChannelSetAttributes, BASS_ChannelSetSync, BASS_ChannelSetEAXMix, BASS_MusicFree, BASS_MusicGetLength, BASS_MusicGetName, BASS_MusicPlay, BASS_MusicPlayEx, BASS_MusicSetAmplify, BASS_MusicSetPanSep, BASS_MusicSetPositionScaler