A Rhythm Box System for your iOS app 🎵. The easiest way to create Music Rhythm Patterns in Swift.
- Generate a BPM or RPM Tempo
- Select the Time Signature
- Create a Rhythm pattern
To run the example project, clone the repo, and run pod install from the Example directory first.
- iOS 8.0+ / tvOS 9.0+
- Xcode 8.0+
- Swift 3.0+
CocoaPods is a 3rd-party dependency manager for Swift and Objective-C projects. For more information, refer to the CocoaPods Getting Started Guide. Otherwise, you can install CocoaPods with the following command:
$ gem install cocoapodsTo integrate RhythmBox into your Xcode project using CocoaPods, specify it in your Podfile:
source'https://github.com/CocoaPods/Specs.git'pod'RhythmBox'Then, run the following command:
$ pod installTo integrate RhythmBox into your Xcode project manually, just include the filest from /Pod/Classes/ folder in your App’s Xcode project.
To Generate a constant BPM signal is as simple as this.
import RhythmBoxletrhythmBox=RhythmBox(bpm:120, timeSignature:(4,4))rhythmBox.perform{CurrentBeat, CurrentSubBeat, CurrentNote inprint("CurrentBeat", CurrentBeat)print("CurrentSubBeat", CurrentSubBeat)print("CurrentNote", CurrentNote)return.resume
}rhythmBox.stop()Create a 120 BPM signal with a block.
letrhythmBox=RhythmBox(bpm:120)
rhythmBox.perform{CurrentBeat, CurrentSubBeat, CurrentNote inprint("CurrentBeat", CurrentBeat)return.resume
}Create a 150 BPM signal with a time signature of 6/8 with default subdivision of 
letrhythmBox=RhythmBox(bpm:150, timeSignature:(6,8))
rhythmBox.perform{CurrentBeat, CurrentSubBeat, CurrentNote inprint("CurrentBeat", CurrentBeat)return.resume
}Create a 90 BPM signal with a time signature of 3/4 and subdivision of 
letrhythmBox=RhythmBox(bpm:90, timeSignature:(3,4), subdivision:"11")
rhythmBox.perform{CurrentBeat, CurrentSubBeat, CurrentNote inprint("CurrentBeat", CurrentBeat)return.resume
}Create a 90 BPM signal with a time signature of 3/4 and subdivision of 
letrhythmBox=RhythmBox(bpm:90, timeSignature:(3,4), subdivision:"111")
rhythmBox.perform{CurrentBeat, CurrentSubBeat, CurrentNote inprint("CurrentBeat", CurrentBeat)return.resume
}Create a 90 BPM signal with a time signature of 3/4 and subdivision of 
letrhythmBox=RhythmBox(bpm:90, timeSignature:(3,4), subdivision:"011")
rhythmBox.perform{CurrentBeat, CurrentSubBeat, CurrentNote inprint("CurrentBeat", CurrentBeat)return.resume
}Create a 90 BPM signal with a time signature of 3/4 and subdivision of 
letrhythmBox=RhythmBox(bpm:90, timeSignature:(3,4), subdivision:"10111")
rhythmBox.perform{CurrentBeat, CurrentSubBeat, CurrentNote inprint("CurrentBeat", CurrentBeat)return.resume
}- CocoaPods support
- Carthage support
- Swift Package Manager support
- Tests
See Changelog.md
Contributions are welcomed and encouraged 💜.
- Manuel Escrig Ventura, @manuelescrig
- Email manuel@ventura.media
- Portfolio http://ventura.media
RhythmBox is available under the MIT license. See the LICENSE file for more info.
