Build scales and play them with MidiStreamPlayer.
.
- Version
- Maestro Pro
See example in TestMidiStream.cs and ExtStreamPlayerPro.cs
new void Start()
{
midiStreamPlayer = FindFirstObjectByType<MidiStreamPlayer>();
}
private void PlayScale()
{
for (
int ecart = 0; ecart < range.
Count; ecart++)
{
{
Value = CurrentNote + range[ecart],
Channel = StreamChannel,
Duration = DelayPlayScale,
Velocity = Velocity,
Delay = ecart * DelayPlayScale,
};
}
}
Represents a MIDI event used throughout MPTK. This class is central to script-based MIDI workflows in...
Definition MPTKEvent.cs:59
[MPTK PRO] Build Scale and Play with MidiStreamPlayer.
Definition MPTKRangeLib.cs:46
static MPTKRangeLib Range(int index, bool log=false)
Get a scale from an index. Scales are read from GammeDefinition.csv in folder Resources/GeneratorTemp...
Definition MPTKRangeLib.cs:120
int Count
Count of notes in the range.
Definition MPTKRangeLib.cs:78
Builds and plays real-time music in response to user actions or algorithmic logic....
Definition MidiStreamPlayer.cs:44
void MPTK_PlayEvent(MPTKEvent mptkEvent)
Plays one MIDI event from an instance of MPTKEvent. Runs in a thread so the call returns immediately....
Definition MidiStreamPlayer.cs:121
MPTKCommand
MIDI command codes. Defines the action performed by the message: note on/off, patch change,...
Definition MPTKEnum.cs:16
| int MidiPlayerTK.MPTKScaleLib.this[int index] |
|
get |
Indexer on an instance of this class.
Provides access to each interval in semitones from the tonic.
For a Major Melodic scale, each index returns 0, 2, 4, 5, 7, 9, 11. The first position (index=0) always returns 0 because it is the interval count from the tonic.
- Parameters
-
| index | Index in the scale. If greater than interval count in the scale, the interval in semitones is taken from the next octave. |
- Returns
- Interval in semitones from the tonic.
Debug.Log(mptkScale[0])
Debug.Log(mptkScale[4])