Ejemplo n.º 1
0
        public override IEnumerable <NoteWithDuration> Notes()
        {
            Fraction dur = Duration;

            foreach (var nwd in end)
            {
                dur = dur - nwd.Duration;
            }

            Debug.Assert(dur.p > 0);
            foreach (var nwd in melodyBase.Notes())
            {
                dur = dur - nwd.Duration;
                if (dur.p <= 0)
                {
                    yield return(nwd.ChangedDuration(dur + nwd.Duration));

                    break;
                }

                yield return(nwd);
            }

            foreach (var nwd in end)
            {
                yield return(nwd);
            }
        }
Ejemplo n.º 2
0
        public override IEnumerable <NoteWithDuration> Notes()
        {
            foreach (NoteSequence seq in sequences)
            {
                foreach (var note in melody.Notes())
                {
                    int number = seq[note.note].note;

                    Note currNote = note;

                    NoteWithDuration?noteReturn = null, noteTail = null;


                    do
                    {
                        Alteration alter = (Alteration)((int)currNote.alter + (int)seq[currNote.note].alter);
                        if (noteReturn == null)
                        {
                            noteReturn = noteTail = new NoteWithDuration(number, alter, note.Duration);
                        }
                        else
                        {
                            //noteTail.va.otherNote = new NoteWithDuration(number, alter, note.Duration);
                            //noteTail = noteTail.otherNote as NoteWithDuration;
                        }

                        //currNote = currNote.otherNote;
                    } while (false);

                    yield return(noteReturn.Value);
                }
            }
        }
Ejemplo n.º 3
0
 public override IEnumerable <NoteWithDuration> Notes()
 {
     foreach (var notewd in melodyBase.Notes())
     {
         yield return(Transform(notewd, note =>
                                new NoteWithDuration(
                                    note.IsPause ? Note.PAUSE : key + toneset.Calculate(note.note) + (int)note.alter,
                                    note.Duration)));
     }
 }
Ejemplo n.º 4
0
 public override IEnumerable <NoteWithDuration> Notes()
 {
     return(melodyBase.Notes().Reverse());
 }