Ejemplo n.º 1
0
 public MelodyAtomic(RhythmPatternBase rhythm, object[] notes)
 {
     Debug.Assert(rhythm.CountNotes() == notes.Length);
     this.rhythm = rhythm;
     Debug.Assert(notes.Length == rhythm.CountNotes());
     foreach (var note in notes)
     {
         Debug.Assert(note is int || note is Note || note is string);
     }
     this.notes = (object[])notes.Clone();
 }
Ejemplo n.º 2
0
        public MelodyAtomic(RhythmPatternBase rhythm, Random rand)
        {
            int count = rhythm.CountNotes();

            notes = new object[count];

            const int maxInterval = 2;

            for (int i = 0; i < count; i++)
            {
                notes[i] = rand.Next(2 * maxInterval + 1) - maxInterval;
            }
        }