Xeno-rat
Loading...
Searching...
No Matches
NAudio.Midi.NoteOnEvent Class Reference

Represents a MIDI note on event. More...

Inheritance diagram for NAudio.Midi.NoteOnEvent:
Collaboration diagram for NAudio.Midi.NoteOnEvent:

Public Member Functions

 NoteOnEvent (BinaryReader br)
 Reads a new Note On event from a stream of MIDI data.
 
 NoteOnEvent (long absoluteTime, int channel, int noteNumber, int velocity, int duration)
 Creates a NoteOn event with specified parameters.
 
override MidiEvent Clone ()
 Clones the current NoteOnEvent and returns a new instance of NoteOnEvent.
 
override string ToString ()
 Returns a string representation of the object.
 
- Public Member Functions inherited from NAudio.Midi.NoteEvent
 NoteEvent (BinaryReader br)
 Reads a NoteEvent from a stream of MIDI data.
 
 NoteEvent (long absoluteTime, int channel, MidiCommandCode commandCode, int noteNumber, int velocity)
 Creates a MIDI Note Event with specified parameters.
 
override int GetAsShortMessage ()
 Gets the short message representation of the note event.
 
override string ToString ()
 Returns a formatted string representing the note's name and velocity.
 
override void Export (ref long absoluteTime, BinaryWriter writer)
 Exports the note number and velocity to a binary writer.
 
- Public Member Functions inherited from NAudio.Midi.MidiEvent
 MidiEvent (long absoluteTime, int channel, MidiCommandCode commandCode)
 Creates a MIDI event with specified parameters.
 
override string ToString ()
 Returns a string representation of the current Midi event.
 

Properties

NoteEvent OffEvent [get, set]
 The associated Note off event.
 
override int NoteNumber [get, set]
 Get or set the Note Number, updating the off event at the same time.
 
override int Channel [get, set]
 Get or set the channel, updating the off event at the same time.
 
int NoteLength [get, set]
 The duration of this note.
 
- Properties inherited from NAudio.Midi.NoteEvent
virtual int NoteNumber [get, set]
 The MIDI note number.
 
int Velocity [get, set]
 The note velocity.
 
string NoteName [get]
 The note name.
 
- Properties inherited from NAudio.Midi.MidiEvent
virtual int Channel [get, set]
 The MIDI Channel Number for this event (1-16)
 
int DeltaTime [get]
 The Delta time for this event.
 
long AbsoluteTime [get, set]
 The absolute time for this event.
 
MidiCommandCode CommandCode [get]
 The command code for this event.
 

Private Attributes

NoteEvent offEvent
 

Additional Inherited Members

- Static Public Member Functions inherited from NAudio.Midi.MidiEvent
static MidiEvent FromRawMessage (int rawMessage)
 Converts a raw MIDI message to a MidiEvent object.
 
static MidiEvent ReadNextEvent (BinaryReader br, MidiEvent previous)
 Reads the next MIDI event from the BinaryReader and returns the corresponding MidiEvent.
 
static bool IsNoteOff (MidiEvent midiEvent)
 Checks if the given MIDI event represents a Note Off message.
 
static bool IsNoteOn (MidiEvent midiEvent)
 Checks if the provided MIDI event is a Note On event and returns true if the velocity is greater than 0.
 
static bool IsEndTrack (MidiEvent midiEvent)
 Checks if the provided MIDI event is an end track event.
 
static int ReadVarInt (BinaryReader br)
 Reads a variable-length encoded integer from the provided BinaryReader and returns the result.
 
static void WriteVarInt (BinaryWriter writer, int value)
 Writes a variable-length encoded integer to the specified BinaryWriter.
 
- Protected Member Functions inherited from NAudio.Midi.MidiEvent
 MidiEvent ()
 Default constructor.
 

Detailed Description

Represents a MIDI note on event.

Constructor & Destructor Documentation

◆ NoteOnEvent() [1/2]

NAudio.Midi.NoteOnEvent.NoteOnEvent ( BinaryReader br)
inline

Reads a new Note On event from a stream of MIDI data.

Parameters
brBinary reader on the MIDI data stream

◆ NoteOnEvent() [2/2]

NAudio.Midi.NoteOnEvent.NoteOnEvent ( long absoluteTime,
int channel,
int noteNumber,
int velocity,
int duration )
inline

Creates a NoteOn event with specified parameters.

Parameters
absoluteTimeAbsolute time of this event
channelMIDI channel number
noteNumberMIDI note number
velocityMIDI note velocity
durationMIDI note duration
Here is the call graph for this function:

Member Function Documentation

◆ Clone()

override MidiEvent NAudio.Midi.NoteOnEvent.Clone ( )
virtual

Clones the current NoteOnEvent and returns a new instance of NoteOnEvent.

Returns
A new instance of NoteOnEvent that is a clone of the current NoteOnEvent.

Reimplemented from NAudio.Midi.MidiEvent.

◆ ToString()

override string NAudio.Midi.NoteOnEvent.ToString ( )
inline

Returns a string representation of the object.

Returns
A string that represents the object. If the velocity is 0 and the OffEvent is null, it returns the note off message along with the base string representation. Otherwise, it returns the base string representation along with the length of the note.

Member Data Documentation

◆ offEvent

NoteEvent NAudio.Midi.NoteOnEvent.offEvent
private

Property Documentation

◆ Channel

override int NAudio.Midi.NoteOnEvent.Channel
getset

Get or set the channel, updating the off event at the same time.

◆ NoteLength

int NAudio.Midi.NoteOnEvent.NoteLength
getset

The duration of this note.

There must be a note off event

◆ NoteNumber

override int NAudio.Midi.NoteOnEvent.NoteNumber
getset

Get or set the Note Number, updating the off event at the same time.

◆ OffEvent

NoteEvent NAudio.Midi.NoteOnEvent.OffEvent
getset

The associated Note off event.


The documentation for this class was generated from the following file: