Ejemplo n.º 1
0
        private int GetBelowStaff()
        {
            int dist = WhiteNote.Bottom(clef).Dist(whitenote) *
                       SheetMusic.NoteHeight / 2 +
                       SheetMusic.NoteHeight;

            if (accid == Accid.Sharp || accid == Accid.Natural)
            {
                dist += SheetMusic.NoteHeight;
            }

            if (dist > 0)
            {
                return(dist);
            }
            else
            {
                return(0);
            }
        }
Ejemplo n.º 2
0
        private int GetBelowStaff()
        {
            /* Find the bottom note in the chord */
            WhiteNote bottomnote = notedata[0].whitenote;

            /* The stem.End is the note position where the stem ends.
             * Check if the stem end is lower than the bottom note.
             */
            if (stem1 != null)
            {
                bottomnote = WhiteNote.Min(bottomnote, stem1.End);
            }
            if (stem2 != null)
            {
                bottomnote = WhiteNote.Min(bottomnote, stem2.End);
            }

            int dist = WhiteNote.Bottom(clef).Dist(bottomnote) *
                       SheetMusic.NoteHeight / 2;

            int result = 0;

            if (dist > 0)
            {
                result = dist;
            }

            /* Check if any accidental symbols extend below the staff */
            foreach (AccidSymbol symbol in accidsymbols)
            {
                if (symbol.BelowStaff > result)
                {
                    result = symbol.BelowStaff;
                }
            }
            return(result);
        }