Maestro - Midi Player Tool Kit for Unity Version 2.18.2
Loading...
Searching...
No Matches
SoundFont Management

Runtime loading, caching, and exploration of SoundFonts. More...

Topics

 Loading and Activation
 Load SoundFonts from internal resources, local files, or remote URLs.
 Download and Cache Control
 Control caching, reuse, and download-only behavior for external SoundFonts.
 Status, Timing, and Callbacks
 Monitor loading progress, completion status, and timing information.
 Current SoundFont State
 Query the active SoundFont, its name, origin, and readiness.
 Preset and Bank Access
 Access the banks and presets defined by the active SoundFont.

Classes

class  MidiPlayerTK.MPTKSoundFont
 Provides runtime access to SoundFont loading, caching, state inspection, and preset/bank exploration. More...

Functions

bool MidiPlayerTK.MPTKSoundFont.SelectBankInstrument (int bankNumber)
 This method change the default instrument drum bank and build the presets list associated. See ListPreset.
Note 1: this call doesn't change the current MIDI bank used to play an instrument, only the content of ListPreset.
Note 2: to apply the bank to all channels, the synth must be restarted: call MidiFilePlayer.MPTK_InitSynth.
Note 3: to change the current bank, rather use #MidiSynth.MPTK_ChannelPresetChange
.
bool MidiPlayerTK.MPTKSoundFont.SelectBankDrum (int bankNumber)
 This method change the default instrument drum bank and build the presets list associated. See ListPresetDrum.
Note 1: this call doesn't change the current MIDI bank used to play a drum, only the content of ListPresetDrum.
Note 2: to apply the bank to all channels, the synth must be restarted: call MidixxxPlayer.MPTK_InitSynth.
Note 3: to change the current bank, rather use MidiSynthPlayer.MPTK_ChannelPresetChange
.

Properties

List< string > MidiPlayerTK.MPTKSoundFont.BanksName [get]
 List of banks name available with the format "<number> - Bank". Unlike preset, there is no bank name defined in a Soundfont.
Index in the list is not the bank number (missing bank have been removed), use the same index in BanksNumber to get the bank number.

Detailed Description

Runtime loading, caching, and exploration of SoundFonts.

A SoundFont defines the samples, banks, and presets used by the synthesizer to render MIDI events.

Maestro MPTK allows SoundFonts to be loaded dynamically while the application is running. This makes it possible to:

  • download SoundFonts from a web server,
  • load SoundFonts from the local file system,
  • switch between multiple SoundFonts during runtime,
  • use different SoundFonts for different MIDI players.

SoundFonts can be loaded from:

  • the internal MPTK SoundFont database,
  • a local file using file://,
  • a remote resource using http:// or https://.

When loading from external resources, the API also supports:

  • download progress monitoring,
  • local caching of downloaded SoundFonts,
  • download without activation,
  • callbacks when the SoundFont becomes available.

Once loaded, the API exposes the structure of the SoundFont, including the list of available banks and presets for both instruments and drum kits. These lists can be used to build user interfaces or to prepare MIDI preset changes.

Note
These APIs manage SoundFont resources and metadata. They do not directly change the active instrument used by a MIDI channel during playback. To change instruments during playback, use MidiPlayerTK.MidiSynth.MPTK_ChannelPresetChange.
See also
SoundFont Overview
Runtime SoundFont Loading
Working with Banks and Presets
Best Practices for External SoundFonts

Function Documentation

◆ SelectBankInstrument()

bool MidiPlayerTK.MPTKSoundFont.SelectBankInstrument ( int bankNumber)

This method change the default instrument drum bank and build the presets list associated. See ListPreset.
Note 1: this call doesn't change the current MIDI bank used to play an instrument, only the content of ListPreset.
Note 2: to apply the bank to all channels, the synth must be restarted: call MidiFilePlayer.MPTK_InitSynth.
Note 3: to change the current bank, rather use #MidiSynth.MPTK_ChannelPresetChange
.

Parameters
bankNumberNumber of the SoundFont Bank to load for instrument.
Returns
true if bank has been found else false.
See also
BanksName
BanksNumber
PresetsName
MidiSynth.MPTK_ChannelPresetChange

◆ SelectBankDrum()

bool MidiPlayerTK.MPTKSoundFont.SelectBankDrum ( int bankNumber)

This method change the default instrument drum bank and build the presets list associated. See ListPresetDrum.
Note 1: this call doesn't change the current MIDI bank used to play a drum, only the content of ListPresetDrum.
Note 2: to apply the bank to all channels, the synth must be restarted: call MidixxxPlayer.MPTK_InitSynth.
Note 3: to change the current bank, rather use MidiSynthPlayer.MPTK_ChannelPresetChange
.

Parameters
bankNumberNumber of the SoundFont Bank to load for drum.
Returns
true if bank has been found else false.
See also
PresetsDrumName
PresetsDrumNumber
MidiSynth.MPTK_ChannelPresetChange