swift-music 是一个 Swift 包,它为音乐相关的开发提供了一个易于使用的 API。
当前可用模块
import MusicTheory
Note.D - Note.E // Interval.m7
// Create with notes contained.
let Esus4 = Chord(.E, notes: [.E, .A, .B])
// Create with root and quality.
let Abm = Chord(.A_flat, .minorTriad)
Scale(.B, .major).triad(degree: 6) // G#m
文件 - 添加包 - https://github.com/sh3l6orrr/swift-music.git
在 Package.swift 中,添加以下内容
dependencies: [
.package(url: "https://github.com/sh3l6orrr/swift-music.git", .upToNextMajor(from: "1.0.0"))
]
targets: [
.target(
name: "YourTarget",
dependencies: [.product(name: "MusicTheory", package: "swift-music")]
)
]
点击本 README 前面的徽章,或在 Xcode 中构建
Product - Build Documentation (产品 - 构建文档)