Exemplo n.º 1
0
        /// <summary>
        /// Creates a rest image based on the user-specified parameters.
        /// </summary>
        /// <param name="ticks">The ticks of the rest.</param>
        /// <param name="hilite">Specifies whether to color the rest with a hilite color.</param>
        /// <param name="hiliteColor">The hilite color to color the rest with.</param>
        /// <returns></returns>
        public static Bitmap GetRest(int ticks, bool hilite, Color hiliteColor)
        {
            Bitmap rest;

            if (ticks >= 192)
            {
                rest = Icons.RestWhole;
            }
            else if (ticks >= 144)
            {
                rest = Icons.RestHalfDotted;
            }
            else if (ticks >= 96)
            {
                rest = Icons.RestHalf;
            }
            else if (ticks >= 72)
            {
                rest = Icons.RestQuarterDotted;
            }
            else if (ticks >= 64)
            {
                rest = Icons.RestHalfTriplet;
            }
            else if (ticks >= 48)
            {
                rest = Icons.RestQuarter;
            }
            else if (ticks >= 36)
            {
                rest = Icons.Rest8thDotted;
            }
            else if (ticks >= 32)
            {
                rest = Icons.RestQuarterTriplet;
            }
            else if (ticks >= 24)
            {
                rest = Icons.Rest8th;
            }
            else if (ticks >= 18)
            {
                rest = Icons.Rest16thDotted;
            }
            else if (ticks >= 16)
            {
                rest = Icons.Rest8thTriplet;
            }
            else if (ticks >= 12)
            {
                rest = Icons.Rest16th;
            }
            else if (ticks >= 9)
            {
                rest = Icons.Rest32ndDotted;
            }
            else if (ticks >= 8)
            {
                rest = Icons.Rest16thTriplet;
            }
            else if (ticks >= 6)
            {
                rest = Icons.Rest32nd;
            }
            else if (ticks >= 4)
            {
                rest = Icons.Rest32ndTriplet;
            }
            else if (ticks >= 3)
            {
                rest = Icons.Rest64th;
            }
            else if (ticks >= 2)
            {
                rest = Icons.Rest64thTriplet;
            }
            else if (ticks >= 1)
            {
                rest = Icons.Rest64th;
            }
            else
            {
                rest = Icons.Rest64th;
            }
            if (hilite)
            {
                rest = Do.Fill(rest, hiliteColor);
            }
            return(rest);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Creates an note stem image based on the user-specified parameters.
        /// </summary>
        /// <param name="ticks">The ticks of the note containing the stem.</param>
        /// <param name="pitch">The pitch of the note containing the stem.</param>
        /// <param name="hilite">Specifies whether to color the stem with a hilite color.</param>
        /// <param name="hiliteColor">The hilite color to color the stem with.</param>
        /// <returns></returns>
        public static Bitmap GetStem(int ticks, int pitch, bool hilite, Color hiliteColor)
        {
            Bitmap stem = null;

            if (ticks >= 192)
            {
            }
            else if (ticks >= 144)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown : Icons.NoteStemUp;
            }
            else if (ticks >= 96)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown : Icons.NoteStemUp;
            }
            else if (ticks >= 72)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown : Icons.NoteStemUp;
            }
            else if (ticks >= 64)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown : Icons.NoteStemUp;
            }
            else if (ticks >= 48)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown : Icons.NoteStemUp;
            }
            else if (ticks >= 36)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown8th : Icons.NoteStemUp8th;
            }
            else if (ticks >= 32)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown : Icons.NoteStemUp;
            }
            else if (ticks >= 24)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown8th : Icons.NoteStemUp8th;
            }
            else if (ticks >= 18)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown16th : Icons.NoteStemUp16th;
            }
            else if (ticks >= 16)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown8th : Icons.NoteStemUp8th;
            }
            else if (ticks >= 12)
            {
                stem = stem = pitch >= 59 ? Icons.NoteStemDown16th : Icons.NoteStemUp16th;
            }
            else if (ticks >= 9)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown32nd : Icons.NoteStemUp32nd;
            }
            else if (ticks >= 8)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown16th : Icons.NoteStemUp16th;
            }
            else if (ticks >= 6)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown32nd : Icons.NoteStemUp32nd;
            }
            else if (ticks >= 4)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown32nd : Icons.NoteStemUp32nd;
            }
            else if (ticks >= 3)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown64th : Icons.NoteStemUp64th;
            }
            else if (ticks >= 2)
            {
                stem = pitch >= 59 ? Icons.NoteStemDown64th : Icons.NoteStemUp64th;
            }
            else if (ticks >= 1)
            {
                stem = Icons.Note64th;
            }
            else
            {
                stem = Icons.Note64th;
            }
            if (hilite && stem != null)
            {
                stem = Do.Fill(stem, hiliteColor);
            }
            return(stem);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates an note head image based on the user-specified parameters.
        /// </summary>
        /// <param name="ticks">The ticks of the note containing the note head.</param>
        /// <param name="pitch">The pitch of the note containing the note head.</param>
        /// <param name="hilite">Specifies whether to color the note head with a hilite color.</param>
        /// <param name="hiliteColor">The hilite color to color the note head with.</param>
        /// <returns></returns>
        public static Bitmap GetHead(int ticks, int pitch, bool hilite, Color hiliteColor)
        {
            Bitmap head;

            if (ticks >= 192)
            {
                head = Icons.NoteEmpty;
            }
            else if (ticks >= 144)
            {
                head = Icons.NoteEmptyDotted;
            }
            else if (ticks >= 96)
            {
                head = Icons.NoteEmpty;
            }
            else if (ticks >= 72)
            {
                head = Icons.NoteHeadDotted;
            }
            else if (ticks >= 64)
            {
                head = Icons.NoteEmptyTriplet;
            }
            else if (ticks >= 48)
            {
                head = Icons.NoteHead;
            }
            else if (ticks >= 36)
            {
                head = Icons.NoteHeadDotted;
            }
            else if (ticks >= 32)
            {
                head = Icons.NoteHeadTriplet;
            }
            else if (ticks >= 24)
            {
                head = Icons.NoteHead;
            }
            else if (ticks >= 18)
            {
                head = Icons.NoteHeadDotted;
            }
            else if (ticks >= 16)
            {
                head = Icons.NoteHeadTriplet;
            }
            else if (ticks >= 12)
            {
                head = Icons.NoteHead;
            }
            else if (ticks >= 9)
            {
                head = Icons.NoteHeadDotted;
            }
            else if (ticks >= 8)
            {
                head = Icons.NoteHeadTriplet;
            }
            else if (ticks >= 6)
            {
                head = Icons.NoteHead;
            }
            else if (ticks >= 4)
            {
                head = Icons.NoteHeadTriplet;
            }
            else if (ticks >= 3)
            {
                head = Icons.NoteHead;
            }
            else if (ticks >= 2)
            {
                head = Icons.NoteHeadTriplet;
            }
            else if (ticks >= 1)
            {
                head = Icons.NoteHead;
            }
            else
            {
                head = Icons.NoteHead;
            }
            if (hilite)
            {
                head = Do.Fill(head, hiliteColor);
            }
            return(head);
        }