Code edits with BadLogic's onset detection framework.