public RhythmPatternModEnd(RhythmPatternBase pattern, RhythmPatternBase patternEnd) { Debug.Assert(pattern.BeatsPerMeasure == patternEnd.BeatsPerMeasure); Debug.Assert(patternEnd.MeasuresCount < pattern.MeasuresCount); this.pattern = pattern; this.patternEnd = patternEnd; }
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; }
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(); }
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; } }
public abstract int CountPattern(RhythmPatternBase pattern);
public override int CountPattern(RhythmPatternBase pattern) { throw new NotImplementedException(); }
public override int CountPattern(RhythmPatternBase pattern) { return(pattern == this ? 1 : 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; }