测试测试 | ✗ |
语言语言 | SwiftSwift |
许可证 | MIT |
发布最后发布 | 2017年2月 |
SwiftSwift 版本 | 3.0 |
SPM支持 SPM | ✗ |
由Manuel Escrig 维护。
为您的 iOS 应用提供 Rhythm Box 系统
要运行示例项目,请克隆仓库,并首先从示例目录运行 pod install
要使用 CocoaPods 将 RhythmBox 集成到您的 Xcode 项目中,请在您的 Podfile 中指定它
source 'https://github.com/CocoaPods/Specs.git'
pod 'RhythmBox'
然后,运行以下命令
$ pod install
要将 RhythmBox 集成到您的 Xcode 项目中,只需将 /Pod/Classes/ 文件夹中的文件包含到您的应用程序的 Xcode 项目中即可。
要生成一个恒定的 BPM 信号,可以这样简单。
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()
使用代码块创建一个 120 BPM 信号。
let rhythmBox = RhythmBox(bpm: 120)
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
return .resume
}
let rhythmBox = RhythmBox(bpm: 150, timeSignature: (6,8))
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
return .resume
}
let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: "11")
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
return .resume
}
let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: "111")
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
return .resume
}
let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: "011")
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
return .resume
}
let rhythmBox = RhythmBox(bpm: 90, timeSignature: (3,4), subdivision: "10111")
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in
print("CurrentBeat", CurrentBeat)
return .resume
}
查看 Changelog.md
欢迎和鼓励贡献
RhythmBox 在MIT许可下可用。有关更多信息,请参阅LICENSE文件。