private async void LoadTestModel(HookDirectionAlgorithm hookDirectionAlgorithm)
        {
            //await Task.Factory.StartNew(() => Thread.Sleep(1000));
            var vm = new TestViewModel();

            DataContext = vm;
            vm.LoadTestData(hookDirectionAlgorithm);
        }
示例#2
0
        /// <summary>
        /// Performs rebeaming with respect to lyric syllables.
        /// </summary>
        /// <param name="notes">Notes to rebeam</param>
        /// <param name="hookDirectionAlgorithm">Algorithm for determining hook direction in beams</param>
        /// <returns>Rebeamed notes</returns>
        public IEnumerable <NoteOrRest> Rebeam(IEnumerable <NoteOrRest> notes, HookDirectionAlgorithm hookDirectionAlgorithm = HookDirectionAlgorithm.ProductionCandidate)
        {
            var splittedNotes = notes.SplitByLyrics();

            foreach (var noteGroup in splittedNotes)
            {
                noteGroup.Rebeam(RebeamMode.Simple, hookDirectionAlgorithm);
            }
            return(notes);
        }
示例#3
0
        private async void LoadTestModel(HookDirectionAlgorithm hookDirectionAlgorithm)
        {
            //await Task.Factory.StartNew(() => Thread.Sleep(1000));
            var vm = new TestViewModel();

            DataContext = vm;
            vm.LoadTestData(hookDirectionAlgorithm);

            if (vm.Player != null)
            {
                ((IDisposable)vm.Player).Dispose();
            }

            vm.Player = new MidiTaskScorePlayer(vm.Data);
        }
