Skip to content
Chanan edited this page Aug 18, 2020 · 1 revision

Chord Class

Namespace: CW.Soloist.CompositionService.MusicTheory
Assembly: CW.Soloist.CompositionService.dll


Summary

Represents a single musical chord instance.
Each chord is represented by a chord root, a chord type and a chord duration.

Implements IChord.

Defintion

public class Chord : IChord
{
    // IChord interface properties 
    NoteName ChordRoot { get; }
    ChordType ChordType { get; }
    IDuration Duration { get; set; }

    // IChord interface methods 
    IEnumerable<NotePitch> GetArpeggioNotes(int minOctave, int maxOctave) { ... }
    IEnumerable<NotePitch> GetArpeggioNotes(NotePitch minPitch, NotePitch maxPitch) { ... }
    IEnumerable<NotePitch> GetScaleNotes(int minOctave, int maxOctave) { ... }
    IEnumerable<NotePitch> GetScaleNotes(NotePitch minPitch, NotePitch maxPitch) { ... }

    // Constructor 
    public Chord(NoteName root, ChordType type, IDuration duration) { ... } 
    
    // ToString method  
    public override string ToString() => return $"{{Root={ChordRoot}; ChordType={ChordType}; Duration={Duration}}}"; 
}

Properties

Property Name Type Description
ChordRoot NoteName Name of the note which is the root of the chord.
ChordType ChordType The chord's type.
Duration IDuration The chord's duration.

Methods

Method Name Return Type Description
GetArpeggioNotes IEnumerable<NotePitch> Returns notes that correspond to the given chord's structure.
GetScaleNotes IEnumerable<NotePitch> Returns notes that of the scale mapped to the given chord.
ToString string Returns a string representation the given chord's state.
  • Home
  • Getting Started
  • Design
    • Business Logical Layer (CW.Soloist.CompositionService)
    • Data Access Layer
    • Presentation Layer
Clone this wiki locally