         str.appendContentsOf("                        <key>enabled</key>\n")
         str.appendContentsOf("                        <true/>\n")
         str.appendContentsOf("                        <key>loop enabled</key>\n")
-        str.appendContentsOf("                        <false/>\n")
+        str.appendContentsOf("                        <\((loopEnabled ? "true" : "false"))/>\n")
         str.appendContentsOf("                        <key>max key</key>\n")
         str.appendContentsOf("                        <integer>\(endNote)</integer>\n")
         str.appendContentsOf("                        <key>min key</key>\n")

        str.appendContentsOf("                    </array>\n")
        return str
    }
    static public func closeLayer() -> String {
        var str = ""
        str.appendContentsOf("                </dict>\n")

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