Get Updates By E-mail 

Article Written By:
Johann Dowa

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

<pre><code>print("CurrentBeat", CurrentBeat)
return .resume
</code></pre>

}

You can find RhythmBox on Github here.

A useful library for music apps.


  •  
  •  
  •  
  •  
  •  

Submit A Resource

Have you created a useful tutorial, library or tool for iOS development that you would like to get in front of our 300,000+ monthly page views from iOS developers?

You can submit the url here.

The resources we feel will appeal to our readers the most will be posted on the front page.

Comments