         templateStr.appendContentsOf("                    <array>\n")
         return templateStr
     }
-    static public func generateZone(id:Int, rootNote:Int, startNote:Int, endNote:Int, wavRef:Int = 268435457)->String{
+    static public func generateZone(id:Int, rootNote:Int, startNote:Int, endNote:Int, wavRef:Int = 268435457, offset:Int = 0)->String{
+        let wavRefNum = wavRef+offset
         var templateStr = ""
         templateStr.appendContentsOf("                    <dict>\n")
         templateStr.appendContentsOf("                        <key>ID</key>\n")

 300 = keynumber
 301 = keyvelocity
 536870912 = layer1envelope
 536871168 = layer2envelope (+256)
 268435456 = layer1LFO1
 268435457 = layer1LFO2
 

        templateStr.appendContentsOf("                        <key>type</key>\n")
        templateStr.appendContentsOf("                        <integer>40</integer>\n")
        templateStr.appendContentsOf("                    </dict>\n")
        return templateStr
    }
    static public func generateID(id:Int = 0)->String{
        var templateStr = ""
        templateStr.appendContentsOf("                    <key>ID</key>\n")
        templateStr.appendContentsOf("                    <integer>\(id)</integer>\n")
        return templateStr
    }
    static public func openLFOs()->String{
