MusicTheory Docs API Toolbox GitHub NuGet
Contents

API / MusicTheory

PianoKey record

A piano key in white-key units: white keys are 1 wide, black keys 0.6 and sit on the boundary.

Constructors

PianoKey(int Midi, bool IsBlack, double X, double Width)
A piano key in white-key units: white keys are 1 wide, black keys 0.6 and sit on the boundary.
Midi
MIDI note number (C4 = 60).
IsBlack
True for a black key.
X
Left edge; the first white key of the range starts at 0.
Width
1 for white keys, 0.6 for black keys.

Properties

int Midi { get; init; }
MIDI note number (C4 = 60).
bool IsBlack { get; init; }
True for a black key.
double X { get; init; }
Left edge; the first white key of the range starts at 0.
double Width { get; init; }
1 for white keys, 0.6 for black keys.