MusicalScaleKit 0.2.0

MusicalScaleKit 0.2.0

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

muukiimuukii维护。



MusicalScaleKit

示例

通过变化度创建

public struct Scale {

    public let degrees: [Degree]

    public let key: Note

    public init(key: Note, degrees: [Degree])    

    public var notes: [Note] { get }
}

获取IonianScale(大调)

let ionianScale = Scale(
    key: .C(.natural),
    degrees: [
        .one(.natural),
        .two(.natural),
        .three(.natural),
        .four(.natural),
        .five(.natural),
        .six(.natural),
        .seven(.natural),
    ]
)

print(ionianScale)
key: C
degrees: [1, 2, 3, 4, 5, 6, 7]
notes: [C, D, E, F, G, A, B]

获取DorianScale

let dorianScale = Scale(
    key: .C(.natural),
    degrees: [
        .one(.natural),
        .two(.natural),
        .three(.flat),
        .four(.natural),
        .five(.natural),
        .six(.natural),
        .seven(.flat),
    ]
)

print(dorianScale)
key: C
degrees: [1, 2, ♭3, 4, 5, 6, ♭7]
notes: [C, D, D#, F, G, A, A#]

创建音符

let a = Note.a(.natural)
let a_flat = Note.a(.flat)
let a_sharp = Note.a(.sharp)

或者

let a = Note.a(.natural)
let a_flat = a.flat()
let a_sharp = a.sharp()

要求

安装

MusicalScaleKit可通过CocoaPods获取。要安装它,只需在Podfile中添加以下行:

pod "MusicalScaleKit"

作者:

muukii,邮箱:[email protected]

许可证

MusicalScaleKit处于MIT许可证下。有关更多信息,请参阅LICENSE文件。