![]() |
Maestro - Midi Player Tool Kit for Unity Version 2.22.0
|
Runtime tuning, threading, buffering, and audio-side controls. More...
Classes | |
| class | MidiPlayerTK.MidiSynth |
| Core sample-based SoundFont synthesizer (base class). More... | |
Synthesizer Initialization And Life Cycle | |
Initialization and lifecycle of the MIDI synthesizer. This section contains methods and parameters related to the creation and initialization of the MIDI synthesizer. These functions configure the audio engine, load SoundFonts, and prepare the synth for playback. In most cases initialization is handled automatically by the prefab, but advanced users may control it directly from scripts. | |
| float | MidiPlayerTK.MidiSynth.MPTK_LeanSynthStarting = 0.05f |
| Gets or sets the initial volume level of the synthesizer at application startup. This property allows for a gradual increase in volume to prevent abrupt or unusual sounds when the application begins. | |
| void | MidiPlayerTK.MidiSynth.MPTK_InitModulators () |
| Initializes the default MIDI modulators for the synthesizer, mapping standard MIDI inputs to corresponding sound synthesis parameters according to SoundFont 2.01 specifications. | |
| void | MidiPlayerTK.MidiSynth.MPTK_StartSynth () |
| Starts the audio synthesis engine and resumes sample processing. | |
| void | MidiPlayerTK.MidiSynth.MPTK_ClearAllSound (bool destroyAudioSource=false, int _idSession=-1) |
| Clears all sound by sending NoteOff messages. | |
| void | MidiPlayerTK.MidiSynth.MPTK_InitSynth (int channelCount=16, bool preserveChannelInfo=false, bool preserveActivVoice=true) |
| Initializes the synthesizer: | |
| void | MidiPlayerTK.MidiSynth.MPTK_StartSequencerMidi () |
| Starts the MIDI sequencer: each MIDI event is read and played on a dedicated thread. This thread is started automatically by the MidiFilePlayer, MidiListPlayer, and MidiExternalPlayer prefabs. | |
| void | MidiPlayerTK.MidiSynth.MPTK_StopSynth () |
| Stops the audio synthesis engine. | |
Runtime tuning, threading, buffering, and audio-side controls.
| void MidiPlayerTK.MidiSynth.MPTK_InitModulators | ( | ) |
Initializes the default MIDI modulators for the synthesizer, mapping standard MIDI inputs to corresponding sound synthesis parameters according to SoundFont 2.01 specifications.
This method configures modulation sources and destinations so that MIDI events such as velocity, controller changes, channel pressure, and pitch wheel movements influence sound characteristics including attenuation, filter cutoff, vibrato depth, pan position, reverb, chorus, and pitch. It ensures that the synthesizer responds to MIDI input in a manner consistent with SoundFont standards, enabling expressive and dynamic sound generation. Call this method before processing MIDI events to guarantee correct modulator setup.
| void MidiPlayerTK.MidiSynth.MPTK_StartSynth | ( | ) |
Starts the audio synthesis engine and resumes sample processing.
This method is intended for synth lifecycle management. It is normally required only after MPTK_StopSynth has been called, especially when using MidiStreamPlayer.
Do not call this method to start or resume MIDI playback. Playback control is handled by the corresponding player API.
| void MidiPlayerTK.MidiSynth.MPTK_ClearAllSound | ( | bool | destroyAudioSource = false, |
| int | _idSession = -1 ) |
Clears all sound by sending NoteOff messages.
| destroyAudioSource | Ignored by this deprecated method. See remarks. |
| _idSession | Ignored by this deprecated method. See remarks. |
Both parameters are ignored: this method always requests voice destruction for all sessions. This historical behavior is preserved for backward compatibility. Use MPTK_StopAllNotes instead; version 2.22.0 fixes the parameter forwarding in that method by passing both arguments to ThreadClearAllSound.
| void MidiPlayerTK.MidiSynth.MPTK_InitSynth | ( | int | channelCount = 16, |
| bool | preserveChannelInfo = false, | ||
| bool | preserveActivVoice = true ) |
Initializes the synthesizer:
| channelCount | Number of channels to create. Default is 16. Other values are experimental. |
| preserveChannelInfo | If true, channel information is not reset. Default is false, which reinitializes channel information. |
| void MidiPlayerTK.MidiSynth.MPTK_StartSequencerMidi | ( | ) |
Starts the MIDI sequencer: each MIDI event is read and played on a dedicated thread. This thread is started automatically by the MidiFilePlayer, MidiListPlayer, and MidiExternalPlayer prefabs.
| void MidiPlayerTK.MidiSynth.MPTK_StopSynth | ( | ) |
Stops the audio synthesis engine.
This method is intended for synth lifecycle management. Do not use it to stop currently playing MIDI notes, pause playback, or reset a MidiStreamPlayer.
To immediately silence active notes while keeping the synthesizer available for subsequent events, use MPTK_ClearAllSound().
| float MidiPlayerTK.MidiSynth.MPTK_LeanSynthStarting = 0.05f |
Gets or sets the initial volume level of the synthesizer at application startup. This property allows for a gradual increase in volume to prevent abrupt or unusual sounds when the application begins.
Set this property to 1 for immediate full volume at startup. Valid values range from 0.001 to 1. Using a lower value can help avoid unexpected audio artifacts during initialization.