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

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

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