public GrandStaffLedgerLines ComputeLedgerLines(StaffPosition notePosition) { if (notePosition == null) { return(GrandStaffLedgerLines.Absent); } var offset = notePosition.VerticalOffset; var lines = (offset.Abs() / 2 - 2).LimitFromBottom(0); var ledgerLines = LedgerLines.CreateSingle(lines, top: offset > 0); return(GrandStaffLedgerLines.CreateSingle(ledgerLines, treeble: notePosition.Clef == Clef.Treeble)); }
public GrandStaffLedgerLines ComputeLedgerLines(StaffPosition testNotePosition, StaffPosition playedNotePosition) { var testLedgerLines = ComputeLedgerLines(testNotePosition); return(Combine(testLedgerLines, playedNotePosition)); }
GrandStaffLedgerLines Combine(GrandStaffLedgerLines ledgerLines, StaffPosition position) { var otherLedgerLines = ComputeLedgerLines(position); return(ledgerLines.Combine(otherLedgerLines)); }
public ScoreNote(Duration duration, StaffPosition staffPosition, Accidental accidental) { Duration = duration; StaffPosition = staffPosition; Accidental = accidental; }
public StaffPosition ComputeStaffPosition(Pitch lowestTreebleStaffPitch, Pitch pitch) => pitch >= lowestTreebleStaffPitch ? StaffPosition.InTreebleClef(-pitch.DiatonicDistanceTo(Pitch.B4)) : StaffPosition.InBassClef(-pitch.DiatonicDistanceTo(Pitch.D3));