Hello there! I am currently creating a music sync API as an open source project for the community.
I’d like feedback on the API design, any criticism is welcome.
So far, this is my idea:
local SyncObject = Sync.new(audioInstance, beatsPerMinute, startOffset, stepsPerBeat)
SyncObject.Beat:Connect(function(beat)
end)
SyncObject.Step:Connect(function(beat, step, absoluteStep)
end)
What is going on here?
Basically, every song has a rhythm to it, the beats per minute (BPM). Not every song starts at exactly 0 seconds, so the StartOffset is needed.
Steps are subdivisions of beats. Depending on the time signature, music has different steps per beat. The script above is just setting up the events.
Is this a good API? Would you change anything? Do you think there should be more features?
Keep in mind that this is a public API, not just for myself. It will be open source.