Created
January 30, 2018 20:59
-
-
Save mmuszynski/163d0c90e20aa2d18d893e6562b5cebc to your computer and use it in GitHub Desktop.
This file contains hidden or 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
let view = MusicStaffView() | |
let root = MusicPitch(name: .g, accidental: .natural, octave: 3) | |
let scale = try! MusicScale(root: root, mode: .melodicMinor, direction: .up) | |
let notes = scale.map { MusicNote(pitch: $0, rhythm: (arc4random() % 2) == 0 ? .quarter : .half) } | |
view.elements = [MusicClef.treble] + notes + [MusicStaffViewBarLine.final] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment