Example #1
0
        /// <summary>
        /// E.g. "0' 0 1 2 3 4"
        /// </summary>
        public ParameterizedMelody(string st, RhythmPattern rp, params int[] bases)
        {
            int maxnumber = 0;
            var @enum     = rp.Notes().GetEnumerator();

            foreach (string stNote in st.Split(' '))
            {
                Debug.Assert(stNote.Length > 0);

                // Based on the nubmer of "'" it pertains to appropriate base
                string stNoteP = stNote.TrimEnd('\'');
                int    number  = stNote.Length - stNoteP.Length;
                if (number > maxnumber)
                {
                    maxnumber = number;
                }

                // The note is written as a number
                int note = int.Parse(stNoteP);
                if ([email protected]())
                {
                    Debug.Fail("No more notes in rp");
                }

                // Add to the note list
                notes.Add(new Tuple <NoteWithDuration, int>(new NoteWithDuration(note, @enum.Current), number));
            }
            Debug.Assert([email protected]());
        }
Example #2
0
 public void Reverse()
 {
     RhythmPattern rp = new RhythmPattern(BeatsPerMeasure, BeatsPerUnit);
     //todo
 }