Skip to content
Chanan edited this page Aug 18, 2020 · 4 revisions

Note Class

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


Summary

Represents a single musical note instance.
Each note is represented by a note duration and an absolute pitch,
which also determines it's name.

Implements INote.


Definition

internal class Note: INote
{
    //internal static constants 
    private const int NumberOfUniqueChromaticNotes = 12;
    private const int MidiMinimumPitchValue = 0;
    private const int MidiMaximumPitchValue = 127;

    // INote interface properties 
    public IDuration Duration { get; }
    public NoteName? Name { get; }
    public NotePitch Pitch { get; }

    // Constructors
    public Note(NotePitch pitch, IDuration duration) { ... } 
    public Note(NotePitch pitch, byte nominator, byte denominator) { ... }
    public Note(NotePitch pitch) { ... }
    
    // Methods
    private static NoteName? GetNoteNameByNotePitch(NotePitch notePitch) { ... }
    public override string ToString() { ... }
}

Constructors

Signature Description
Note(NotePitch,IDuration Constructs a note based on the given pitch and duration.
Note(NotePitch,byte,byte) Constructs a notes based on the given pitch and duration's numerator and denominator.
Note(NotePitch) Constructs a note based on the given pitch and a default duration.

Properties

Property Name Type Description
Name NoteName The note's name (for example "A").
Pitch NotePitch The note's absolute pitch.
Duration IDuration The note's duration.

Methods

Method Name Return Type Description
ToString string Returns A string representing the note's instance state.
GetNoteNameByNotePitch NoteName Returns the note name which corresponds to the given note pitch.
  • Home
  • Getting Started
  • Design
    • Business Logical Layer (CW.Soloist.CompositionService)
    • Data Access Layer
    • Presentation Layer
Clone this wiki locally