TestsTested | ā |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Feb 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ā |
Maintained by Manuel Escrig.
A Rhythm Box System for your iOS app
To run the example project, clone the repo, and run pod install
from the Example directory first.
To 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 install
To 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 RhythmBox
let rhythmBox = RhythmBox(bpm: 120, timeSignature: (4,4))
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
print("CurrentSubBeat", CurrentSubBeat)
print("CurrentNote", CurrentNote)
return .resume
}
rhythmBox.stop()
Create a 120 BPM signal with a block.
let rhythmBox = RhythmBox(bpm: 120)
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
return .resume
}
Create a 150 BPM signal with a time signature of 6/8 with default subdivision of
let rhythmBox = RhythmBox(bpm: 150, timeSignature: (6,8))
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
return .resume
}
Create a 90 BPM signal with a time signature of Ā¾ and subdivision of
let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: "11")
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
return .resume
}
Create a 90 BPM signal with a time signature of Ā¾ and subdivision of
let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: "111")
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
return .resume
}
Create a 90 BPM signal with a time signature of Ā¾ and subdivision of
let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: "011")
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
return .resume
}
Create a 90 BPM signal with a time signature of Ā¾ and subdivision of
let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: "10111")
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
return .resume
}
See Changelog.md
Contributions are welcomed and encouraged
RhythmBox is available under the MIT license. See the LICENSE file for more info.