                                               scale: Int,
                                               transform: Int = 1,
                                               invert: Bool = false) -> String {
-        var templateStr = ""
-        templateStr.appendContentsOf("                        <dict>\n")
-        templateStr.appendContentsOf("                            <key>ID</key>\n")
-        templateStr.appendContentsOf("                            <integer>\(id)</integer>\n")
-        templateStr.appendContentsOf("                            <key>control</key>\n")
-        templateStr.appendContentsOf("                            <integer>0</integer>\n")
-        templateStr.appendContentsOf("                            <key>destination</key>\n")
-        templateStr.appendContentsOf("                            <integer>\(destination)</integer>\n")
-        templateStr.appendContentsOf("                            <key>enabled</key>\n")
-        templateStr.appendContentsOf("                            <true/>\n")
-        templateStr.appendContentsOf("                            <key>inverse</key>\n")
-        templateStr.appendContentsOf("                            <\((invert ? "true" : "false"))/>\n")
-        templateStr.appendContentsOf("                            <key>scale</key>\n")
-        templateStr.appendContentsOf("                            <real>\(scale)</real>\n")
-        templateStr.appendContentsOf("                            <key>source</key>\n")
-        templateStr.appendContentsOf("                            <integer>\(source)</integer>\n")
-        templateStr.appendContentsOf("                            <key>transform</key>\n")
-        templateStr.appendContentsOf("                            <integer>1</integer>\n")
-        templateStr.appendContentsOf("                        </dict>\n")
-        return templateStr
+        var str = ""
+        str.appendContentsOf("\(spaces(34))<dict>\n")
+        str.appendContentsOf("\(spaces(34))    <key>ID</key>\n")
+        str.appendContentsOf("\(spaces(34))    <integer>\(id)</integer>\n")
+        str.appendContentsOf("\(spaces(34))    <key>control</key>\n")
+        str.appendContentsOf("\(spaces(34))    <integer>0</integer>\n")
+        str.appendContentsOf("\(spaces(34))    <key>destination</key>\n")
+        str.appendContentsOf("\(spaces(34))    <integer>\(destination)</integer>\n")
+        str.appendContentsOf("\(spaces(34))    <key>enabled</key>\n")
+        str.appendContentsOf("\(spaces(34))    <true/>\n")
+        str.appendContentsOf("\(spaces(34))    <key>inverse</key>\n")
+        str.appendContentsOf("\(spaces(34))    <\((invert ? "true" : "false"))/>\n")
+        str.appendContentsOf("\(spaces(34))    <key>scale</key>\n")
+        str.appendContentsOf("\(spaces(34))    <real>\(scale)</real>\n")
+        str.appendContentsOf("\(spaces(34))    <key>source</key>\n")
+        str.appendContentsOf("\(spaces(34))    <integer>\(source)</integer>\n")
+        str.appendContentsOf("\(spaces(34))    <key>transform</key>\n")
+        str.appendContentsOf("\(spaces(34))    <integer>1</integer>\n")
+        str.appendContentsOf("\(spaces(34))</dict>\n")
+        return str
     }
     static public func closeConnections() -> String {
-        var templateStr = ""
-        templateStr.appendContentsOf("                    </array>\n")
-        return templateStr
+        var str = ""
+        str.appendContentsOf("                    </array>\n")
+        return str
     }
     static public func openEnvelopes() -> String {
-        var templateStr = ""
-        templateStr.appendContentsOf("                    <key>Envelopes</key>\n")
-        templateStr.appendContentsOf("                    <array>\n")
-        return templateStr
+        var str = ""
+        str.appendContentsOf("                    <key>Envelopes</key>\n")
+        str.appendContentsOf("                    <array>\n")
+        return str
     }
     static public func generateEnvelope(id: Int = 0,
                                         delay: Double = 0.0,

     instName is the name of the aupreset
     */
    static public func createAUPresetFromDict(dict: NSDictionary, path: String, instName: String, attack: Double? = 0, release: Double? = 0) {
        let rootNoteKeyStr = "rootnote"
        let startNoteKeyStr = "startnote"
        let endNoteKeyStr = "endnote"
        let filenameKeyStr = "filename"
        var loadSoundsArr = Array<NSMutableDictionary>()
        var sampleZoneXML: String = String()
        var sampleIDXML: String = String()

//  AUPresetTemplate.swift
//  AudioKit
//
//  Created by Jeff Cooper, revision history on Github.
//  Copyright © 2016 AudioKit. All rights reserved.
//

