![]() |
Maestro - Midi Player Tool Kit for Unity Version 2.19.0
|
Builds chord settings and generated note events. More...
Public Types | |
| enum | Modifier3 { Maj , Min , Dim , DimHalf , Aug , Sus2 , Sus4 } |
| Triad quality used for three-note chord structures. More... | |
| enum | Modifier4 { Maj6 , Min6 , Maj7 , Min7 } |
| Four-note chord extensions. More... | |
Public Member Functions | |
| MPTKChordBuilder (bool log=false) | |
| Creates a default chord: tonic = C3, degree = 1, note count = 3. | |
| void | MPTK_BuildFromRange (MPTKScaleLib scale=null) |
| Builds a chord from the selected scale. Tonic and Degree must be defined in this MPTKChordBuilder instance. If scale is null, a major scale is used. After the call, Events contains all generated notes for the chord. | |
| void | MPTK_BuildFromLib (MPTKChordName chordName) |
| Builds a chord from ChordLib.csv under Resources/GeneratorTemplate. | |
| void | MPTK_BuildFromLib (int pindex) |
| Builds a chord from a zero-based index in ChordLib.csv. | |
Public Attributes | |
| int | Tonic |
| Root MIDI note for the chord. 48 = C3, 60 = C4, 61 = C#4, 62 = D4, 72 = C5. | |
| int | Count |
| Number of notes used to build the chord. Valid range is 2 to 50. | |
| int | Degree |
| Scale degree from 1 to 7. | |
| int | FromLib |
| Index of the chord in ChordLib.csv under Resources/GeneratorTemplate. Used by chord playback helpers, for example MidiStreamPlayer.MPTK_PlayChordFromLib(MPTKChordBuilder chord). | |
| int | Channel |
| MIDI channel from 0 to 15 (9 for drums). | |
| int | Velocity |
| Velocity between 0 and 127. | |
| long | Duration |
| Duration of the chord in milliseconds. Set -1 to play indefinitely. | |
| long | Delay |
| Delay in milliseconds before playing the chord. | |
| long | Arpeggio |
| Delay in milliseconds between each note in the chord (plays an arpeggio). | |
| List< MPTKEvent > | Events |
| List of MIDI events played for this chord. This list is built when MPTK_PlayChord or MPTK_PlayChordFromLib is called; otherwise, null. | |
Builds chord settings and generated note events.
Triad quality used for three-note chord structures.
| MidiPlayerTK.MPTKChordBuilder.MPTKChordBuilder | ( | bool | log = false | ) |
Creates a default chord: tonic = C3, degree = 1, note count = 3.
| log | True to enable debug logging. |
| void MidiPlayerTK.MPTKChordBuilder.MPTK_BuildFromRange | ( | MPTKScaleLib | scale = null | ) |
Builds a chord from the selected scale. Tonic and Degree must be defined in this MPTKChordBuilder instance. If scale is null, a major scale is used. After the call, Events contains all generated notes for the chord.
| scale | Scale source used to resolve chord notes. If null, a default major scale is created. |
| void MidiPlayerTK.MPTKChordBuilder.MPTK_BuildFromLib | ( | MPTKChordName | chordName | ) |
Builds a chord from ChordLib.csv under Resources/GeneratorTemplate.
| chordName | Name of the chord. |
| void MidiPlayerTK.MPTKChordBuilder.MPTK_BuildFromLib | ( | int | pindex | ) |
Builds a chord from a zero-based index in ChordLib.csv.
| pindex | Zero-based position in ChordLib.csv. |
| int MidiPlayerTK.MPTKChordBuilder.Degree |
Scale degree from 1 to 7.