Ejemplo n.º 1
0
        private void CreateNoteGlyph(Note n)
        {
            var sr            = (ScoreBarRenderer)Renderer;
            var noteHeadGlyph = CreateNoteHeadGlyph(n);

            // calculate y position
            var line = sr.GetNoteLine(n);

            noteHeadGlyph.Y = sr.GetScoreY(line, -1);
            NoteHeads.AddNoteGlyph(noteHeadGlyph, n, line);

            if (n.IsStaccato && !NoteHeads.BeatEffects.ContainsKey("Staccato"))
            {
                NoteHeads.BeatEffects["Staccato"] = new CircleGlyph(0, 0, 1.5f);
            }

            if (n.Accentuated == AccentuationType.Normal && !NoteHeads.BeatEffects.ContainsKey("Accent"))
            {
                NoteHeads.BeatEffects["Accent"] = new AccentuationGlyph(0, 0, AccentuationType.Normal);
            }
            if (n.Accentuated == AccentuationType.Heavy && !NoteHeads.BeatEffects.ContainsKey("HAccent"))
            {
                NoteHeads.BeatEffects["HAccent"] = new AccentuationGlyph(0, 0, AccentuationType.Heavy);
            }
        }
Ejemplo n.º 2
0
        private void CreateNoteGlyph(Note n)
        {
            if (n.Beat.GraceType == GraceType.BendGrace && !n.HasBend)
            {
                return;
            }

            var sr            = (ScoreBarRenderer)Renderer;
            var noteHeadGlyph = CreateNoteHeadGlyph(n);

            // calculate y position
            var line = sr.GetNoteLine(n);

            noteHeadGlyph.Y = sr.GetScoreY(line);
            NoteHeads.AddNoteGlyph(noteHeadGlyph, n, line);

            if (n.HarmonicType != HarmonicType.None && n.HarmonicType != HarmonicType.Natural)
            {
                // create harmonic note head.
                var harmonicFret = n.DisplayValue + n.HarmonicPitch;
                noteHeadGlyph = new DiamondNoteHeadGlyph(0, 0, n.Beat.Duration, Container.Beat.GraceType != GraceType.None);
                line          = sr.AccidentalHelper.GetNoteLineForValue(harmonicFret);

                noteHeadGlyph.Y = sr.GetScoreY(line);
                NoteHeads.AddNoteGlyph(noteHeadGlyph, n, line);
            }

            if (n.IsStaccato && !NoteHeads.BeatEffects.ContainsKey("Staccato"))
            {
                NoteHeads.BeatEffects["Staccato"] = new CircleGlyph(0, 0, 1.5f);
            }

            if (n.Accentuated == AccentuationType.Normal && !NoteHeads.BeatEffects.ContainsKey("Accent"))
            {
                NoteHeads.BeatEffects["Accent"] = new AccentuationGlyph(0, 0, AccentuationType.Normal);
            }
            if (n.Accentuated == AccentuationType.Heavy && !NoteHeads.BeatEffects.ContainsKey("HAccent"))
            {
                NoteHeads.BeatEffects["HAccent"] = new AccentuationGlyph(0, 0, AccentuationType.Heavy);
            }
        }