     }
     
     static func generateZone(id: Int,
-                             rootNote: Int,
-                             startNote: Int,
-                             endNote: Int,
+                             rootNote: MIDINoteNumber,
+                             startNote: MIDINoteNumber,
+                             endNote: MIDINoteNumber,
                              wavRef: Int = 268435457,
                              offset: Int = 0,
                              loopEnabled: Bool = false) -> String {

            }
            switch triggerMode {
            case  .Hold:
                sampleZoneXML = AKAUPresetBuilder.generateZone(id: i, rootNote: rootNote, startNote: startNote, endNote: endNote, wavRef: sampleNum, loopEnabled: false)
                let tempLayerXML = AKAUPresetBuilder.generateLayer(connections: AKAUPresetBuilder.generateMinimalConnections(layer: i+1), envelopes: envelopesXML, zones: sampleZoneXML, layer: i+1, numVoices: 1, ignoreNoteOff: false)
                layerXML.append(tempLayerXML)
            case .Loop:
                sampleZoneXML = AKAUPresetBuilder.generateZone(id: i, rootNote: rootNote, startNote: startNote, endNote: endNote,
                                                               wavRef: sampleNum, loopEnabled: true)
                let tempLayerXML = AKAUPresetBuilder.generateLayer(connections: AKAUPresetBuilder.generateMinimalConnections(layer: i+1), envelopes: envelopesXML, zones: sampleZoneXML, layer: i+1, numVoices: 1, ignoreNoteOff: false)
                layerXML.append(tempLayerXML)
            default:
                //.Trigger and .Repeat (repeat needs to be handled in the app that uses this mode - otherwise is just the same as Trig mode)
                sampleZoneXML = AKAUPresetBuilder.generateZone(id: i, rootNote: rootNote, startNote: startNote, endNote: endNote, wavRef: sampleNum, loopEnabled: false)
                let tempLayerXML = AKAUPresetBuilder.generateLayer(connections: AKAUPresetBuilder.generateMinimalConnections(layer: i+1), envelopes: envelopesXML, zones: sampleZoneXML, layer: i+1, numVoices: 1, ignoreNoteOff: true)
                layerXML.append(tempLayerXML)
                

                sampleIteration += 1
            }
            
            var startNote = soundDict.object(forKey: startNoteKey) as? MIDINoteNumber
            var endNote = soundDict.object(forKey: endNoteKey) as? MIDINoteNumber
            let rootNote = soundDict.object(forKey: rootNoteKey)! as! MIDINoteNumber
            startNote = (startNote == nil ? rootNote : startNote)
            endNote = (endNote == nil ? rootNote : endNote)
            let triggerModeStr = soundDict.object(forKey: triggerModeKey) as? String
            let triggerMode : SampleTriggerMode
            
            soundDict.setObject(sampleNum, forKey: "sampleNum" as NSCopying)
            loadSoundsArr.append(soundDict)
            
