RhythmService: Easily make rhythm games and features

I was making a rhythm game and thought that some people might’ve wanted to do the same! So, I made a customizable module to simplify the process, but allow developers to measure rhythm however they want.

Feature summary:

  • Get accuracy data based on customizable tolerance levels
    • Lower Rating = More on-beat, but nil means the player completely missed
  • An event (OnIdle) fires if no input is given and a key passes

Here’s an example that prints accuracy when a player jumps to the beat:

The example song I used was called “Chatter (sting)”.


You can get the module here:

https://www.roblox.com/library/6580760519/RhythmService

You can check out or contribute to the code here:

And here’s the documentation: API documentation · Beastslash/Roblox-RhythmService Wiki · GitHub


If you have any questions, leave a reply or DM me! I’ll be happy to help.

29 Likes

v1.0.1:

  • Using the :ResetKeys method without passing a table will erase the current keys
  • Using :StartStopwatch will reset the current key position
  • :CheckRhythm and :StartStopwatch will error if there are no keys

Good for some games, but there is a BIG problem.
isn’t it will be hard for moving the rythm blocks and perfectly timing it with wait() or tick()
you would an API for development if it’s mainly based on rythm mechanics.

You can use :CheckRhythm immediately when the player sends input.

v1.0.2:

Updated docs to say missed beats = nil rating instead of 0; thanks for pointing that out @Maxx_J

v1.1.0:

  • Move the Stopwatch and Sound properties to the RhythmService table
  • Add long (holding) note support
    • Add new optional noHold parameter to :CheckRhythm
    • Tables can now be stored using :SetKeys
      • for example, RhythmService:SetKeys({0.5, {1, 2}}) will create a key at the 0.5-second mark and follow your tolerance definitions normally. this will also create a normal key at the 1-second mark but it will be continuously measured until the 2-second mark (accounting for your tolerance definitions) or when the stopwatch ends. a code example can be found here
  • change :ToggleKey’s keepPosition parameter type to boolean
1 Like

Usefull tool, but is there auto-charting? (Like you create notes to rhytm)

1 Like

hey there,

the module doesn’t autochart at the moment.

perhaps a plugin can be made to play the song, and the dev can press a button to the rhythm, which would give the module the chart they want. i’ll think more about that

When I enable stopwatch I still get this

RhythmService:66: The stopwatch hasn't started!

is this a bug or am I doing something wrong

it only works once then it gives that error afterwards

edit: this does not work properly and I am no longer using it, sorry!

that’s fine; sorry i didn’t have time to help you.