示例#4
0
        public IEnumerable <NoteOrRest> Rebeam(IEnumerable <NoteOrRest> notes, HookDirectionAlgorithm hookDirectionAlgorithm = HookDirectionAlgorithm.ProductionCandidate)
        {
            var staff = notes.FirstOrDefault(n => n.Staff != null)?.Staff;

            if (staff == null)
            {
                throw new Exception($"Staff property is null. Notes must be added to staff before using {nameof(BeatRebeamStrategy)}.");
            }

            var timeSignature = staff.Peek <TimeSignature>(notes.First(), Model.PeekStrategies.PeekType.PreviousElement);

            if (timeSignature == null)
            {
                throw new Exception($"Could not determine time signature. Check if time signature is added to the staff before first note to rebeam.");
            }

            var splittedNotes = notes.SplitByBeats(timeSignature);

            foreach (var noteGroup in splittedNotes)
            {
                noteGroup.Rebeam(RebeamMode.Simple, hookDirectionAlgorithm);
            }
            return(notes);
        }
        public void LoadTestData(HookDirectionAlgorithm hookDirectionAlgorithm)
        {
            var mScore = Score.CreateOneStaffScore(Clef.Treble, Music.Model.MajorAndMinor.MajorScale.G);

            mScore.FirstStaff.AddTimeSignature(TimeSignatureType.Numbers, 4, 4);
            mScore.FirstStaff.AddNote(Pitch.G4, RhythmicDuration.Half);
            mScore.FirstStaff.Add(new Rest(RhythmicDuration.Quarter));
            mScore.FirstStaff.AddNote(Pitch.FromMidiPitch(60, Pitch.MidiPitchTranslationMode.Auto), RhythmicDuration.Half);
            mScore.FirstStaff.AddBarline(BarlineStyle.Regular);
            mScore.FirstStaff.AddNote(Pitch.G4, RhythmicDuration.Quarter);

            mScore.FirstStaff.AddNote(Pitch.FromMidiPitch(61, Pitch.MidiPitchTranslationMode.Auto), RhythmicDuration.Quarter);
            mScore.FirstStaff.AddRange(new Note[] {
                Note.FromMidiPitch(63, RhythmicDuration.Quarter),
                Note.FromMidiPitch(67, RhythmicDuration.Quarter)
            }.MakeChord());
            mScore.FirstStaff.AddBarline(BarlineStyle.Regular);
            mScore.FirstStaff.AddRange(StaffBuilder.FromPitches(
                                           Pitch.C4,
                                           Pitch.E4,
                                           Pitch.G4,
                                           Pitch.A4,
                                           Pitch.C4,
                                           Pitch.E4,
                                           Pitch.G4,
                                           Pitch.A4).AddUniformRhythm(RhythmicDuration.Sixteenth).ApplyStemDirection(VerticalDirection.Up).Rebeam());

            Note n1 = new Note();

            n1.ApplyMidiPitch(63);
            n1.Duration             = RhythmicDuration.Quarter;
            n1.Tuplet               = TupletType.Start;
            n1.TupletWeightOverride = 1;
            mScore.FirstStaff.Add(n1);

            n1 = new Note();
            n1.ApplyMidiPitch(66);

            n1.Duration             = RhythmicDuration.Quarter;
            n1.TupletWeightOverride = 1;

            mScore.FirstStaff.Add(n1);

            n1 = new Note();
            n1.ApplyMidiPitch(66);
            n1.Duration             = RhythmicDuration.Quarter;
            n1.TupletWeightOverride = 1;

            n1.Tuplet = TupletType.Stop;
            mScore.FirstStaff.Add(n1);

            mScore.FirstStaff.AddBarline(BarlineStyle.Regular);
            PrintSuggestion ps = new PrintSuggestion
            {
                IsSystemBreak = true
            };

            mScore.FirstStaff.Add(ps);

            mScore.FirstStaff.AddRange(StaffBuilder.FromPitches(Pitch.G4, Pitch.B4, Pitch.D5, Pitch.C4, Pitch.E4, Pitch.G4, Pitch.D4, Pitch.DSharp4, Pitch.A4)
                                       .AddRhythm("8 8 8 8 4 4 4 4 4"));
            mScore.FirstStaff.AddBarline(BarlineStyle.Regular);

            mScore.FirstStaff.AddRange(StaffBuilder.FromPitches(Pitch.G4, Pitch.B4, Pitch.D5, Pitch.C4, Pitch.E4, Pitch.G4, Pitch.D4, Pitch.DSharp4, Pitch.A4)
                                       .AddRhythm("8 8 8 8 4 4 4 4 4"));

            mScore.FirstStaff.Elements.Add(new Barline());

            mScore.FirstStaff.Add(new PrintSuggestion()
            {
                IsSystemBreak = true
            });

            mScore.FirstStaff.AddBarline(BarlineStyle.LightHeavy);

            mScore.FirstStaff.Elements.Add(new TimeSignature(TimeSignatureType.Numbers, 3, 4));
            mScore.FirstStaff.Elements.Add(new Note(Pitch.C4, RhythmicDuration.Half.AddDots(1))
            {
                TieType = NoteTieType.Start
            });

            mScore.FirstStaff.Elements.Add(new Barline());
            mScore.FirstStaff.Elements.Add(new Note(Pitch.C4, RhythmicDuration.Half.AddDots(1))
            {
                TieType = NoteTieType.Stop
            });
            mScore.FirstStaff.Elements.Add(new Barline());
            mScore.FirstStaff.Elements.Add(new Note(Pitch.C4, RhythmicDuration.Half.AddDots(1)));
            mScore.FirstStaff.Elements.Add(new Barline(BarlineStyle.LightHeavy));

            Data = mScore;
        }
        private NoteBeamType DetermineHookDirection(List <NoteOrRest> notes, Note currentNote, HookDirectionAlgorithm hookDirectionAlgorithm = HookDirectionAlgorithm.ProductionCandidate)
        {
            if (currentNote.DesiredHookDirection == DesiredHookDirections.BackwardHook)
            {
                return(NoteBeamType.BackwardHook);
            }
            if (currentNote.DesiredHookDirection == DesiredHookDirections.ForwardHook)
            {
                return(NoteBeamType.ForwardHook);
            }
            if (currentNote == notes.Last())
            {
                return(NoteBeamType.BackwardHook);
            }
            if (currentNote == notes.First())
            {
                return(NoteBeamType.ForwardHook);
            }

            int    pulse;
            double currentBeat;

            switch (hookDirectionAlgorithm)
            {
            case HookDirectionAlgorithm.ProductionCandidate:
                pulse       = notes.Min(n => n.BaseDuration.Denominator);
                currentBeat = notes.Take(notes.IndexOf(currentNote)).Sum(n => n.Duration.ToDouble() * pulse);
                return(currentBeat + currentNote.Duration.ToDouble() * pulse > Math.Ceiling(currentBeat) ? NoteBeamType.ForwardHook : NoteBeamType.BackwardHook);

            case HookDirectionAlgorithm.Second:
                pulse       = notes.Min(n => n.BaseDuration.Denominator);
                currentBeat = notes.Take(notes.IndexOf(currentNote)).Sum(n => n.Duration.ToDouble() * pulse);
                return(currentBeat - Math.Floor(currentBeat) >= Math.Ceiling(currentBeat) - currentBeat ? NoteBeamType.ForwardHook : NoteBeamType.BackwardHook);

            case HookDirectionAlgorithm.Third:
                pulse       = (int)notes.Pulse();
                currentBeat = notes.Take(notes.IndexOf(currentNote)).Sum(n => (1d / pulse * n.BaseDuration.Denominator));
                return(currentBeat - Math.Floor(currentBeat) > Math.Ceiling(currentBeat) - currentBeat ? NoteBeamType.ForwardHook : NoteBeamType.BackwardHook);

            default:
                throw new Exception("Unknown hook direction algorithm.");
            }
        }
        public IEnumerable <NoteOrRest> Rebeam(IEnumerable <NoteOrRest> notes, HookDirectionAlgorithm hookDirectionAlgorithm = HookDirectionAlgorithm.ProductionCandidate)
        {
            Note previousNote = null;
            Note currentNote  = null;
            Note nextNote     = null;
            var  noteArray    = notes.ToArray();

            for (int i = 0; i < noteArray.Length; i++)
            {
                previousNote = i == 0 ? null : noteArray[i - 1] as Note;
                currentNote  = noteArray[i] as Note;
                nextNote     = i == noteArray.Length - 1 ? null : noteArray[i + 1] as Note;

                currentNote.BeamList.Clear();
                var numberOfBeams = Math.Log(currentNote.BaseDuration.Denominator, 2) - 2;
                var numberOfBeamsOnPreviousNote = previousNote == null ? 0 : Math.Log(previousNote.BaseDuration.Denominator, 2) - 2;
                var numberOfBeamsOnNextNote     = nextNote == null ? 0 : Math.Log(nextNote.BaseDuration.Denominator, 2) - 2;
                for (var b = 0; b < numberOfBeams; b++)
                {
                    if (previousNote == null)
                    {
                        if (nextNote != null && numberOfBeamsOnNextNote < b + 1)
                        {
                            currentNote.BeamList.Add(DetermineHookDirection(notes.ToList(), currentNote, hookDirectionAlgorithm));
                        }
                        else
                        {
                            currentNote.BeamList.Add(NoteBeamType.Start);
                        }
                    }
                    else if (nextNote == null)
                    {
                        if (previousNote != null && numberOfBeamsOnPreviousNote < b + 1)
                        {
                            currentNote.BeamList.Add(DetermineHookDirection(notes.ToList(), currentNote, hookDirectionAlgorithm));
                        }
                        else
                        {
                            currentNote.BeamList.Add(NoteBeamType.End);
                        }
                    }
                    else
                    {
                        if (numberOfBeamsOnPreviousNote >= b + 1 && numberOfBeamsOnNextNote >= b + 1)
                        {
                            currentNote.BeamList.Add(NoteBeamType.Continue);
                        }
                        else if (numberOfBeamsOnPreviousNote < b + 1 && numberOfBeamsOnNextNote < b + 1)
                        {
                            currentNote.BeamList.Add(DetermineHookDirection(notes.ToList(), currentNote, hookDirectionAlgorithm));
                        }
                        else if (numberOfBeamsOnPreviousNote < b + 1)
                        {
                            currentNote.BeamList.Add(NoteBeamType.Start);
                        }
                        else if (numberOfBeamsOnNextNote < b + 1)
                        {
                            currentNote.BeamList.Add(NoteBeamType.End);
                        }
                    }
                }
            }
            return(notes);
        }
        /// <summary>
        /// Performs rebeaming on staff elements with a specific rebeam mode
        /// </summary>
        /// <param name="notes">Notes to rebeam</param>
        /// <param name="mode">Rebeam mode</param>
        /// <param name="hookDirectionAlgorithm">Algorithm to determine hook direction (applies only for RebeamMode.Simple)</param>
        /// <returns></returns>
        public static IEnumerable <NoteOrRest> Rebeam(this IEnumerable <NoteOrRest> notes, RebeamMode mode = RebeamMode.Simple, HookDirectionAlgorithm hookDirectionAlgorithm = HookDirectionAlgorithm.ProductionCandidate)
        {
#if CSHTML5
            var strategies = typeof(IRebeamStrategy).Assembly.GetTypes()
                             .Where(t => !t.IsAbstract && typeof(IRebeamStrategy).IsAssignableFrom(t))
                             .Select(t => Expression.Lambda(Expression.New(t)).Compile().DynamicInvoke())
                             .Cast <IRebeamStrategy>()
                             .ToArray();
#else
            var strategies = typeof(IRebeamStrategy).GetTypeInfo().Assembly.DefinedTypes
                             .Where(t => !t.IsAbstract && typeof(IRebeamStrategy).GetTypeInfo().IsAssignableFrom(t))
                             .Select(t => Expression.Lambda(Expression.New(t.AsType())).Compile().DynamicInvoke())
                             .Cast <IRebeamStrategy>()
                             .ToArray();
#endif
            var matchingStrategy = strategies.FirstOrDefault(s => s.Mode == mode);
            if (matchingStrategy == null)
            {
                throw new Exception($"Rebeam strategy not found for rebeam mode {mode}.");
            }
            foreach (var n in notes.OfType <Note>())
            {
                n.ModeUsedForRebeaming = mode;
            }
            return(matchingStrategy.Rebeam(notes, hookDirectionAlgorithm));
        }
