Featured Development Resources iOS Development Libraries Open Source iOS Libraries And Tools Swift

RhythmBox – A Swift Library That Simplifies Creating Music Rhythm Patterns

RhythmBox is an open source Swift library submitted by Manuel Escrig that simplifies the creation of rhythm patterns.

To use RhythmBox you simply need to assign a beat, and an optional sub beat and time signature and RhythmBox will execute your code at the correct time intervals. There are also further subdivisions for different note durations.

This example from the readme shows how one could create a RhythmBox at 90 bpm with a 3/4 time signature further subdividing into eigth notes:

let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: “011”)
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in

print("CurrentBeat", CurrentBeat)
return .resume


You can find RhythmBox on Github here.

A useful library for music apps.