Class NotesManagingUtilities
Extension methods for notes managing.
Inheritance
NotesManagingUtilities
Assembly: Melanchall.DryWetMidi.dll
Syntax
public static class NotesManagingUtilities
Methods
GetMusicTheoryNote(Note)
Returns
Note corresponding to the specified
Note.
Declaration
public static Note GetMusicTheoryNote(this Note note)
Parameters
Type |
Name |
Description |
Note |
note |
Note to get music theory note from. |
Returns
Type |
Description |
Note |
Note corresponding to the note . |
Exceptions
GetNotes(EventsCollection, NoteDetectionSettings)
Declaration
public static ICollection<Note> GetNotes(this EventsCollection eventsCollection, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<Note> |
Collection of notes contained in eventsCollection ordered by time. |
Exceptions
See Also
GetNotes(MidiFile, NoteDetectionSettings)
Declaration
public static ICollection<Note> GetNotes(this MidiFile file, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<Note> |
Collection of notes contained in file ordered by time. |
Exceptions
See Also
GetNotes(TrackChunk, NoteDetectionSettings)
Declaration
public static ICollection<Note> GetNotes(this TrackChunk trackChunk, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<Note> |
Collection of notes contained in trackChunk ordered by time. |
Exceptions
See Also
GetNotes(IEnumerable<MidiEvent>, NoteDetectionSettings)
Declaration
public static ICollection<Note> GetNotes(this IEnumerable<MidiEvent> midiEvents, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<Note> |
Collection of notes contained in midiEvents ordered by time. |
Exceptions
GetNotes(IEnumerable<TrackChunk>, NoteDetectionSettings)
Declaration
public static ICollection<Note> GetNotes(this IEnumerable<TrackChunk> trackChunks, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<Note> |
Collection of notes contained in trackChunks ordered by time. |
Exceptions
See Also
ManageNotes(EventsCollection, NoteDetectionSettings, TimedObjectsComparer)
Declaration
public static TimedObjectsManager<Note> ManageNotes(this EventsCollection eventsCollection, NoteDetectionSettings settings = null, TimedObjectsComparer comparer = null)
Parameters
Returns
Exceptions
ManageNotes(TrackChunk, NoteDetectionSettings, TimedObjectsComparer)
Declaration
public static TimedObjectsManager<Note> ManageNotes(this TrackChunk trackChunk, NoteDetectionSettings settings = null, TimedObjectsComparer comparer = null)
Parameters
Returns
Exceptions
ProcessNotes(EventsCollection, Action<Note>, NoteDetectionSettings, NoteProcessingHint)
Declaration
public static int ProcessNotes(this EventsCollection eventsCollection, Action<Note> action, NoteDetectionSettings settings = null, NoteProcessingHint hint = NoteProcessingHint.TimeOrLengthCanBeChanged)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed notes. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
eventsCollection is null .action is null .
|
ProcessNotes(EventsCollection, Action<Note>, Predicate<Note>, NoteDetectionSettings, NoteProcessingHint)
Declaration
public static int ProcessNotes(this EventsCollection eventsCollection, Action<Note> action, Predicate<Note> match, NoteDetectionSettings settings = null, NoteProcessingHint hint = NoteProcessingHint.TimeOrLengthCanBeChanged)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed notes. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
eventsCollection is null .action is null .match is null .
|
ProcessNotes(MidiFile, Action<Note>, NoteDetectionSettings, NoteProcessingHint)
Performs the specified action on each
Note contained in the
MidiFile.
Declaration
public static int ProcessNotes(this MidiFile file, Action<Note> action, NoteDetectionSettings settings = null, NoteProcessingHint hint = NoteProcessingHint.TimeOrLengthCanBeChanged)
Parameters
Type |
Name |
Description |
MidiFile |
file |
MidiFile to search for notes to process. |
Action<Note> |
action |
The action to perform on each Note contained in the
file . |
NoteDetectionSettings |
settings |
Settings according to which notes should be detected and built. |
NoteProcessingHint |
hint |
Hint which tells the processing algorithm how it can optimize its performance.
The default value is Default. |
Returns
Type |
Description |
Int32 |
Count of processed notes. |
Exceptions
ProcessNotes(MidiFile, Action<Note>, Predicate<Note>, NoteDetectionSettings, NoteProcessingHint)
Performs the specified action on each
Note contained in the
MidiFile.
Declaration
public static int ProcessNotes(this MidiFile file, Action<Note> action, Predicate<Note> match, NoteDetectionSettings settings = null, NoteProcessingHint hint = NoteProcessingHint.TimeOrLengthCanBeChanged)
Parameters
Type |
Name |
Description |
MidiFile |
file |
MidiFile to search for notes to process. |
Action<Note> |
action |
The action to perform on each Note contained in the
file . |
Predicate<Note> |
match |
The predicate that defines the conditions of the Note to process. |
NoteDetectionSettings |
settings |
Settings according to which notes should be detected and built. |
NoteProcessingHint |
hint |
Hint which tells the processing algorithm how it can optimize its performance.
The default value is Default. |
Returns
Type |
Description |
Int32 |
Count of processed notes. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
file is null .action is null .match is null .
|
ProcessNotes(TrackChunk, Action<Note>, NoteDetectionSettings, NoteProcessingHint)
Performs the specified action on each
Note contained in the
TrackChunk.
Declaration
public static int ProcessNotes(this TrackChunk trackChunk, Action<Note> action, NoteDetectionSettings settings = null, NoteProcessingHint hint = NoteProcessingHint.TimeOrLengthCanBeChanged)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed notes. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
trackChunk is null .action is null .
|
ProcessNotes(TrackChunk, Action<Note>, Predicate<Note>, NoteDetectionSettings, NoteProcessingHint)
Performs the specified action on each
Note contained in the
TrackChunk.
Declaration
public static int ProcessNotes(this TrackChunk trackChunk, Action<Note> action, Predicate<Note> match, NoteDetectionSettings settings = null, NoteProcessingHint hint = NoteProcessingHint.TimeOrLengthCanBeChanged)
Parameters
Type |
Name |
Description |
TrackChunk |
trackChunk |
TrackChunk to search for notes to process. |
Action<Note> |
action |
The action to perform on each Note contained in the
trackChunk . |
Predicate<Note> |
match |
The predicate that defines the conditions of the Note to process. |
NoteDetectionSettings |
settings |
Settings according to which notes should be detected and built. |
NoteProcessingHint |
hint |
Hint which tells the processing algorithm how it can optimize its performance.
The default value is Default. |
Returns
Type |
Description |
Int32 |
Count of processed notes. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
trackChunk is null .action is null .match is null .
|
ProcessNotes(IEnumerable<TrackChunk>, Action<Note>, NoteDetectionSettings, NoteProcessingHint)
Performs the specified action on each
Note contained in the collection of
TrackChunk.
Declaration
public static int ProcessNotes(this IEnumerable<TrackChunk> trackChunks, Action<Note> action, NoteDetectionSettings settings = null, NoteProcessingHint hint = NoteProcessingHint.TimeOrLengthCanBeChanged)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed notes. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
trackChunks is null .action is null .
|
ProcessNotes(IEnumerable<TrackChunk>, Action<Note>, Predicate<Note>, NoteDetectionSettings, NoteProcessingHint)
Performs the specified action on each
Note contained in the collection of
TrackChunk.
Declaration
public static int ProcessNotes(this IEnumerable<TrackChunk> trackChunks, Action<Note> action, Predicate<Note> match, NoteDetectionSettings settings = null, NoteProcessingHint hint = NoteProcessingHint.TimeOrLengthCanBeChanged)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed notes. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
trackChunks is null .action is null .match is null .
|
RemoveNotes(EventsCollection, NoteDetectionSettings)
Removes all the
Note that match the conditions defined by the specified predicate.
Declaration
public static int RemoveNotes(this EventsCollection eventsCollection, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed notes. |
Exceptions
RemoveNotes(EventsCollection, Predicate<Note>, NoteDetectionSettings)
Removes all the
Note that match the conditions defined by the specified predicate.
Declaration
public static int RemoveNotes(this EventsCollection eventsCollection, Predicate<Note> match, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed notes. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
eventsCollection is null .match is null .
|
RemoveNotes(MidiFile, NoteDetectionSettings)
Removes all the
Note that match the conditions defined by the specified predicate.
Declaration
public static int RemoveNotes(this MidiFile file, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed notes. |
Exceptions
RemoveNotes(MidiFile, Predicate<Note>, NoteDetectionSettings)
Removes all the
Note that match the conditions defined by the specified predicate.
Declaration
public static int RemoveNotes(this MidiFile file, Predicate<Note> match, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed notes. |
Exceptions
RemoveNotes(TrackChunk, NoteDetectionSettings)
Removes all the
Note that match the conditions defined by the specified predicate.
Declaration
public static int RemoveNotes(this TrackChunk trackChunk, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed notes. |
Exceptions
RemoveNotes(TrackChunk, Predicate<Note>, NoteDetectionSettings)
Removes all the
Note that match the conditions defined by the specified predicate.
Declaration
public static int RemoveNotes(this TrackChunk trackChunk, Predicate<Note> match, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed notes. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
trackChunk is null .match is null .
|
RemoveNotes(IEnumerable<TrackChunk>, NoteDetectionSettings)
Removes all the
Note that match the conditions defined by the specified predicate.
Declaration
public static int RemoveNotes(this IEnumerable<TrackChunk> trackChunks, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed notes. |
Exceptions
RemoveNotes(IEnumerable<TrackChunk>, Predicate<Note>, NoteDetectionSettings)
Removes all the
Note that match the conditions defined by the specified predicate.
Declaration
public static int RemoveNotes(this IEnumerable<TrackChunk> trackChunks, Predicate<Note> match, NoteDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed notes. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
trackChunks is null .match is null .
|