Maestro - Midi Player Tool Kit for Unity Version 2.18.2
Loading...
Searching...
No Matches
MPTKChannels and MPTKChannel Concepts

Understand channel collection vs. per-channel runtime state in Maestro MPTK.

The source file MPTKChannels.cs defines two complementary classes:

Together they expose the channel model used by MPTK playback systems.

MIDI Channel Context

Standard MIDI defines 16 channels per port. In MPTK, channel indices are zero-based (0 to 15). General MIDI conventionally uses channel 9 (10 in 1-based notation) for percussion.

Role of MPTKChannels

MPTKChannels is the container and entry point for channel-level operations:

  • index access to a specific channel with MidiPlayerTK.MPTKChannels.this[int] "this[int]",
  • global channel toggles such as EnableAll,
  • global channel gain with VolumeAll,
  • extension-state reset with ResetExtension().

This class is mainly used when you need to inspect or configure channels as a group.

Role of MPTKChannel

MPTKChannel stores and applies one channel's playback state:

This class is used when you need per-instrument/per-part behavior.

How Both Classes Work Together

Typical flow:

  • get a channel from MPTKChannels,
  • update its per-channel state on MPTKChannel,
  • optionally apply broad changes through the collection for all channels.
// Example: configure channel 0, mute channel 9, then lower all channels.
MPTKChannels channels = midiPlayer.MPTK_Channels;
channels[0].PresetNum = 40;
channels[9].Enable = false;
channels.VolumeAll = 0.8f;
See also
MidiPlayerTK.MPTKChannels
MidiPlayerTK.MPTKChannel
MidiFilePlayer Overview
MidiStreamPlayer Overview