Midi Event class for MPTK. Use this class to generate Midi Music with MidiStreamPlayer or to read midi events from a Midi file with MidiLoad or to receive midi events from MidiFilePlayer OnEventNotesMidi. With this class, you can: play and stop a note, change instrument (preset, patch, ...), change some control as modulation See here https://paxstellar.fr/class-mptkevent
More...
Inherits ICloneable, and ICloneable.
|
| MPTKEvent (ulong data) |
| Create a MPTK Midi event from a midi input message More...
|
|
bool | MTPK_ModifySynthParameter (fluid_gen_type genType, float value, MPTKModeGeneratorChange mode) |
| [Pro] Apply modification on default SoundFont generator value. Can be applied independently for each notes, can be applied in real time when the note is played. More...
|
|
ulong | ToData () |
| Build a packet midi message from a MPTKEvent. Example: 0x00403C90 for a noton (90h, 3Ch note, 40h volume) More...
|
|
override string | ToString () |
| Build a string description of the Midi event. V2.83 removes
on each returns string More...
|
|
|
int | Channel |
| Midi channel fom 0 to 15 (9 for drum) More...
|
|
MPTKCommand | Command |
| Midi Command code. Defined the type of message (Note On, Control Change, Patch Change...) More...
|
|
MPTKController | Controller |
| Controller code. When the Command is ControlChange, contains the code fo the controller to change (Modulation, Pan, Bank Select ...). Value will contains the value of the controller. More...
|
|
long | Delay |
| Delay before playing the note in millisecond. New with V2.82, works only in Core mode. More...
|
|
long | Duration |
| Duration of the note in millisecond. Set -1 to play undefinitely. More...
|
|
int | IdSession |
| V2.84 Define an Id associated with this event. Can be used with MPTK_ClearAllSound to clear only a subset of sound associated with this session. More...
|
|
string | Info |
| Information hold by textual meta event when Command=MetaEvent More...
|
|
int | Length |
| Duration of the note in Midi Tick. MidiFilePlayer.MPTK_NoteLength can be used to convert this duration. Not used for MidiStreamPlayer, length is set only when reading a Midi file. https://en.wikipedia.org/wiki/Note_value More...
|
|
MPTKMeta | Meta |
| MetaEvent Code. When the Command is MetaEvent, contains the code of the meta event (Lyric, TimeSignature, ...). . Info will contains the value of the meta. More...
|
|
uint | Source |
| Origine of the message. Midi ID if from Midi Input else zero. V2.83: rename source to Source et set public. More...
|
|
object | Tag |
| V2.87 Tag information More...
|
|
long | Tick |
| Time in Midi Tick (part of a Beat) of the Event since the start of playing the midi file. This time is independent of the Tempo or Speed. Not used for MidiStreamPlayer. More...
|
|
long | TickTime |
| V2.86 Time in System.DateTime when the Event is created or read from the Midi file. Can be read from a system thread. More...
|
|
long | Track |
| Index of track. More...
|
|
int | Value |
| Contains a value between 0 and 127 in relation with the Command. For: More...
|
|
int | Velocity |
| Velocity between 0 and 127 More...
|
|
List< fluid_voice > | Voices |
| List of voices associated to this Event for playing a NoteOn event. More...
|
|
Midi Event class for MPTK. Use this class to generate Midi Music with MidiStreamPlayer or to read midi events from a Midi file with MidiLoad or to receive midi events from MidiFilePlayer OnEventNotesMidi. With this class, you can: play and stop a note, change instrument (preset, patch, ...), change some control as modulation See here https://paxstellar.fr/class-mptkevent
!
!
! NotePlaying = new MPTKEvent() {
! midiStreamPlayer.MPTK_PlayEvent(NotePlaying);
!
!
! NotePlaying = new MPTKEvent() {
! midiStreamPlayer.MPTK_PlayEvent(NotePlaying);
!
long Duration
Duration of the note in millisecond. Set -1 to play undefinitely.
Definition: MPTKEvent.cs:220
MPTKCommand Command
Midi Command code. Defined the type of message (Note On, Control Change, Patch Change....
Definition: MPTKEvent.cs:182
int Velocity
Velocity between 0 and 127
Definition: MPTKEvent.cs:215
int Value
Contains a value between 0 and 127 in relation with the Command. For:
Definition: MPTKEvent.cs:205
int Channel
Midi channel fom 0 to 15 (9 for drum)
Definition: MPTKEvent.cs:210
MPTKCommand
MIDI command codes. Defined the action to be done with the message: note on/off, change instrument,...
Definition: MPTKEvent.cs:15
◆ EnumLength
◆ MPTKEvent()
MidiPlayerTK.MPTKEvent.MPTKEvent |
( |
ulong |
data | ) |
|
Create a MPTK Midi event from a midi input message
- Parameters
-
◆ MTPK_ModifySynthParameter()
bool MidiPlayerTK.MPTKEvent.MTPK_ModifySynthParameter |
( |
fluid_gen_type |
genType, |
|
|
float |
value, |
|
|
MPTKModeGeneratorChange |
mode |
|
) |
| |
[Pro] Apply modification on default SoundFont generator value. Can be applied independently for each notes, can be applied in real time when the note is played.
mptkEvent =
new MPTKEvent() {
Value = 60 };
mptkEvent.MTPK_ModifySynthParameter(fluid_gen_type.GEN_FINETUNE, 0.52f, MPTKModeGeneratorChange.Override);
mptkEvent.MTPK_ModifySynthParameter(fluid_gen_type.GEN_FILTERFC, 0.6f, MPTKModeGeneratorChange.Override);
midiStream.MPTK_PlayDirectEvent(mptkEvent);
!
- Parameters
-
genType | Type of generator to modify. Not all generators are authorized to real time modification. See here https://paxstellar.fr/class-mptkevent#Generator-List |
value | Value for the generator between 0 (min value for the generator) and 1 (max value for the generator). |
mode | Override: the SoundFont value is overridden, Reinforce: the value is added to the default value. |
- Returns
- true if change has been done
◆ ToData()
ulong MidiPlayerTK.MPTKEvent.ToData |
( |
| ) |
|
Build a packet midi message from a MPTKEvent. Example: 0x00403C90 for a noton (90h, 3Ch note, 40h volume)
- Returns
◆ ToString()
override string MidiPlayerTK.MPTKEvent.ToString |
( |
| ) |
|
Build a string description of the Midi event. V2.83 removes
on each returns string
- Returns
◆ Channel
int MidiPlayerTK.MPTKEvent.Channel |
Midi channel fom 0 to 15 (9 for drum)
◆ Command
Midi Command code. Defined the type of message (Note On, Control Change, Patch Change...)
◆ Controller
Controller code. When the Command is ControlChange, contains the code fo the controller to change (Modulation, Pan, Bank Select ...). Value will contains the value of the controller.
◆ Delay
long MidiPlayerTK.MPTKEvent.Delay |
Delay before playing the note in millisecond. New with V2.82, works only in Core mode.
◆ Duration
long MidiPlayerTK.MPTKEvent.Duration |
Duration of the note in millisecond. Set -1 to play undefinitely.
◆ IdSession
int MidiPlayerTK.MPTKEvent.IdSession |
V2.84 Define an Id associated with this event. Can be used with MPTK_ClearAllSound to clear only a subset of sound associated with this session.
◆ Info
string MidiPlayerTK.MPTKEvent.Info |
Information hold by textual meta event when Command=MetaEvent
◆ Length
int MidiPlayerTK.MPTKEvent.Length |
◆ Meta
MetaEvent Code. When the Command is MetaEvent, contains the code of the meta event (Lyric, TimeSignature, ...). . Info will contains the value of the meta.
◆ Source
uint MidiPlayerTK.MPTKEvent.Source |
Origine of the message. Midi ID if from Midi Input else zero. V2.83: rename source to Source et set public.
◆ Tag
object MidiPlayerTK.MPTKEvent.Tag |
◆ Tick
long MidiPlayerTK.MPTKEvent.Tick |
Time in Midi Tick (part of a Beat) of the Event since the start of playing the midi file. This time is independent of the Tempo or Speed. Not used for MidiStreamPlayer.
◆ TickTime
long MidiPlayerTK.MPTKEvent.TickTime |
V2.86 Time in System.DateTime when the Event is created or read from the Midi file. Can be read from a system thread.
◆ Track
long MidiPlayerTK.MPTKEvent.Track |
◆ Value
int MidiPlayerTK.MPTKEvent.Value |
Contains a value between 0 and 127 in relation with the Command. For:
If
Command = NoteOn then Value contains midi note. 60=C5, 61=C5#, ..., 72=C6, ....
If
Command = ControlChange then Value contains controller value, see MPTKController
If
Command = PatchChange then Value contains patch/preset/instrument value. See the current SoundFont to find value associated to each instrument.
◆ Velocity
int MidiPlayerTK.MPTKEvent.Velocity |
Velocity between 0 and 127
◆ Voices
List<fluid_voice> MidiPlayerTK.MPTKEvent.Voices |
List of voices associated to this Event for playing a NoteOn event.
◆ IsOver
bool MidiPlayerTK.MPTKEvent.IsOver |
|
get |
CHeck if playing of this midi event is over (all voices are OFF)
◆ MPTK_DeltaTimeMillis
long MidiPlayerTK.MPTKEvent.MPTK_DeltaTimeMillis |
|
get |
V2.86 Delta time in milliseconds since the creation of this event
◆ MPTK_DeltaTimeTick
long MidiPlayerTK.MPTKEvent.MPTK_DeltaTimeTick |
|
get |
V2.86 Delta time in system ticks since the creation of this event