Pattern: fix beat pattern behaviour with different time signatures

Fixes #337