Represents a MIDI message.
More...
|
| MidiMessage (int status, int data1, int data2) |
| Creates a new MIDI message.
|
|
| MidiMessage (int rawData) |
| Creates a new MIDI message from a raw message.
|
|
|
static MidiMessage | StartNote (int note, int volume, int channel) |
| Starts a note with the specified parameters and returns the corresponding MIDI message.
|
|
static MidiMessage | StopNote (int note, int volume, int channel) |
| Stops the specified note on the given channel with the specified volume.
|
|
static MidiMessage | ChangePatch (int patch, int channel) |
| Changes the patch for the specified MIDI channel and returns the corresponding MIDI message.
|
|
static MidiMessage | ChangeControl (int controller, int value, int channel) |
| Changes the control value for a specific MIDI controller on the specified channel and returns the corresponding MIDI message.
|
|
|
int | RawData [get] |
| Returns the raw MIDI message data.
|
|
|
static void | ValidateNoteParameters (int note, int volume, int channel) |
| Validates the note, volume, and channel parameters for MIDI messages.
|
|
static void | ValidateChannel (int channel) |
| Validates the channel number to ensure it falls within the range of 1 to 16.
|
|
Represents a MIDI message.
◆ MidiMessage() [1/2]
NAudio.Midi.MidiMessage.MidiMessage |
( |
int | status, |
|
|
int | data1, |
|
|
int | data2 ) |
|
inline |
Creates a new MIDI message.
- Parameters
-
status | Status |
data1 | Data parameter 1 |
data2 | Data parameter 2 |
◆ MidiMessage() [2/2]
NAudio.Midi.MidiMessage.MidiMessage |
( |
int | rawData | ) |
|
|
inline |
Creates a new MIDI message from a raw message.
- Parameters
-
rawData | A packed MIDI message from an MMIO function |
◆ ChangeControl()
static MidiMessage NAudio.Midi.MidiMessage.ChangeControl |
( |
int | controller, |
|
|
int | value, |
|
|
int | channel ) |
|
inlinestatic |
Changes the control value for a specific MIDI controller on the specified channel and returns the corresponding MIDI message.
- Parameters
-
controller | The MIDI controller number to be changed. |
value | The new value for the MIDI controller. |
channel | The MIDI channel on which the control change should occur. |
- Exceptions
-
ArgumentException | Thrown when the specified MIDI channel is invalid. |
- Returns
- A MIDI message representing the control change with the specified parameters.
This method validates the specified MIDI channel and creates a MIDI message for the control change using the provided controller number and value. The MIDI message is then returned for further processing or transmission.
◆ ChangePatch()
static MidiMessage NAudio.Midi.MidiMessage.ChangePatch |
( |
int | patch, |
|
|
int | channel ) |
|
inlinestatic |
Changes the patch for the specified MIDI channel and returns the corresponding MIDI message.
- Parameters
-
patch | The patch number to be changed. |
channel | The MIDI channel on which the patch change should occur. |
- Exceptions
-
ArgumentException | Thrown when the provided MIDI channel is not valid. |
- Returns
- A MIDI message representing the patch change on the specified channel.
This method validates the provided MIDI channel using the ValidateChannel method to ensure it is within the valid range. It then creates and returns a new MIDI message with the appropriate command code, channel, and patch number.
◆ StartNote()
static MidiMessage NAudio.Midi.MidiMessage.StartNote |
( |
int | note, |
|
|
int | volume, |
|
|
int | channel ) |
|
inlinestatic |
Starts a note with the specified parameters and returns the corresponding MIDI message.
- Parameters
-
note | The MIDI note number to be played. |
volume | The volume of the note to be played. |
channel | The MIDI channel on which the note should be played. |
- Exceptions
-
ArgumentException | Thrown when the note, volume, or channel parameters are invalid. |
- Returns
- A MIDI message representing the start of the specified note with the given volume on the specified channel.
This method validates the input parameters using the ValidateNoteParameters method to ensure that the note, volume, and channel are within valid ranges. It then creates and returns a new MIDI message using the specified parameters, where the command code is NoteOn for the specified channel, followed by the note number and volume.
◆ StopNote()
static MidiMessage NAudio.Midi.MidiMessage.StopNote |
( |
int | note, |
|
|
int | volume, |
|
|
int | channel ) |
|
inlinestatic |
Stops the specified note on the given channel with the specified volume.
- Parameters
-
note | The MIDI note number to stop. |
volume | The volume at which to stop the note. |
channel | The MIDI channel on which to stop the note. |
- Exceptions
-
ArgumentException | Thrown when the note, volume, or channel is not within the valid range. |
- Returns
- A MIDI message to stop the specified note on the given channel with the specified volume.
This method validates the input parameters for note, volume, and channel using the ValidateNoteParameters method. It then creates and returns a MIDI message to stop the specified note on the given channel with the specified volume.
◆ ValidateChannel()
static void NAudio.Midi.MidiMessage.ValidateChannel |
( |
int | channel | ) |
|
|
inlinestaticprivate |
Validates the channel number to ensure it falls within the range of 1 to 16.
- Parameters
-
channel | The channel number to be validated. |
- Exceptions
-
ArgumentOutOfRangeException | Thrown when the channel number is not within the range of 1 to 16. |
This method validates the input channel number to ensure it falls within the acceptable range of 1 to 16. If the channel number is not within the specified range, an ArgumentOutOfRangeException is thrown with a descriptive message indicating the invalid channel number.
◆ ValidateNoteParameters()
static void NAudio.Midi.MidiMessage.ValidateNoteParameters |
( |
int | note, |
|
|
int | volume, |
|
|
int | channel ) |
|
inlinestaticprivate |
Validates the note, volume, and channel parameters for MIDI messages.
- Parameters
-
note | The MIDI note number to be validated. |
volume | The velocity value to be validated. |
channel | The MIDI channel number to be validated. |
- Exceptions
-
ArgumentOutOfRangeException | Thrown when the note number is not in the range 0-127 or when the volume is not in the range 0-127. |
This method validates the input parameters for MIDI messages. It checks if the note number is within the range 0-127 and if the volume value is within the range 0-127. If any of the parameters are invalid, an ArgumentOutOfRangeException is thrown with a descriptive message indicating the specific parameter that caused the exception.
◆ rawData
int NAudio.Midi.MidiMessage.rawData |
|
private |
◆ RawData
int NAudio.Midi.MidiMessage.RawData |
|
get |
Returns the raw MIDI message data.
The documentation for this class was generated from the following file:
- /Users/sumansaurabh/Documents/my-startup/xeno-rat/Plugins/LiveMicrophone/lib/NAudio.Midi/Midi/MidiMessage.cs