RhythmBox 1.1.0

RhythmBox 1.1.0

测试测试
语言语言 SwiftSwift
许可证 MIT
发布最后发布2017年2月
SwiftSwift 版本3.0
SPM支持 SPM

Manuel Escrig 维护。




RhythmBox 1.1.0

RhythmBox

为您的 iOS 应用提供 Rhythm Box 系统🎵。在 Swift 中创建 音乐节奏模式 最简单的方法。

BuddyBuild

我可以用 RhythmBox 做什么?

  • [x] 生成 BPM 或 RPM 速度
  • [x] 选择时间签名
  • [x] 创建节奏模式

演示项目

要运行示例项目,请克隆仓库,并首先从示例目录运行 pod install

入门

要求

  • iOS 8.0+ / tvOS 9.0+
  • Xcode 8.0+
  • Swift 3.0+

Podfile

要使用 CocoaPods 将 RhythmBox 集成到您的 Xcode 项目中,请在您的 Podfile 中指定它

source 'https://github.com/CocoaPods/Specs.git'
pod 'RhythmBox'

然后,运行以下命令

$ pod install

手动安装

要将 RhythmBox 集成到您的 Xcode 项目中,只需将 /Pod/Classes/ 文件夹中的文件包含到您的应用程序的 Xcode 项目中即可。

快速指南

用法

要生成一个恒定的 BPM 信号,可以这样简单。

1. 导入类
import RhythmBox
2. 创建 RhythmBox 类
let rhythmBox = RhythmBox(bpm: 120, timeSignature: (4,4))
3. 开始节奏
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in

    print("CurrentBeat", CurrentBeat)
    print("CurrentSubBeat", CurrentSubBeat)
    print("CurrentNote", CurrentNote)

    return .resume
}
4. 停止节奏
rhythmBox.stop()

示例

示例 1

使用代码块创建一个 120 BPM 信号。

let rhythmBox = RhythmBox(bpm: 120)
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in

    print("CurrentBeat", CurrentBeat)
    return .resume
}
示例 2

创建一个每分钟150次的信号,时值为6/8,默认分割如

let rhythmBox = RhythmBox(bpm: 150, timeSignature: (6,8))
rhythmBox.perform {CurrentBeat, CurrentSubBeat, CurrentNote in

    print("CurrentBeat", CurrentBeat)
    return .resume
}
示例 3

创建一个每分钟90次的信号,拍号为3/4,分割如

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

    print("CurrentBeat", CurrentBeat)
    return .resume
}
示例 4

创建一个每分钟90次的信号,拍号为3/4,分割如

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

    print("CurrentBeat", CurrentBeat)
    return .resume
}
示例 5

创建一个每分钟90次的信号,拍号为3/4,分割如

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

    print("CurrentBeat", CurrentBeat)
    return .resume
}
示例 6

创建一个每分钟90次的信号,拍号为3/4,分割如

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

    print("CurrentBeat", CurrentBeat)
    return .resume
}

路线图

  • [x] CocoaPods 支持
  • [ ] Carthage 支持
  • [ ] Swift 包管理器支持
  • [ ] 测试

变更日志

查看 Changelog.md

贡献

欢迎和鼓励贡献💜.

作者

许可协议

RhythmBox 在MIT许可下可用。有关更多信息,请参阅LICENSE文件。