Skip to content

Commit

Permalink
[Docs] Fixed docs + docfx update
Browse files Browse the repository at this point in the history
  • Loading branch information
melanchall committed Jul 20, 2024
1 parent 77fa52f commit 5028d11
Show file tree
Hide file tree
Showing 11 changed files with 106 additions and 43 deletions.
15 changes: 10 additions & 5 deletions Docs/articles/high-level-managing/Getting-objects.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ Please examine [NotesManagingUtilities](xref:Melanchall.DryWetMidi.Interaction.N

### Settings

All `GetNotes` overloads can accept [NoteDetectionSettings](xref:Melanchall.DryWetMidi.Interaction.NoteDetectionSettings) as last parameter. Via this parameter you can adjust the process of notes building. Let's see each setting in details.
All `GetNotes` overloads can accept [NoteDetectionSettings](xref:Melanchall.DryWetMidi.Interaction.NoteDetectionSettings) as a parameter. Via this parameter you can adjust the process of notes building.

More than that, notes are built on top of timed events. So you can pass [TimedEventDetectionSettings](xref:Melanchall.DryWetMidi.Interaction.TimedEventDetectionSettings) as a separate parameter to control how underlying MIDI events will be constructed.

Let's see each setting of the [NoteDetectionSettings](xref:Melanchall.DryWetMidi.Interaction.NoteDetectionSettings) in details.

#### `NoteStartDetectionPolicy`

Expand Down Expand Up @@ -176,7 +180,6 @@ chord

foreach (var note in chord.Notes)
{

Console.Write($@"
note {note} (note number = {note.NoteNumber})
channel = {note.Channel}
Expand Down Expand Up @@ -232,11 +235,13 @@ Please examine [ChordsManagingUtilities](xref:Melanchall.DryWetMidi.Interaction.

### Settings

All `GetChords` overloads can accept [ChordDetectionSettings](xref:Melanchall.DryWetMidi.Interaction.ChordDetectionSettings) as last parameter. Via this parameter you can adjust the process of chords building. Let's see each setting in details.
All `GetChords` overloads can accept [ChordDetectionSettings](xref:Melanchall.DryWetMidi.Interaction.ChordDetectionSettings) as a parameter. Via this parameter you can adjust the process of chords building.

Also note that chords are built on top of notes. So to build chords we need to build notes. The process of notes building is adjustable via [NoteDetectionSettings](xref:Melanchall.DryWetMidi.Interaction.NoteDetectionSettings) which you can pass to the methods too. Properties of the [NoteDetectionSettings](xref:Melanchall.DryWetMidi.Interaction.NoteDetectionSettings) are described in detail [above](#settings).

#### `NoteDetectionSettings`
More than that, notes are built on top of timed events as described [above](#settings). So you can pass [TimedEventDetectionSettings](xref:Melanchall.DryWetMidi.Interaction.TimedEventDetectionSettings) too.

Chords are built on top of notes. So to build chords we need to build notes. The process of notes building is adjustable via [NoteDetectionSettings](xref:Melanchall.DryWetMidi.Interaction.ChordDetectionSettings.NoteDetectionSettings) property. Properties of the [NoteDetectionSettings](xref:Melanchall.DryWetMidi.Interaction.NoteDetectionSettings) are described in detail [above](#settings).
Let's see each setting of the [ChordDetectionSettings](xref:Melanchall.DryWetMidi.Interaction.ChordDetectionSettings) in details.

#### `NotesTolerance`

Expand Down
5 changes: 4 additions & 1 deletion Docs/docfx.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@
],
"markdownEngineName": "markdig",
"dest": "_site",
"xrefService": [ "https://xref.docs.microsoft.com/query?uid={uid}" ]
"xrefService": [ "https://xref.docs.microsoft.com/query?uid={uid}" ],
"xref": [
"https://learn.microsoft.com/en-us/dotnet/.xrefmap.json"
]
}
}
4 changes: 4 additions & 0 deletions Docs/templates/dwm/styles/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,10 @@ hr {
color: #ce9178;
}

pre code.hljs {
padding: 0;
}

.toc .nav > li > a {
color: #D5D5D5;
}
Expand Down
2 changes: 1 addition & 1 deletion DryWetMidi/Composing/PatternBuilder.PianoRoll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ private static void ProcessLine(
{
Action<MusicTheory.Note, PatternBuilder> customAction;
if (settings.CustomActions?.TryGetValue(symbol, out customAction) == true)
customAction(note, patternBuilder);
customAction?.Invoke(note, patternBuilder);

Check failure on line 116 in DryWetMidi/Composing/PatternBuilder.PianoRoll.cs

View check run for this annotation

Azure Pipelines / Test Core API - macOS - .NET Core (Run tests Run tests)

DryWetMidi/Composing/PatternBuilder.PianoRoll.cs#L116

DryWetMidi/Composing/PatternBuilder.PianoRoll.cs(116,25): Error CS0165: Use of unassigned local variable 'customAction'

Check failure on line 116 in DryWetMidi/Composing/PatternBuilder.PianoRoll.cs

View check run for this annotation

Azure Pipelines / Test Core API - macOS - .NET Core

DryWetMidi/Composing/PatternBuilder.PianoRoll.cs#L116

DryWetMidi/Composing/PatternBuilder.PianoRoll.cs(116,25): Error CS0165: Use of unassigned local variable 'customAction'

Check failure on line 116 in DryWetMidi/Composing/PatternBuilder.PianoRoll.cs

View check run for this annotation

Azure Pipelines / Test Core API - Ubuntu - .NET Core (Run tests Run tests)

DryWetMidi/Composing/PatternBuilder.PianoRoll.cs#L116

DryWetMidi/Composing/PatternBuilder.PianoRoll.cs(116,25): Error CS0165: Use of unassigned local variable 'customAction'

Check failure on line 116 in DryWetMidi/Composing/PatternBuilder.PianoRoll.cs

View check run for this annotation

Azure Pipelines / Test Core API - Ubuntu - .NET Core

DryWetMidi/Composing/PatternBuilder.PianoRoll.cs#L116

DryWetMidi/Composing/PatternBuilder.PianoRoll.cs(116,25): Error CS0165: Use of unassigned local variable 'customAction'

Check failure on line 116 in DryWetMidi/Composing/PatternBuilder.PianoRoll.cs

View check run for this annotation

Azure Pipelines / Test Multimedia API - macOS - .NET Core (Run tests Run tests)

DryWetMidi/Composing/PatternBuilder.PianoRoll.cs#L116

DryWetMidi/Composing/PatternBuilder.PianoRoll.cs(116,25): Error CS0165: Use of unassigned local variable 'customAction'

Check failure on line 116 in DryWetMidi/Composing/PatternBuilder.PianoRoll.cs

View check run for this annotation

Azure Pipelines / Test Multimedia API - macOS - .NET Core

DryWetMidi/Composing/PatternBuilder.PianoRoll.cs#L116

DryWetMidi/Composing/PatternBuilder.PianoRoll.cs(116,25): Error CS0165: Use of unassigned local variable 'customAction'
else if (!isNoteBuilding)
patternBuilder.StepForward();
}
Expand Down
2 changes: 1 addition & 1 deletion DryWetMidi/Interaction/Chords/ChordProcessingHint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Melanchall.DryWetMidi.Interaction
/// </summary>
/// <remarks>
/// If you want to get the maximum performance of a chord processing (for example,
/// <see cref="ChordsManagingUtilities.ProcessChords(Core.MidiFile, Action{Chord}, Predicate{Chord}, ChordDetectionSettings, ChordProcessingHint)"/>),
/// <see cref="ChordsManagingUtilities.ProcessChords(Core.MidiFile, Action{Chord}, Predicate{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)"/>),
/// choose a hint carefully. Note that you can always use <see href="xref:a_managers">an object manager</see> to
/// perform any manipulations with chords but dedicated methods of the <see cref="ChordsManagingUtilities"/> will
/// always be faster and will consume less memory.
Expand Down
48 changes: 32 additions & 16 deletions DryWetMidi/Interaction/Chords/ChordsManagingUtilities.cs
Original file line number Diff line number Diff line change
Expand Up @@ -230,10 +230,10 @@ public static ICollection<Chord> GetChords(
/// <param name="settings">Settings according to which chords should be detected and built.</param>
/// <returns>Collection of chords contained in <paramref name="eventsCollection"/> ordered by time.</returns>
/// <exception cref="ArgumentNullException"><paramref name="eventsCollection"/> is <c>null</c>.</exception>
/// <seealso cref="ProcessChords(EventsCollection, Action{Chord}, Predicate{Chord}, ChordDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="ProcessChords(EventsCollection, Action{Chord}, ChordDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="RemoveChords(EventsCollection, ChordDetectionSettings)"/>
/// <seealso cref="RemoveChords(EventsCollection, Predicate{Chord}, ChordDetectionSettings)"/>
/// <seealso cref="ProcessChords(EventsCollection, Action{Chord}, Predicate{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="ProcessChords(EventsCollection, Action{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="RemoveChords(EventsCollection, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)"/>
/// <seealso cref="RemoveChords(EventsCollection, Predicate{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)"/>
/// <seealso cref="GetObjectsUtilities"/>
public static ICollection<Chord> GetChords(
this EventsCollection eventsCollection,
Expand All @@ -260,10 +260,10 @@ public static ICollection<Chord> GetChords(
/// <param name="settings">Settings according to which chords should be detected and built.</param>
/// <returns>Collection of chords contained in <paramref name="trackChunk"/> ordered by time.</returns>
/// <exception cref="ArgumentNullException"><paramref name="trackChunk"/> is <c>null</c>.</exception>
/// <seealso cref="ProcessChords(TrackChunk, Action{Chord}, Predicate{Chord}, ChordDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="ProcessChords(TrackChunk, Action{Chord}, ChordDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="RemoveChords(TrackChunk, ChordDetectionSettings)"/>
/// <seealso cref="RemoveChords(TrackChunk, Predicate{Chord}, ChordDetectionSettings)"/>
/// <seealso cref="ProcessChords(TrackChunk, Action{Chord}, Predicate{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="ProcessChords(TrackChunk, Action{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="RemoveChords(TrackChunk, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)"/>
/// <seealso cref="RemoveChords(TrackChunk, Predicate{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)"/>
/// <seealso cref="GetObjectsUtilities"/>
public static ICollection<Chord> GetChords(
this TrackChunk trackChunk,
Expand All @@ -284,10 +284,10 @@ public static ICollection<Chord> GetChords(
/// <param name="settings">Settings according to which chords should be detected and built.</param>
/// <returns>Collection of chords contained in <paramref name="trackChunks"/> ordered by time.</returns>
/// <exception cref="ArgumentNullException"><paramref name="trackChunks"/> is <c>null</c>.</exception>
/// <seealso cref="ProcessChords(IEnumerable{TrackChunk}, Action{Chord}, Predicate{Chord}, ChordDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="ProcessChords(IEnumerable{TrackChunk}, Action{Chord}, ChordDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="RemoveChords(IEnumerable{TrackChunk}, ChordDetectionSettings)"/>
/// <seealso cref="RemoveChords(IEnumerable{TrackChunk}, Predicate{Chord}, ChordDetectionSettings)"/>
/// <seealso cref="ProcessChords(IEnumerable{TrackChunk}, Action{Chord}, Predicate{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="ProcessChords(IEnumerable{TrackChunk}, Action{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="RemoveChords(IEnumerable{TrackChunk}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)"/>
/// <seealso cref="RemoveChords(IEnumerable{TrackChunk}, Predicate{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)"/>
/// <seealso cref="GetObjectsUtilities"/>
public static ICollection<Chord> GetChords(
this IEnumerable<TrackChunk> trackChunks,
Expand Down Expand Up @@ -323,10 +323,10 @@ public static ICollection<Chord> GetChords(
/// <param name="settings">Settings according to which chords should be detected and built.</param>
/// <returns>Collection of chords contained in <paramref name="file"/> ordered by time.</returns>
/// <exception cref="ArgumentNullException"><paramref name="file"/> is <c>null</c>.</exception>
/// <seealso cref="ProcessChords(MidiFile, Action{Chord}, Predicate{Chord}, ChordDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="ProcessChords(MidiFile, Action{Chord}, ChordDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="RemoveChords(MidiFile, ChordDetectionSettings)"/>
/// <seealso cref="RemoveChords(MidiFile, Predicate{Chord}, ChordDetectionSettings)"/>
/// <seealso cref="ProcessChords(MidiFile, Action{Chord}, Predicate{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="ProcessChords(MidiFile, Action{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings, ChordProcessingHint)"/>
/// <seealso cref="RemoveChords(MidiFile, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)"/>
/// <seealso cref="RemoveChords(MidiFile, Predicate{Chord}, ChordDetectionSettings, NoteDetectionSettings, TimedEventDetectionSettings)"/>
/// <seealso cref="GetObjectsUtilities"/>
public static ICollection<Chord> GetChords(
this MidiFile file,
Expand Down Expand Up @@ -383,6 +383,7 @@ public static IEnumerable<Chord> GetChords(
/// </item>
/// </list>
/// </exception>
/// <seealso cref="TimedObjectUtilities.ProcessObjects(EventsCollection, ObjectType, Action{ITimedObject}, ObjectDetectionSettings, ObjectProcessingHint)"/>
public static int ProcessChords(
this EventsCollection eventsCollection,
Action<Chord> action,
Expand Down Expand Up @@ -427,6 +428,7 @@ public static int ProcessChords(
/// </item>
/// </list>
/// </exception>
/// <seealso cref="TimedObjectUtilities.ProcessObjects(EventsCollection, ObjectType, Action{ITimedObject}, Predicate{ITimedObject}, ObjectDetectionSettings, ObjectProcessingHint)"/>
public static int ProcessChords(
this EventsCollection eventsCollection,
Action<Chord> action,
Expand Down Expand Up @@ -475,6 +477,7 @@ public static int ProcessChords(
/// </item>
/// </list>
/// </exception>
/// <seealso cref="TimedObjectUtilities.ProcessObjects(TrackChunk, ObjectType, Action{ITimedObject}, ObjectDetectionSettings, ObjectProcessingHint)"/>
public static int ProcessChords(
this TrackChunk trackChunk,
Action<Chord> action,
Expand Down Expand Up @@ -519,6 +522,7 @@ public static int ProcessChords(
/// </item>
/// </list>
/// </exception>
/// <seealso cref="TimedObjectUtilities.ProcessObjects(TrackChunk, ObjectType, Action{ITimedObject}, Predicate{ITimedObject}, ObjectDetectionSettings, ObjectProcessingHint)"/>
public static int ProcessChords(
this TrackChunk trackChunk,
Action<Chord> action,
Expand Down Expand Up @@ -562,6 +566,7 @@ public static int ProcessChords(
/// </item>
/// </list>
/// </exception>
/// <seealso cref="TimedObjectUtilities.ProcessObjects(IEnumerable{TrackChunk}, ObjectType, Action{ITimedObject}, ObjectDetectionSettings, ObjectProcessingHint)"/>
public static int ProcessChords(
this IEnumerable<TrackChunk> trackChunks,
Action<Chord> action,
Expand Down Expand Up @@ -607,6 +612,7 @@ public static int ProcessChords(
/// </item>
/// </list>
/// </exception>
/// <seealso cref="TimedObjectUtilities.ProcessObjects(IEnumerable{TrackChunk}, ObjectType, Action{ITimedObject}, Predicate{ITimedObject}, ObjectDetectionSettings, ObjectProcessingHint)"/>
public static int ProcessChords(
this IEnumerable<TrackChunk> trackChunks,
Action<Chord> action,
Expand Down Expand Up @@ -658,6 +664,7 @@ public static int ProcessChords(
/// </item>
/// </list>
/// </exception>
/// <seealso cref="TimedObjectUtilities.ProcessObjects(MidiFile, ObjectType, Action{ITimedObject}, ObjectDetectionSettings, ObjectProcessingHint)"/>
public static int ProcessChords(
this MidiFile file,
Action<Chord> action,
Expand Down Expand Up @@ -702,6 +709,7 @@ public static int ProcessChords(
/// </item>
/// </list>
/// </exception>
/// <seealso cref="TimedObjectUtilities.ProcessObjects(MidiFile, ObjectType, Action{ITimedObject}, Predicate{ITimedObject}, ObjectDetectionSettings, ObjectProcessingHint)"/>
public static int ProcessChords(
this MidiFile file,
Action<Chord> action,
Expand All @@ -725,6 +733,7 @@ public static int ProcessChords(
/// <param name="settings">Settings according to which chords should be detected and built.</param>
/// <returns>Count of removed chords.</returns>
/// <exception cref="ArgumentNullException"><paramref name="eventsCollection"/> is <c>null</c>.</exception>
/// <seealso cref="TimedObjectUtilities.RemoveObjects(EventsCollection, ObjectType, ObjectDetectionSettings)"/>
public static int RemoveChords(
this EventsCollection eventsCollection,
ChordDetectionSettings settings = null,
Expand Down Expand Up @@ -754,6 +763,7 @@ public static int RemoveChords(
/// </item>
/// </list>
/// </exception>
/// <seealso cref="TimedObjectUtilities.RemoveObjects(EventsCollection, ObjectType, Predicate{ITimedObject}, ObjectDetectionSettings)"/>
public static int RemoveChords(
this EventsCollection eventsCollection,
Predicate<Chord> match,
Expand Down Expand Up @@ -792,6 +802,7 @@ public static int RemoveChords(
/// <param name="settings">Settings according to which chords should be detected and built.</param>
/// <returns>Count of removed chords.</returns>
/// <exception cref="ArgumentNullException"><paramref name="trackChunk"/> is <c>null</c>.</exception>
/// <seealso cref="TimedObjectUtilities.RemoveObjects(TrackChunk, ObjectType, ObjectDetectionSettings)"/>
public static int RemoveChords(
this TrackChunk trackChunk,
ChordDetectionSettings settings = null,
Expand Down Expand Up @@ -821,6 +832,7 @@ public static int RemoveChords(
/// </item>
/// </list>
/// </exception>
/// <seealso cref="TimedObjectUtilities.RemoveObjects(TrackChunk, ObjectType, Predicate{ITimedObject}, ObjectDetectionSettings)"/>
public static int RemoveChords(
this TrackChunk trackChunk,
Predicate<Chord> match,
Expand All @@ -841,6 +853,7 @@ public static int RemoveChords(
/// <param name="settings">Settings according to which chords should be detected and built.</param>
/// <returns>Count of removed chords.</returns>
/// <exception cref="ArgumentNullException"><paramref name="trackChunks"/> is <c>null</c>.</exception>
/// <seealso cref="TimedObjectUtilities.RemoveObjects(IEnumerable{TrackChunk}, ObjectType, ObjectDetectionSettings)"/>
public static int RemoveChords(
this IEnumerable<TrackChunk> trackChunks,
ChordDetectionSettings settings = null,
Expand Down Expand Up @@ -870,6 +883,7 @@ public static int RemoveChords(
/// </item>
/// </list>
/// </exception>
/// <seealso cref="TimedObjectUtilities.RemoveObjects(IEnumerable{TrackChunk}, ObjectType, Predicate{ITimedObject}, ObjectDetectionSettings)"/>
public static int RemoveChords(
this IEnumerable<TrackChunk> trackChunks,
Predicate<Chord> match,
Expand Down Expand Up @@ -908,6 +922,7 @@ public static int RemoveChords(
/// <param name="settings">Settings according to which chords should be detected and built.</param>
/// <returns>Count of removed chords.</returns>
/// <exception cref="ArgumentNullException"><paramref name="file"/> is <c>null</c>.</exception>
/// <seealso cref="TimedObjectUtilities.RemoveObjects(MidiFile, ObjectType, ObjectDetectionSettings)"/>
public static int RemoveChords(
this MidiFile file,
ChordDetectionSettings settings = null,
Expand Down Expand Up @@ -937,6 +952,7 @@ public static int RemoveChords(
/// </item>
/// </list>
/// </exception>
/// <seealso cref="TimedObjectUtilities.RemoveObjects(MidiFile, ObjectType, Predicate{ITimedObject}, ObjectDetectionSettings)"/>
public static int RemoveChords(
this MidiFile file,
Predicate<Chord> match,
Expand Down
4 changes: 3 additions & 1 deletion DryWetMidi/Interaction/Grid/IGrid.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Collections.Generic;
using System;
using System.Collections.Generic;

namespace Melanchall.DryWetMidi.Interaction
{
Expand All @@ -12,6 +13,7 @@ public interface IGrid
/// </summary>
/// <param name="tempoMap">Tempo map used to get grid's times.</param>
/// <returns>Collection of times (in MIDI ticks) of the current grid.</returns>
/// <exception cref="ArgumentNullException"><paramref name="tempoMap"/> is <c>null</c>.</exception>
IEnumerable<long> GetTimes(TempoMap tempoMap);
}
}
2 changes: 1 addition & 1 deletion DryWetMidi/Interaction/Notes/NoteProcessingHint.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Melanchall.DryWetMidi.Interaction
/// </summary>
/// <remarks>
/// If you want to get the maximum performance of a note processing (for example,
/// <see cref="NotesManagingUtilities.ProcessNotes(Core.MidiFile, Action{Note}, Predicate{Note}, NoteDetectionSettings, NoteProcessingHint)"/>),
/// <see cref="NotesManagingUtilities.ProcessNotes(Core.MidiFile, Action{Note}, Predicate{Note}, NoteDetectionSettings, TimedEventDetectionSettings, NoteProcessingHint)"/>),
/// choose a hint carefully. Note that you can always use <see href="xref:a_managers">an object manager</see> to
/// perform any manipulations with notes but dedicated methods of the <see cref="NotesManagingUtilities"/> will
/// always be faster and will consume less memory.
Expand Down
Loading

0 comments on commit 5028d11

Please sign in to comment.