Class ChordsManagingUtilities
Extension methods for chords managing.
Inheritance
ChordsManagingUtilities
Assembly: Melanchall.DryWetMidi.dll
Syntax
public static class ChordsManagingUtilities
Methods
GetChords(EventsCollection, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static ICollection<Chord> GetChords(this EventsCollection eventsCollection, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Returns
Type |
Description |
ICollection<Chord> |
Collection of chords contained in eventsCollection ordered by time. |
Exceptions
See Also
GetChords(MidiFile, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static ICollection<Chord> GetChords(this MidiFile file, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Type |
Name |
Description |
MidiFile |
file |
MidiFile to search for chords. |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
Returns
Type |
Description |
ICollection<Chord> |
Collection of chords contained in file ordered by time. |
Exceptions
See Also
GetChords(TrackChunk, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static ICollection<Chord> GetChords(this TrackChunk trackChunk, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Type |
Name |
Description |
TrackChunk |
trackChunk |
TrackChunk to search for chords. |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
Returns
Type |
Description |
ICollection<Chord> |
Collection of chords contained in trackChunk ordered by time. |
Exceptions
See Also
GetChords(IEnumerable<MidiEvent>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static ICollection<Chord> GetChords(this IEnumerable<MidiEvent> midiEvents, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Returns
Type |
Description |
ICollection<Chord> |
Collection of chords contained in midiEvents ordered by time. |
Exceptions
GetChords(IEnumerable<TrackChunk>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static ICollection<Chord> GetChords(this IEnumerable<TrackChunk> trackChunks, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Type |
Name |
Description |
IEnumerable<TrackChunk> |
trackChunks |
Track chunks to search for chords. |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
Returns
Type |
Description |
ICollection<Chord> |
Collection of chords contained in trackChunks ordered by time. |
Exceptions
See Also
GetChords(IEnumerable<Note>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Creates chords from notes.
Declaration
public static IEnumerable<Chord> GetChords(this IEnumerable<Note> notes, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Type |
Name |
Description |
IEnumerable<Note> |
notes |
Notes to create chords from. |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
Returns
Exceptions
GetMusicTheoryChord(Chord)
Returns
Chord containing notes of the specified
Chord.
Declaration
public static Chord GetMusicTheoryChord(this Chord chord)
Parameters
Type |
Name |
Description |
Chord |
chord |
Chord to get music theory chord from. |
Returns
Type |
Description |
Chord |
Chord containing notes of the chord . |
Exceptions
ManageChords(EventsCollection, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, TimedObjectsComparer)
Declaration
public static TimedObjectsManager<Chord> ManageChords(this EventsCollection eventsCollection, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null, TimedObjectsComparer comparer = null)
Parameters
Returns
Exceptions
ManageChords(TrackChunk, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, TimedObjectsComparer)
Declaration
public static TimedObjectsManager<Chord> ManageChords(this TrackChunk trackChunk, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null, TimedObjectsComparer comparer = null)
Parameters
Returns
Exceptions
ProcessChords(EventsCollection, Action<Chord>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)
Declaration
public static int ProcessChords(this EventsCollection eventsCollection, Action<Chord> action, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null, ChordProcessingHint hint = ChordProcessingHint.Default)
Parameters
Returns
Type |
Description |
int |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
eventsCollection is null . -
action is null .
|
See Also
ProcessChords(EventsCollection, Action<Chord>, Predicate<Chord>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)
Declaration
public static int ProcessChords(this EventsCollection eventsCollection, Action<Chord> action, Predicate<Chord> match, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null, ChordProcessingHint hint = ChordProcessingHint.Default)
Parameters
Returns
Type |
Description |
int |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
eventsCollection is null . -
action is null . -
match is null .
|
See Also
ProcessChords(MidiFile, Action<Chord>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)
Declaration
public static int ProcessChords(this MidiFile file, Action<Chord> action, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null, ChordProcessingHint hint = ChordProcessingHint.Default)
Parameters
Type |
Name |
Description |
MidiFile |
file |
MidiFile to search for chords to process. |
Action<Chord> |
action |
The action to perform on each Chord contained in the
file . |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
ChordProcessingHint |
hint |
Hint which tells the processing algorithm how it can optimize its performance.
The default value is Default. |
Returns
Type |
Description |
int |
Count of processed chords. |
Exceptions
See Also
ProcessChords(MidiFile, Action<Chord>, Predicate<Chord>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)
Declaration
public static int ProcessChords(this MidiFile file, Action<Chord> action, Predicate<Chord> match, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null, ChordProcessingHint hint = ChordProcessingHint.Default)
Parameters
Type |
Name |
Description |
MidiFile |
file |
MidiFile to search for chords to process. |
Action<Chord> |
action |
The action to perform on each Chord contained in the
file . |
Predicate<Chord> |
match |
The predicate that defines the conditions of the Chord to process. |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
ChordProcessingHint |
hint |
Hint which tells the processing algorithm how it can optimize its performance.
The default value is Default. |
Returns
Type |
Description |
int |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
file is null . -
action is null . -
match is null .
|
See Also
ProcessChords(TrackChunk, Action<Chord>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)
Declaration
public static int ProcessChords(this TrackChunk trackChunk, Action<Chord> action, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null, ChordProcessingHint hint = ChordProcessingHint.Default)
Parameters
Type |
Name |
Description |
TrackChunk |
trackChunk |
TrackChunk to search for chords to process. |
Action<Chord> |
action |
The action to perform on each Chord contained in the
trackChunk . |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
ChordProcessingHint |
hint |
Hint which tells the processing algorithm how it can optimize its performance.
The default value is Default. |
Returns
Type |
Description |
int |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
trackChunk is null . -
action is null .
|
See Also
ProcessChords(TrackChunk, Action<Chord>, Predicate<Chord>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)
Declaration
public static int ProcessChords(this TrackChunk trackChunk, Action<Chord> action, Predicate<Chord> match, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null, ChordProcessingHint hint = ChordProcessingHint.Default)
Parameters
Type |
Name |
Description |
TrackChunk |
trackChunk |
TrackChunk to search for chords to process. |
Action<Chord> |
action |
The action to perform on each Chord contained in the
trackChunk . |
Predicate<Chord> |
match |
The predicate that defines the conditions of the Chord to process. |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
ChordProcessingHint |
hint |
Hint which tells the processing algorithm how it can optimize its performance.
The default value is Default. |
Returns
Type |
Description |
int |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
trackChunk is null . -
action is null . -
match is null .
|
See Also
ProcessChords(IEnumerable<TrackChunk>, Action<Chord>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)
Declaration
public static int ProcessChords(this IEnumerable<TrackChunk> trackChunks, Action<Chord> action, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null, ChordProcessingHint hint = ChordProcessingHint.Default)
Parameters
Type |
Name |
Description |
IEnumerable<TrackChunk> |
trackChunks |
Collection of TrackChunk to search for chords to process. |
Action<Chord> |
action |
The action to perform on each Chord contained in the
trackChunks . |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
ChordProcessingHint |
hint |
Hint which tells the processing algorithm how it can optimize its performance.
The default value is Default. |
Returns
Type |
Description |
int |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
trackChunks is null . -
action is null .
|
See Also
ProcessChords(IEnumerable<TrackChunk>, Action<Chord>, Predicate<Chord>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)
Declaration
public static int ProcessChords(this IEnumerable<TrackChunk> trackChunks, Action<Chord> action, Predicate<Chord> match, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null, ChordProcessingHint hint = ChordProcessingHint.Default)
Parameters
Type |
Name |
Description |
IEnumerable<TrackChunk> |
trackChunks |
Collection of TrackChunk to search for chords to process. |
Action<Chord> |
action |
The action to perform on each Chord contained in the
trackChunks . |
Predicate<Chord> |
match |
The predicate that defines the conditions of the Chord to process. |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
ChordProcessingHint |
hint |
Hint which tells the processing algorithm how it can optimize its performance.
The default value is Default. |
Returns
Type |
Description |
int |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
trackChunks is null . -
action is null . -
match is null .
|
See Also
RemoveChords(EventsCollection, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static int RemoveChords(this EventsCollection eventsCollection, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Returns
Type |
Description |
int |
Count of removed chords. |
Exceptions
See Also
RemoveChords(EventsCollection, Predicate<Chord>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static int RemoveChords(this EventsCollection eventsCollection, Predicate<Chord> match, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Returns
Type |
Description |
int |
Count of removed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
eventsCollection is null . -
match is null .
|
See Also
RemoveChords(MidiFile, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static int RemoveChords(this MidiFile file, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Type |
Name |
Description |
MidiFile |
file |
MidiFile to search for chords to remove. |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
Returns
Type |
Description |
int |
Count of removed chords. |
Exceptions
See Also
RemoveChords(MidiFile, Predicate<Chord>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static int RemoveChords(this MidiFile file, Predicate<Chord> match, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Type |
Name |
Description |
MidiFile |
file |
MidiFile to search for chords to remove. |
Predicate<Chord> |
match |
The predicate that defines the conditions of the Chord to remove. |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
Returns
Type |
Description |
int |
Count of removed chords. |
Exceptions
See Also
RemoveChords(TrackChunk, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static int RemoveChords(this TrackChunk trackChunk, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Type |
Name |
Description |
TrackChunk |
trackChunk |
TrackChunk to search for chords to remove. |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
Returns
Type |
Description |
int |
Count of removed chords. |
Exceptions
See Also
RemoveChords(TrackChunk, Predicate<Chord>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static int RemoveChords(this TrackChunk trackChunk, Predicate<Chord> match, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Type |
Name |
Description |
TrackChunk |
trackChunk |
TrackChunk to search for chords to remove. |
Predicate<Chord> |
match |
The predicate that defines the conditions of the Chord to remove. |
ChordDetectionSettings |
settings |
Settings according to which chords should be detected and built. |
NoteDetectionSettings |
noteDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes. |
TimedEventDetectionSettings |
timedEventDetectionSettings |
Settings according to which timed events should be detected
and built to construct notes for chords. |
Returns
Type |
Description |
int |
Count of removed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
trackChunk is null . -
match is null .
|
See Also
RemoveChords(IEnumerable<TrackChunk>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static int RemoveChords(this IEnumerable<TrackChunk> trackChunks, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Returns
Type |
Description |
int |
Count of removed chords. |
Exceptions
See Also
RemoveChords(IEnumerable<TrackChunk>, Predicate<Chord>, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)
Declaration
public static int RemoveChords(this IEnumerable<TrackChunk> trackChunks, Predicate<Chord> match, ChordDetectionSettings settings = null, NoteDetectionSettings noteDetectionSettings = null, TimedEventDetectionSettings timedEventDetectionSettings = null)
Parameters
Returns
Type |
Description |
int |
Count of removed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occurred:
-
trackChunks is null . -
match is null .
|
See Also