Beispiel #1
0
        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));
        }
Beispiel #2
0
        public GrandStaffLedgerLines ComputeLedgerLines(StaffPosition testNotePosition, StaffPosition playedNotePosition)
        {
            var testLedgerLines = ComputeLedgerLines(testNotePosition);

            return(Combine(testLedgerLines, playedNotePosition));
        }
Beispiel #3
0
        GrandStaffLedgerLines Combine(GrandStaffLedgerLines ledgerLines, StaffPosition position)
        {
            var otherLedgerLines = ComputeLedgerLines(position);

            return(ledgerLines.Combine(otherLedgerLines));
        }
Beispiel #4
0
 public ScoreNote(Duration duration, StaffPosition staffPosition, Accidental accidental)
 {
     Duration      = duration;
     StaffPosition = staffPosition;
     Accidental    = accidental;
 }
Beispiel #5
0
 public StaffPosition ComputeStaffPosition(Pitch lowestTreebleStaffPitch, Pitch pitch) =>
 pitch >= lowestTreebleStaffPitch
         ? StaffPosition.InTreebleClef(-pitch.DiatonicDistanceTo(Pitch.B4))
         : StaffPosition.InBassClef(-pitch.DiatonicDistanceTo(Pitch.D3));