A naive but generic beat-detection module