Skip to content

NotePitch

Chanan edited this page Aug 18, 2020 · 5 revisions

NotePitch Enumeration

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


Summary

Represents a either note pitch, a hold-note, or a rest-note.


Definition

public enum NotePitch
{
   /* definition for all 128 note pitches */
   ...  
   C0,
   CSharp0,
   D, 
   ... 
   G9 

   /* definition for special notes */
   HoldNote = 128,
   RestNote = -1
}

The pitch enumeration values in the range of [0-127] are identical to the pitch values in the MIDI note-pitch mapping:

MIDI Value Note Name Octave Enum Name
0 C -1 CMinus1
1 C# -1 CSharpMinus1
2 D -1 DMinus1
3 D# -1 DSharpMinus1
... ... ... ...
60 C 6 C6
61 C# 6 CSharp6
62 D 6 D6
... ... ... ...
124 E 9 E9
125 F 9 F9
126 F# 9 FSharp9
127 G 9 G9

In addition to the MIDI mapped values,
this enumeration contains another two values for representing hold and rest notes:

Enum Name Enum Value Meaning
HoldNote 128 A note that hold's it's preceding note's pitch value (extends the preceding note's duration).
RestNote -1 A silent note (no notes are played during this note's duration).

Remarks


  • The enumeration names are sharp oriented.
    For example: 'ASharp' instead of 'BFlat', but the pitch representations are of course equivalent.
  • The suffix of each enumeration pitch name represents the relative octave in the midi chart.
    For example: 'A4' represents the pitch of A in the fourth octave with the frequency of 440 Hz.
  • Home
  • Getting Started
  • Design
    • Business Logical Layer (CW.Soloist.CompositionService)
    • Data Access Layer
    • Presentation Layer
Clone this wiki locally