Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Dear Ultrastar-Deluxe development team,
This is a follow-up of an older pull-request (#579), which I closed to split it into two following GaryCXJk's suggestion.
To recapitulate, in order to be able to have my children do their rhythm music exercises in a game setting, I wrote an extension to the UltraStar-Deluxe game that would evaluate individual beats. It is very useful in our context and so I wanted to share this if it can be of help, or also just fun, for other people.
This pull request focuses on the audio detection of clapping sounds. The implementation is now an extension of the rap notes, and beat instead of singing analysis can be triggered by including the song header tag RAP:BEAT in the song lyrics file.
@GaryCXJk: I removed the keyboard playing part to simplify things, and if appropriate, would do another pull request specifically for this; and as you can see I also removed the extra note types and based everything on the rap notes (thanks also s09bQ5 for a comment along similar lines, I now understood better, I hope).
@basisbit: This pull request still contains an implementation of a specific beat detection as short loud sound as you suggested. I also updated the screenshots.
@s09bQ5: I tried as much as I could to stay away from inadvertent changes, I hope it is better than last time.
Implementation-wise, the tricky part is to have evaluation at rhythmic beat timing, rather than the default pitch evaluation in the middle of the notes. This is done by checking at every cycle, and by having a separate handler BeatNoteTimerState that determines at every round which beat (that is rap note in beat mode) note is playing if any. In this implementation, the player is expected to clap centered on the first beat of the note, with a time interval depending on the difficulty level, missed timing giving resulting in some points being subtracted.
Screenshots.pdf