         self.controller = notification.object as? GCController
         self.controller?.microGamepad?.reportsAbsoluteDpadValues = true
         self.controller?.microGamepad?.valueChangedHandler = { (gamepad, element) in
+            if !self.demoFinished {
+                return
+            }
+
             if element == gamepad.dpad {
                 self.handleDpad(element as! GCControllerDirectionPad)
             } else if element == gamepad.buttonA {


    override func update(currentTime: NSTimeInterval) {
        if let gravity = self.controller?.motion?.gravity
            where upAnOctave != (gravity.z > -2.0/3.0) {
                upAnOctave = !upAnOctave

                if upAnOctave {


    let octaveMultiplier = CGFloat(pow(pow(2.0, 1.0/12.0), 12.0))
    let animationDuration = 0.4
    let ranDemoKey = "ranDemo"

    var controller: GCController?
    var dpadActive = false
    var buttonAPending = false
    var buttonXPending = false
    var demoFinished = false

    let frequencies: [UIPressType: CGFloat] = [
        .UpArrow: Note.D4.rawValue,
