Example #1
0
        public LedgerLines Combine(LedgerLines other)
        {
            var top    = Math.Max(Top, other.Top);
            var bottom = Math.Max(Bottom, other.Bottom);

            return(new LedgerLines(top, bottom));
        }
Example #2
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));
        }