Draft for beat parsing.
Some refactoring.