https://github.com/muukii/musicalscalekit
Generate notes on Musical Scale
https://github.com/muukii/musicalscalekit
musical swift
Last synced: about 2 months ago
JSON representation
Generate notes on Musical Scale
- Host: GitHub
- URL: https://github.com/muukii/musicalscalekit
- Owner: muukii
- License: mit
- Created: 2016-05-05T17:36:13.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-17T15:31:24.000Z (almost 8 years ago)
- Last Synced: 2025-02-28T07:14:34.471Z (2 months ago)
- Topics: musical, swift
- Language: Swift
- Size: 33.2 KB
- Stars: 9
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MusicalScaleKit
[](https://travis-ci.org/muukii/MusicalScaleKit)
[](http://cocoapods.org/pods/MusicalScaleKit)
[](http://cocoapods.org/pods/MusicalScaleKit)
[](http://cocoapods.org/pods/MusicalScaleKit)## Example
### Create from ScaleDegree
```swift
public struct Scale {public let degrees: [Degree]
public let key: Note
public init(key: Note, degrees: [Degree])
public var notes: [Note] { get }
}
```#### Get IonianScale(MajorScale)
```swift
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]
```#### Get DorianScale
```swift
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#]
```### Create Note
```swift
let a = Note.a(.natural)
let a_flat = Note.a(.flat)
let a_sharp = Note.a(.sharp)
```or
```swift
let a = Note.a(.natural)
let a_flat = a.flat()
let a_sharp = a.sharp()
```## Requirements
## Installation
MusicalScaleKit is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:```ruby
pod "MusicalScaleKit"
```## Author
muukii, [email protected]
## License
MusicalScaleKit is available under the MIT license. See the LICENSE file for more info.