BASS_MIDI_FontInitUser

Initializes a soundfont via user callback functions.

HSOUNDFONT BASS_MIDI_FontInitUser(
    BASS_FILEPROCS *procs,
    void *user,
    DWORD flags
);

Parameters

procsThe user defined file functions.
userUser instance data to pass to the callback functions.
flagsAny combination of these flags.
BASS_MIDI_FONT_LINATTMODUse a linear attack phase in SF2 modulation (pitch/filter) envelopes. Otherwise a convex curve is used. The attack phase is always linear in SFZ envelopes.
BASS_MIDI_FONT_LINDECVOLUse linear decay and release phases in volume envelopes. Otherwise a concave curve is used. The attack phase is always linear.
BASS_MIDI_FONT_MINFXTreat the reverb/chorus levels in the soundfont as minimums. The higher of them and the MIDI levels (CC91/93) will be used instead of the sum of both.
BASS_MIDI_FONT_NOFXIgnore the reverb/chorus levels in the soundfont and only use the MIDI levels (CC91/93).
BASS_MIDI_FONT_NORAMPINNever ramp-in the start of a sample in the soundfont. Otherwise a sample will be ramped-in if its data does not begin with a 0 (further away results in a longer ramp). This is only relevant when the volume envelope has no attack phase.
BASS_MIDI_FONT_NOSBLIMITSDo not emulate Creative/SoundBlaster hardware filter and SF2 generator limits. This flag is always applied to SFZ files.
BASS_MIDI_FONT_SBLIMITSEmulate Creative/SoundBlaster hardware filter and SF2 generator limits. This flag only applies to SF2 files. If neither this or BASS_MIDI_FONT_NOSBLIMITS are specified then emulation will be determined by how the file was created, with it being enabled if the file's "ISFT" chunk contains "SFEDT" or "E-mu Systems SoundFont Designer", and the result reflected by BASS_MIDI_FontFlags.
BASS_MIDI_FONT_XGDRUMSUse bank 127 in the soundfont for XG drum kits. When an XG drum kit is needed, bank 127 in soundfonts that have this flag set will be checked first, before falling back to bank 128 (the standard SF2 drum kit bank) if it is not available there.

Return value

If successful, the soundfont's handle is returned, else 0 is returned. Use BASS_ErrorGetCode to get the error code.

Error codes

BASS_ERROR_FILEFORMThe file's format is not recognised/supported.
BASS_ERROR_MEMThere is insufficient memory.
BASS_ERROR_MIDI_INCLUDEAn SFZ #include directive file could not be opened.

Remarks

The unbuffered file system (STREAMFILE_NOBUFFER) is always used by this function.

See also

BASS_MIDI_FontFree, BASS_MIDI_FontGetInfo, BASS_MIDI_FontGetPresets, BASS_MIDI_FontInit, BASS_MIDI_FontPack, BASS_MIDI_FontLoad, BASS_MIDI_FontSetVolume, BASS_MIDI_StreamSetFonts, BASS_CONFIG_MIDI_COMPACT, BASS_CONFIG_MIDI_SFZHEAD