Beispiel #1
0
 public RhythmPatternModEnd(RhythmPatternBase pattern, RhythmPatternBase patternEnd)
 {
     Debug.Assert(pattern.BeatsPerMeasure == patternEnd.BeatsPerMeasure);
     Debug.Assert(patternEnd.MeasuresCount < pattern.MeasuresCount);
     this.pattern    = pattern;
     this.patternEnd = patternEnd;
 }
Beispiel #2
0
 public MelodyAtomic(object[] notes, int bpm = 4)
 {
     Debug.Assert(notes.Length % bpm == 0);
     rhythm     = new RhythmPattern(bpm, notes.Select(obj => obj != null).ToArray());
     this.notes = notes.Where(obj => obj != null).ToArray();
     this.bpm   = bpm;
 }
Beispiel #3
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();
 }
Beispiel #4
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;
            }
        }
Beispiel #5
0
 public abstract int CountPattern(RhythmPatternBase pattern);
Beispiel #6
0
 public override int CountPattern(RhythmPatternBase pattern)
 {
     throw new NotImplementedException();
 }
Beispiel #7
0
 public override int CountPattern(RhythmPatternBase pattern)
 {
     return(pattern == this ? 1 : 0);
 }
Beispiel #8
0
 public override int CountPattern(RhythmPatternBase pattern)
 {
     return(patterns.Sum(p => p.CountPattern(pattern)));
 }
 public override int CountPattern(RhythmPatternBase pattern)
 {
     return(basePattern.CountPattern(pattern));
 }
 public RhythmSectionInverse(RhythmPatternBase pattern)
 {
     basePattern = pattern;
 }