Moved rhythm generation to RhythmGenerator; fixed bug