Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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]
Add Comment
Please, Sign In to add comment