Guest User

Untitled

a guest
Feb 13th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. let view = MusicStaffView()
  2.  
  3. let root = MusicPitch(name: .g, accidental: .natural, octave: 3)
  4. let scale = try! MusicScale(root: root, mode: .melodicMinor, direction: .up)
  5. let notes = scale.map { MusicNote(pitch: $0, rhythm: (arc4random() % 2) == 0 ? .quarter : .half) }
  6.  
  7. view.elements = [MusicClef.treble] + notes + [MusicStaffViewBarLine.final]
Add Comment
Please, Sign In to add comment