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

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

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