         return str
     }
     
-    static public func generateFileRef(wavRef: Int = 268435457, samplePath: String) -> String {
+    static func generateFileRef(wavRef: Int = 268435457, samplePath: String) -> String {
         var str: String = ""
         str.appendContentsOf("            <key>Sample:\(wavRef)</key>\n")
         str.appendContentsOf("            <string>\(samplePath)</string>\n")

        return str
    }
    
    static public func generateMinimalConnections(layer: Int = 0) -> String {
        let layerOffset: Int = 256*layer
        let pitchDest: Int = 816840704+layerOffset
        let envelopeSource: Int = 536870912+layerOffset

                sampleIteration += 1
            }

            
            var startNote = soundDict.objectForKey(startNoteKey) as? Int
            var endNote = soundDict.objectForKey(endNoteKey) as? Int
            let rootNote = soundDict.objectForKey(rootNoteKey)! as! Int
            startNote = (startNote == nil ? rootNote : startNote)
            endNote = (endNote == nil ? rootNote : endNote)
            let trigModeStr = soundDict.objectForKey(triggerModeKey) as? String
            let trigMode : SampleTrigMode
            let loopBool = false //in progress
            let tempSampleZoneXML: String = AKAUPresetBuilder.generateZone(i, rootNote: rootNote, startNote: startNote!, endNote: endNote!, wavRef: sampleNum, loopEnabled: loopBool)

            sampleZoneXML.appendContentsOf(tempSampleZoneXML)
            soundDict.setObject(sampleNum, forKey: "sampleNum")
            loadSoundsArr.append(soundDict)
            
            let envelopesXML = AKAUPresetBuilder.generateEnvelope(0, delay: 0, attack: attack!, hold: 0, decay: 0, sustain: 1, release: release!)
            switch trigModeStr {
            case SampleTrigMode.Hold.rawValue?:
                trigMode = SampleTrigMode.init(rawValue: SampleTrigMode.Hold.rawValue)!
            default:
                
                trigMode = SampleTrigMode.init(rawValue: SampleTrigMode.Trig.rawValue)!
            }
            if trigMode == .Trig{
                let tempLayerXML = AKAUPresetBuilder.generateLayer(AKAUPresetBuilder.generateMinimalConnections(i+1), envelopes: envelopesXML, zones: tempSampleZoneXML, layer: i+1, numVoices: 1, ignoreNoteOff: true)
                layerXML.appendContentsOf(tempLayerXML)
            }else if trigMode == .Hold{
                let tempLayerXML = AKAUPresetBuilder.generateLayer(AKAUPresetBuilder.generateMinimalConnections(i+1), envelopes: envelopesXML, zones: tempSampleZoneXML, layer: i+1, numVoices: 1, ignoreNoteOff: false)
                layerXML.appendContentsOf(tempLayerXML)
            }
        }//end sounds
        
        let str = AKAUPresetBuilder.buildInstrument(instrumentName, layers:layerXML, filerefs: sampleIDXML)

        //write to file
        do {
