Class MelodyHarmonizer
- Namespace
- Celeritas.Core.Harmonization
- Assembly
- Celeritas.dll
Harmonizes melodies using dynamic programming (Viterbi-style). Fully extensible via strategy interfaces.
public sealed class MelodyHarmonizer
- Inheritance
-
MelodyHarmonizer
- Inherited Members
Remarks
Create a harmonizer with custom strategies.
Constructors
MelodyHarmonizer()
Create a harmonizer with default strategies.
public MelodyHarmonizer()
MelodyHarmonizer(IChordCandidateProvider, ITransitionScorer, IMelodyFitScorer, IHarmonicRhythmStrategy)
Harmonizes melodies using dynamic programming (Viterbi-style). Fully extensible via strategy interfaces.
public MelodyHarmonizer(IChordCandidateProvider candidateProvider, ITransitionScorer transitionScorer, IMelodyFitScorer fitScorer, IHarmonicRhythmStrategy rhythmStrategy)
Parameters
candidateProviderIChordCandidateProvidertransitionScorerITransitionScorerfitScorerIMelodyFitScorerrhythmStrategyIHarmonicRhythmStrategy
Remarks
Create a harmonizer with custom strategies.
Methods
Harmonize(NoteBuffer)
Harmonize from a NoteBuffer.
public HarmonizationResult Harmonize(NoteBuffer buffer)
Parameters
bufferNoteBuffer
Returns
Exceptions
- ArgumentNullException
bufferis null.
Harmonize(NoteBuffer, KeySignature)
public HarmonizationResult Harmonize(NoteBuffer buffer, KeySignature key)
Parameters
bufferNoteBufferkeyKeySignature
Returns
Exceptions
- ArgumentNullException
bufferis null.
Harmonize(NoteEvent[])
Harmonize from a NoteEvent array (convenience overload).
public HarmonizationResult Harmonize(NoteEvent[] melody)
Parameters
melodyNoteEvent[]
Returns
Exceptions
- ArgumentNullException
melodyis null.
Harmonize(NoteEvent[], KeySignature)
Harmonize from a NoteEvent array with a specified key (convenience overload).
public HarmonizationResult Harmonize(NoteEvent[] melody, KeySignature key)
Parameters
melodyNoteEvent[]keyKeySignature
Returns
Exceptions
- ArgumentNullException
melodyis null.
Harmonize(ReadOnlySpan<NoteEvent>)
Harmonize a melody, automatically detecting the key.
public HarmonizationResult Harmonize(ReadOnlySpan<NoteEvent> melody)
Parameters
melodyReadOnlySpan<NoteEvent>
Returns
Harmonize(ReadOnlySpan<NoteEvent>, KeySignature)
Harmonize a melody in a specified key.
public HarmonizationResult Harmonize(ReadOnlySpan<NoteEvent> melody, KeySignature key)
Parameters
melodyReadOnlySpan<NoteEvent>keyKeySignature