public void Load(string filename, bool tutorial = false)
    {
        synthSet = xmlSaveLoad.LoadFromFile(filename);
        masterControl.instance.currentScene = filename;

        float v = systemLoad(synthSet.SystemList[0]);

        if (v == 0)
        {
            xmlUpdate             _xmlUpdate = new xmlUpdate();
            List <InstrumentData> dataB      = _xmlUpdate.UpdateFile(filename);
            foreach (InstrumentData dB in dataB)
            {
                GameObject g = Instantiate(instrumentPrefabs[dB.deviceType], Vector3.zero, Quaternion.identity) as GameObject;
                g.GetComponent <deviceInterface>().Load(dB);
            }
        }

        int c = synthSet.InstrumentList.Count;

        for (int i = 0; i < c; i++)
        {
            GameObject g = Instantiate(instrumentPrefabs[synthSet.InstrumentList[c - 1 - i].deviceType], Vector3.zero, Quaternion.identity) as GameObject;
            g.GetComponent <deviceInterface>().Load(synthSet.InstrumentList[c - 1 - i]);
        }

        LoadPlugs();
        ClearSynthSetList();
    }
    public void Save(string filename)
    {
        masterControl.instance.currentScene = filename;

        if (synthSet == null)
        {
            synthSet = new xmlSaveLoad();
        }
        ClearSynthSetList();

        systemSave();
        deviceInterface[] devices = FindObjectsOfType(typeof(deviceInterface)) as deviceInterface[];
        foreach (deviceInterface d in devices)
        {
            synthSet.InstrumentList.Add(d.GetData());
        }

        omniPlug[] plugs = FindObjectsOfType(typeof(omniPlug)) as omniPlug[];
        foreach (omniPlug p in plugs)
        {
            synthSet.PlugList.Add(p.GetData());
        }

        synthSet.SaveToFile(filename);
    }
    public bool PreviewLoad(string filename, Transform par)
    {
        synthSet = xmlSaveLoad.LoadFromFile(filename);
        float v = systemLoad(synthSet.SystemList[0], true);

        foreach (InstrumentData data in synthSet.InstrumentList)
        {
            Transform t = (Instantiate(menuManager.instance.refObjects[data.deviceType], par, false) as GameObject).transform;
            t.localPosition = data.position;
            t.localRotation = data.rotation;
            t.localScale    = data.scale;
        }

        ClearSynthSetList();
        return(v != 0);
    }