示例#9
0
        public void LoadTestData(HookDirectionAlgorithm hookDirectionAlgorithm)
        {
            var rd = new RhythmicDuration(2, 0).ToProportion();

            rd = new RhythmicDuration(2, 1).ToProportion();
            rd = new RhythmicDuration(2, 2).ToProportion();
            rd = new RhythmicDuration(2, 3).ToProportion();

            var score      = Score.CreateOneStaffScore(Clef.Alto, new MajorScale(Step.C, false));
            var firstStaff = score.FirstStaff;

            firstStaff.Elements.Add(new TimeSignature(TimeSignatureType.Numbers, 4, 4));

            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.C4, Pitch.C4, Pitch.C4)
                                         .AddRhythm("16. 32 16 16")
                                         .ApplyStemDirection(VerticalDirection.Up)
                                         .Rebeam());

            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.E4, Pitch.G4, Pitch.C4, Pitch.E4, Pitch.G4, Pitch.C4)
                                         .AddRhythm(16, 32, 16, 32, 8, 8, 16)
                                         .ApplyStemDirection(VerticalDirection.Up)
                                         .AddLyrics("Wlazł ko-tek na pło-tek"));
            firstStaff.Elements.Add(new MetronomeDirection(Tempo.Allegro, DirectionPlacementType.Above));

            firstStaff.Elements.Add(new Barline());

            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.E4)
                                         .AddRhythm("8.. 32")
                                         .ApplyStemDirection(VerticalDirection.Up)
                                         .AddLyrics("i mru-"));
            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromRhythm(8, 8)
                                         .AddPitches(Pitch.C4, Pitch.E4)
                                         .ApplyStemDirection(VerticalDirection.Up));
            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.E4, Pitch.G4, Pitch.C4, Pitch.E4, Pitch.G4)
                                         .AddRhythm(32, 32, 32, 16, 16, 32)
                                         .ApplyStemDirection(VerticalDirection.Up));
            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.E4, Pitch.G4, Pitch.C4)
                                         .AddRhythm(8, 32, 16, 32)
                                         .ApplyStemDirection(VerticalDirection.Up));

            firstStaff.Elements.Add(new Barline());

            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.E4)
                                         .AddRhythm(8, 32)
                                         .ApplyStemDirection(VerticalDirection.Up)
                                         .AddDots(2, 0));
            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.E4)
                                         .AddRhythm(8, 8)
                                         .ApplyStemDirection(VerticalDirection.Up));

            firstStaff.Elements.Add(new Barline());

            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.E4, Pitch.G4, Pitch.C4, Pitch.E4)
                                         .AddRhythm(32, 32, 32, 32, 8)
                                         .ApplyStemDirection(VerticalDirection.Up));
            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.E4, Pitch.G4)
                                         .AddRhythm(8, 16, 16)
                                         .ApplyStemDirection(VerticalDirection.Up));

            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.E4, Pitch.G4, Pitch.C4)
                                         .AddRhythm(8, 16, 32, 32)
                                         .ApplyStemDirection(VerticalDirection.Up));
            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.E4)
                                         .AddRhythm(8, 16)
                                         .ApplyStemDirection(VerticalDirection.Up)
                                         .AddDots(1, 0));
            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.E4)
                                         .AddRhythm(8, 32)
                                         .ApplyStemDirection(VerticalDirection.Up)
                                         .AddDots(2, 0));
            firstStaff.Elements.AddRange(StaffBuilder
                                         .FromPitches(Pitch.C4, Pitch.E4, Pitch.G4)
                                         .AddRhythm(32, 16, 8)
                                         .ApplyStemDirection(VerticalDirection.Up)
                                         .AddDots(0, 1, 0));

            firstStaff.Elements.OfType <Note>().FirstOrDefault(n => n.Pitch == Pitch.E4 && n.BaseDuration == RhythmicDuration.D32nd).DesiredHookDirection = DesiredHookDirections.ForwardHook;
            firstStaff.Elements.OfType <NoteOrRest>().Rebeam(RebeamMode.ToBeats, hookDirectionAlgorithm);

            /*
             * firstStaff.Elements.Add(new TimeSignature(TimeSignatureType.Numbers, 3, 4));
             * firstStaff.Elements.Add(new Note(Pitch.C4, RhythmicDuration.Half.AddDots(1)) { TieType = NoteTieType.Start });
             * firstStaff.Elements.Add(new Barline() { CustomColor = KolbergColors.OsterodeWheat });
             * firstStaff.Elements.Add(new Note(Pitch.C4, RhythmicDuration.Half.AddDots(1)) { CustomColor = Color.Red, TieType = NoteTieType.Stop });
             * firstStaff.Elements.Add(new Barline());
             * firstStaff.Elements.Add(new Note(Pitch.C4, RhythmicDuration.Half.AddDots(1)));
             * firstStaff.Elements.Add(new Barline(BarlineStyle.LightHeavy));
             *
             * score.FirstStaff.Elements.Add(new Note(Pitch.C5, RhythmicDuration.Sixteenth, VerticalDirection.Up, NoteTieType.None, new List<NoteBeamType>() { NoteBeamType.Start, NoteBeamType.ForwardHook }));
             * score.FirstStaff.Elements.Add(new Note(Pitch.F4, RhythmicDuration.Eighth, VerticalDirection.Up, NoteTieType.None, new List<NoteBeamType>() { NoteBeamType.Continue  }));
             * score.FirstStaff.Elements.Add(new Note(Pitch.D4, RhythmicDuration.Sixteenth, VerticalDirection.Up, NoteTieType.None, new List<NoteBeamType>() { NoteBeamType.End, NoteBeamType.BackwardHook }));
             * score.FirstStaff.Elements.Add(new MetronomeDirection(new Tempo(RhythmicDuration.Eighth, 120), DirectionPlacementType.Above));
             *
             * var secondStaff = new Staff();
             * score.Staves.Add(secondStaff);
             * secondStaff.Elements.Add(Clef.Bass);
             * secondStaff.Elements.Add(new Key(0));
             * secondStaff.Elements.Add(new TimeSignature(TimeSignatureType.Numbers, 3, 4));
             * secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Eighth) { Tuplet = TupletType.Start, TupletWeightOverride = 1 });
             * secondStaff.Elements.Add(new Note(Pitch.D3, RhythmicDuration.Sixteenth) { TupletWeightOverride = 0.5 });
             * secondStaff.Elements.Add(new Note(Pitch.F3, RhythmicDuration.Sixteenth) {  TupletWeightOverride = 0.5});
             * secondStaff.Elements.Add(new Note(Pitch.E3, RhythmicDuration.Eighth) { Tuplet = TupletType.Stop, TupletWeightOverride = 1 } );
             * secondStaff.Elements.Add(new Barline());
             * secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Quarter));
             * secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Quarter));
             * secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Quarter));
             * secondStaff.Elements.Add(new Barline());
             * secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Half.AddDots(1)));
             * secondStaff.Elements.Add(new Barline(BarlineStyle.LightHeavy));
             */

            var secondStaff = new Staff();

            score.Staves.Add(secondStaff);
            secondStaff.Elements.Add(Clef.Bass);
            secondStaff.Elements.Add(new Key(0));
            secondStaff.Elements.Add(new TimeSignature(TimeSignatureType.Numbers, 3, 4));
            secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Eighth)
            {
                Tuplet = TupletType.Start
            });
            secondStaff.Elements.Add(new Note(Pitch.D3, RhythmicDuration.Eighth));
            secondStaff.Elements.Add(new Note(Pitch.E3, RhythmicDuration.Eighth)
            {
                Tuplet = TupletType.Stop
            });
            secondStaff.Elements.Add(new Barline());
            secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Quarter));
            secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Quarter));
            secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Quarter));
            secondStaff.Elements.Add(new Barline());
            secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Half.AddDots(1)));
            secondStaff.Elements.Add(new Barline(BarlineStyle.LightHeavy));

            var nn            = secondStaff.Elements.OfType <Note>().Last();
            var timeSignature = secondStaff.Peek <TimeSignature>(nn, Model.PeekStrategies.PeekType.PreviousElement);

            Data = score;

            var part = new Part(firstStaff)
            {
                PartId = "1"
            };

            part.Staves.Add(secondStaff);
            score.Parts.Add(part);
            //part = new Part(secondStaff) { PartId = "2" };
            //score.Parts.Add(part);

            //Z Xamarina:

            /*
             * score = Score.CreateOneStaffScore(Clef.Treble, new MajorScale(Step.C, false));
             * firstStaff = score.FirstStaff;
             * firstStaff.Elements.Add(new TimeSignature(TimeSignatureType.Numbers, 3, 4));
             * firstStaff.Elements.Add(new Note(Pitch.C4, RhythmicDuration.Half.AddDots(1)) { TieType = NoteTieType.Start });
             * firstStaff.Elements.Add(new Barline() { CustomColor = KolbergColors.OsterodeWheat });
             * firstStaff.Elements.Add(new Note(Pitch.C4, RhythmicDuration.Half.AddDots(1)) { CustomColor = Color.Red, TieType = NoteTieType.Stop });
             * firstStaff.Elements.Add(new Barline());
             * firstStaff.Elements.Add(new Note(Pitch.C4, RhythmicDuration.Half.AddDots(1)));
             * firstStaff.Elements.Add(new Barline(BarlineStyle.LightHeavy));
             *
             * var note = new Note(Pitch.A5, RhythmicDuration.Eighth, VerticalDirection.Up, NoteTieType.None, new List<NoteBeamType>() { NoteBeamType.Start });
             * note.Lyrics.Clear();
             * note.Lyrics.Add(new Lyrics() { Syllables = new List<Lyrics.Syllable>() { new Lyrics.Syllable(SyllableType.Begin, "xxx") } });
             * score.FirstStaff.Elements.Add(note);
             * score.FirstStaff.Elements.Add(new Note(Pitch.C5, RhythmicDuration.Sixteenth.AddDots(1), VerticalDirection.Up, NoteTieType.None, new List<NoteBeamType>() { NoteBeamType.Continue, NoteBeamType.Start }));
             * score.FirstStaff.Elements.Add(new Note(Pitch.D4, RhythmicDuration.D32nd, VerticalDirection.Up, NoteTieType.None, new List<NoteBeamType>() { NoteBeamType.End, NoteBeamType.End, NoteBeamType.BackwardHook }));
             *
             * secondStaff = new Staff();
             * score.Staves.Add(secondStaff);
             * secondStaff.Elements.Add(Clef.Bass);
             * secondStaff.Elements.Add(new Key(0));
             * secondStaff.Elements.Add(new TimeSignature(TimeSignatureType.Numbers, 3, 4));
             * secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Eighth) { Tuplet = TupletType.Start });
             * secondStaff.Elements.Add(new Note(Pitch.D3, RhythmicDuration.Eighth));
             * secondStaff.Elements.Add(new Note(Pitch.E3, RhythmicDuration.Eighth) { Tuplet = TupletType.Stop });
             * secondStaff.Elements.Add(new Barline());
             * secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Quarter));
             * secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Quarter));
             * secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Quarter));
             * secondStaff.Elements.Add(new Barline());
             * secondStaff.Elements.Add(new Note(Pitch.C3, RhythmicDuration.Half.AddDots(1)));
             * secondStaff.Elements.Add(new Barline(BarlineStyle.LightHeavy));
             *
             * Data = score;*/
        }