Maestro - Midi Player Tool Kit for Unity Version 2.19.0
Loading...
Searching...
No Matches
MidiPlayerTK.MPTKChordProgressionLib

Utility library for emotional progression presets and Roman-degree parsing. Roman roots are resolved from a tonic using a major-reference semitone map: I=0, II=2, III=4, IV=5, V=7, VI=9, VII=11, plus optional accidentals. Chord quality is then derived from case and supported ASCII suffixes. More...

Static Public Member Functions

static MPTKChordProgressionPreset FindPreset (string id)
 Finds a progression preset by id (case-insensitive).
static List< MPTKResolvedChordStepResolveDegrees (string[] degreeTokens, int tonicMidi)
 Resolves a progression to concrete tonic and chord-library entries. The tonic is the root note of degree I/i (for example, C4 = 60).
static List< MPTKChordBuilderCreateChordBuilders (string[] degreeTokens, int tonicMidi, int channel=0, int velocity=100, long duration=500, long delayBetweenChords=500)
 Builds MPTKChordBuilder instances from Roman-degree tokens. Example playback target: MidiStreamPlayer.MPTK_PlayChordFromLib().

Static Public Attributes

static readonly List< MPTKChordProgressionPresetPresets
 Built-in emotional progression presets. Intensity and HarmonicTension are subjective ratings from 1 (low) to 5 (high).

Detailed Description

Utility library for emotional progression presets and Roman-degree parsing. Roman roots are resolved from a tonic using a major-reference semitone map: I=0, II=2, III=4, IV=5, V=7, VI=9, VII=11, plus optional accidentals. Chord quality is then derived from case and supported ASCII suffixes.

Member Function Documentation

◆ FindPreset()

MPTKChordProgressionPreset MidiPlayerTK.MPTKChordProgressionLib.FindPreset ( string id)
static

Finds a progression preset by id (case-insensitive).

Parameters
idPreset identifier.
Returns
The matching preset, or null if not found.

◆ ResolveDegrees()

List< MPTKResolvedChordStep > MidiPlayerTK.MPTKChordProgressionLib.ResolveDegrees ( string[] degreeTokens,
int tonicMidi )
static

Resolves a progression to concrete tonic and chord-library entries. The tonic is the root note of degree I/i (for example, C4 = 60).

Parameters
degreeTokensDegree token grammar: [accidentals][Roman degree][optional suffix].
  • Accidentals: zero or more 'b' or '#', for example "bII", "##IV".
  • Roman degree core: I, II, III, IV, V, VI, VII (uppercase or lowercase). Case does not change the scale degree index, only the default triad quality
    • uppercase starts from major-triad quality,
    • lowercase starts from minor-triad quality.
  • Optional suffix markers understood by the parser: "7", "maj7", "sus", "sus4", "sus2", "dim", "o", "b5", "#5", "aug", "+". Practical examples in C:
  • "I - V - vi - IV" -> C - G - Am - F
  • "I - iii - IV - iv" -> C - Em - F - Fm Canonical degree cores are 7 values (I..VII, upper/lower case intent), but raw token strings are unbounded because accidental prefixes and suffix text can be combined freely. Notes:
  • Use ASCII only in the API.
  • Half-diminished chords should be written as m7b5-style Roman tokens, for example: "iib57".
  • Diminished chords can be written with "o" or "dim", for example: "viio" or "viidim7".
tonicMidiMIDI note number used as the tonic reference for degree I/i.
Returns
Resolved chord steps ready to map to chord-library names and tonic notes.

◆ CreateChordBuilders()

List< MPTKChordBuilder > MidiPlayerTK.MPTKChordProgressionLib.CreateChordBuilders ( string[] degreeTokens,
int tonicMidi,
int channel = 0,
int velocity = 100,
long duration = 500,
long delayBetweenChords = 500 )
static

Builds MPTKChordBuilder instances from Roman-degree tokens. Example playback target: MidiStreamPlayer.MPTK_PlayChordFromLib().

Parameters
degreeTokensProgression steps in Roman-degree notation.
tonicMidiMIDI note number used as the tonic reference for degree I/i.
channelTarget MIDI channel from 0 to 15.
velocityDefault note velocity from 0 to 127.
durationChord duration in milliseconds (-1 for indefinite).
delayBetweenChordsDelay in milliseconds inserted between generated chords.
Returns
A list of configured MPTKChordBuilder instances.