![]() |
Maestro - Midi Player Tool Kit for Unity Version 2.18.2
|
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 processing samples by the synth and the MIDI sequencer. Useful only after calling MPTK_StopSynth when using MidiStreamPlayer. | |
| void | MidiPlayerTK.MidiSynth.MPTK_ClearAllSound (bool destroyAudioSource=false, int _idSession=-1) |
| Clears all sound by sending NoteOff messages. This can take a few seconds because sample release times must play out. | |
| 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 processing samples by the synth and the MIDI sequencer. See also MPTK_StartSynth. | |
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 processing samples by the synth and the MIDI sequencer. Useful only after calling MPTK_StopSynth when using MidiStreamPlayer.
| void MidiPlayerTK.MidiSynth.MPTK_ClearAllSound | ( | bool | destroyAudioSource = false, |
| int | _idSession = -1 ) |
Clears all sound by sending NoteOff messages. This can take a few seconds because sample release times must play out.
| destroyAudioSource | Useful only in non-core mode. |
| _idSession | Clear only samples playing in this session; -1 clears all (default). |
| 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.
| 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.