     }
     
     // MARK: - Touch methods
+    
+    /// touchesBegan method starts a recording if this is the first touch in a new microjam.
     override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
         // start timer if not recording
         let p = touches.first?.location(in: self.chirpeySquare);

        print("JAMVC: view loaded")
        self.recordingProgress!.progress = 0.0
        self.updateUI()
        if (state == ChirpJamModes.loaded) {
            print("JAMVC: opening Pd file for loaded performance.")
            (UIApplication.shared.delegate as! AppDelegate).openPdFile(withName: (loadedPerformance?.instrument)!)
        }
    }
    
    /// Load a ChirpPerformance for playback and reaction

    /// Update the UI labels and image only if there is a valid performance loaded.
    func updateUI() {
        print("JAMVC: Updating UI.")
        switch self.state {
        case ChirpJamModes.new:
            self.navigationItem.title = "New Performance"
            self.statusLabel.text = "new"
            self.performerLabel.text = UserDefaults.standard.string(forKey: SettingsKeys.performerKey)
            self.instrumentLabel.text = SoundSchemes.namesForKeys[UserDefaults.standard.integer(forKey: SettingsKeys.soundSchemeKey)]
            print("JAMVC: opening Pd file for new performance.")
            (UIApplication.shared.delegate as! AppDelegate).openPdFile(withName: self.instrumentLabel.text!)
        case ChirpJamModes.recording:
            self.navigationItem.title = "recording..."
            self.statusLabel.text = "recording..."
