Last active
January 19, 2017 21:31
-
-
Save mmuszynski/7db4f1d037361f12dca5e6c335c7a355 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Intervals | |
let C0 = MusicPitch(name: .c, accidental: .natural, octave: 0) | |
let D0 = MusicPitch(name: .d, accidental: .natural, octave: 0) | |
let majorSecond = try MusicInterval(rootPitch: C0, destinationPitch: D0) | |
XCTAssertEqual(majorSecond.halfStepDistance, 2) | |
XCTAssertEqual(majorSecond.quality, MusicIntervalQuality.major) | |
XCTAssertEqual(majorSecond.quantity, MusicIntervalQuantity.second) | |
//Scales | |
let root = MusicPitch(name: .d, accidental: .natural, octave: 0) | |
let scale = MusicScale(root: root, mode: .harmonicMinor) | |
let dMinor = [root, | |
MusicPitch(name: .e, accidental: .natural, octave: 0), | |
MusicPitch(name: .f, accidental: .natural, octave: 0), | |
MusicPitch(name: .g, accidental: .natural, octave: 0), | |
MusicPitch(name: .a, accidental: .natural, octave: 0), | |
MusicPitch(name: .b, accidental: .flat, octave: 0), | |
MusicPitch(name: .c, accidental: .sharp, octave: 1)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment