Class ChordsManagingUtilities
Extension methods for chords managing.
Inheritance
ChordsManagingUtilities
Assembly: Melanchall.DryWetMidi.dll
Syntax
public static class ChordsManagingUtilities
Methods
GetChords(EventsCollection, ChordDetectionSettings)
Declaration
public static ICollection<Chord> GetChords(this EventsCollection eventsCollection, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<Chord> |
Collection of chords contained in eventsCollection ordered by time. |
Exceptions
See Also
GetChords(MidiFile, ChordDetectionSettings)
Declaration
public static ICollection<Chord> GetChords(this MidiFile file, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<Chord> |
Collection of chords contained in file ordered by time. |
Exceptions
See Also
GetChords(TrackChunk, ChordDetectionSettings)
Declaration
public static ICollection<Chord> GetChords(this TrackChunk trackChunk, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<Chord> |
Collection of chords contained in trackChunk ordered by time. |
Exceptions
See Also
GetChords(IEnumerable<MidiEvent>, ChordDetectionSettings)
Declaration
public static ICollection<Chord> GetChords(this IEnumerable<MidiEvent> midiEvents, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<Chord> |
Collection of chords contained in midiEvents ordered by time. |
Exceptions
GetChords(IEnumerable<TrackChunk>, ChordDetectionSettings)
Declaration
public static ICollection<Chord> GetChords(this IEnumerable<TrackChunk> trackChunks, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
ICollection<Chord> |
Collection of chords contained in trackChunks ordered by time. |
Exceptions
See Also
GetChords(IEnumerable<Note>, ChordDetectionSettings)
Creates chords from notes.
Declaration
public static IEnumerable<Chord> GetChords(this IEnumerable<Note> notes, ChordDetectionSettings settings = null)
Parameters
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, TimedObjectsComparer)
Declaration
public static TimedObjectsManager<Chord> ManageChords(this EventsCollection eventsCollection, ChordDetectionSettings settings = null, TimedObjectsComparer comparer = null)
Parameters
Returns
Exceptions
ManageChords(TrackChunk, ChordDetectionSettings, TimedObjectsComparer)
Declaration
public static TimedObjectsManager<Chord> ManageChords(this TrackChunk trackChunk, ChordDetectionSettings settings = null, TimedObjectsComparer comparer = null)
Parameters
Returns
Exceptions
ProcessChords(EventsCollection, Action<Chord>, ChordDetectionSettings)
Declaration
public static int ProcessChords(this EventsCollection eventsCollection, Action<Chord> action, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
eventsCollection is null .action is null .
|
ProcessChords(EventsCollection, Action<Chord>, Predicate<Chord>, ChordDetectionSettings)
Declaration
public static int ProcessChords(this EventsCollection eventsCollection, Action<Chord> action, Predicate<Chord> match, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
eventsCollection is null .action is null .match is null .
|
ProcessChords(MidiFile, Action<Chord>, ChordDetectionSettings)
Performs the specified action on each
Chord contained in the
MidiFile.
Declaration
public static int ProcessChords(this MidiFile file, Action<Chord> action, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed chords. |
Exceptions
ProcessChords(MidiFile, Action<Chord>, Predicate<Chord>, ChordDetectionSettings)
Performs the specified action on each
Chord contained in the
MidiFile.
Declaration
public static int ProcessChords(this MidiFile file, Action<Chord> action, Predicate<Chord> match, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
file is null .action is null .match is null .
|
ProcessChords(TrackChunk, Action<Chord>, ChordDetectionSettings)
Declaration
public static int ProcessChords(this TrackChunk trackChunk, Action<Chord> action, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
trackChunk is null .action is null .
|
ProcessChords(TrackChunk, Action<Chord>, Predicate<Chord>, ChordDetectionSettings)
Declaration
public static int ProcessChords(this TrackChunk trackChunk, Action<Chord> action, Predicate<Chord> match, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
trackChunk is null .action is null .match is null .
|
ProcessChords(IEnumerable<TrackChunk>, Action<Chord>, ChordDetectionSettings)
Performs the specified action on each
Chord contained in the collection of
TrackChunk.
Declaration
public static int ProcessChords(this IEnumerable<TrackChunk> trackChunks, Action<Chord> action, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
trackChunks is null .action is null .
|
ProcessChords(IEnumerable<TrackChunk>, Action<Chord>, Predicate<Chord>, ChordDetectionSettings)
Performs the specified action on each
Chord contained in the collection of
TrackChunk.
Declaration
public static int ProcessChords(this IEnumerable<TrackChunk> trackChunks, Action<Chord> action, Predicate<Chord> match, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of processed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
trackChunks is null .action is null .match is null .
|
RemoveChords(EventsCollection, ChordDetectionSettings)
Removes all the
Chord that match the conditions defined by the specified predicate.
Declaration
public static int RemoveChords(this EventsCollection eventsCollection, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed chords. |
Exceptions
RemoveChords(EventsCollection, Predicate<Chord>, ChordDetectionSettings)
Removes all the
Chord that match the conditions defined by the specified predicate.
Declaration
public static int RemoveChords(this EventsCollection eventsCollection, Predicate<Chord> match, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
eventsCollection is null .match is null .
|
RemoveChords(MidiFile, ChordDetectionSettings)
Removes all the
Chord that match the conditions defined by the specified predicate.
Declaration
public static int RemoveChords(this MidiFile file, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed chords. |
Exceptions
RemoveChords(MidiFile, Predicate<Chord>, ChordDetectionSettings)
Removes all the
Chord that match the conditions defined by the specified predicate.
Declaration
public static int RemoveChords(this MidiFile file, Predicate<Chord> match, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed chords. |
Exceptions
RemoveChords(TrackChunk, ChordDetectionSettings)
Removes all the
Chord that match the conditions defined by the specified predicate.
Declaration
public static int RemoveChords(this TrackChunk trackChunk, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed chords. |
Exceptions
RemoveChords(TrackChunk, Predicate<Chord>, ChordDetectionSettings)
Removes all the
Chord that match the conditions defined by the specified predicate.
Declaration
public static int RemoveChords(this TrackChunk trackChunk, Predicate<Chord> match, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
trackChunk is null .match is null .
|
RemoveChords(IEnumerable<TrackChunk>, ChordDetectionSettings)
Removes all the
Chord that match the conditions defined by the specified predicate.
Declaration
public static int RemoveChords(this IEnumerable<TrackChunk> trackChunks, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed chords. |
Exceptions
RemoveChords(IEnumerable<TrackChunk>, Predicate<Chord>, ChordDetectionSettings)
Removes all the
Chord that match the conditions defined by the specified predicate.
Declaration
public static int RemoveChords(this IEnumerable<TrackChunk> trackChunks, Predicate<Chord> match, ChordDetectionSettings settings = null)
Parameters
Returns
Type |
Description |
Int32 |
Count of removed chords. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
trackChunks is null .match is null .
|
SetTimeAndLength(Chord, ITimeSpan, ITimeSpan, TempoMap)
Sets time and length of the specified chord.
Declaration
[Obsolete("OBS15: Use SetTime/SetLength methods from TimedObjectUtilities/LengthedObjectUtilities. More info: https://melanchall.github.io/drywetmidi/obsolete/obsolete.html#obs15.")]
public static Chord SetTimeAndLength(this Chord chord, ITimeSpan time, ITimeSpan length, TempoMap tempoMap)
Parameters
Type |
Name |
Description |
Chord |
chord |
Chord to set time and length to. |
ITimeSpan |
time |
Time to set to chord . |
ITimeSpan |
length |
Length to set to chord . |
TempoMap |
tempoMap |
Tempo map that will be used for time and length conversion. |
Returns
Type |
Description |
Chord |
An input chord with new time and length. |
Exceptions
Type |
Condition |
ArgumentNullException |
One of the following errors occured:
chord is null .time is null .length is null .tempoMap is null .
|