public override void Awake()
 {
     base.Awake();
     drumSig = GetComponent <drumSignalGenerator>();
     pad     = GetComponentInChildren <drumpad>();
     sticks  = GetComponentsInChildren <drumstick>();
     samp    = GetComponentInChildren <samplerLoad>();
 }
Example #2
0
    public void spawnVoices(int n, float[] adsrVol, float[] adsrDur)
    {
        voices = new List <monophone>();

        samplerLoad _samplerLoad = GetComponentInChildren <samplerLoad>();

        _samplerLoad.players = new clipPlayer[n];

        for (int i = 0; i < n; i++)
        {
            voices.Add(new monophone(Instantiate(monophonicPrefab, transform, false) as GameObject));
            voices[i].adsr.durations = adsrDur;
            voices[i].adsr.volumes   = adsrVol;
            _samplerLoad.players[i]  = voices[i].sampler;
        }
    }
Example #3
0
    public override InstrumentData GetData()
    {
        XyloRollData data = new XyloRollData();

        data.deviceType = menuItem.deviceType.XyloRoll;
        GetTransformData(data);

        data.ADSRdata = new Vector2[3];
        for (int i = 0; i < 3; i++)
        {
            data.ADSRdata[i] = _adsrInterface.xyHandles[i].percent;
        }
        data.octaveSetting = octaveSlider.switchVal;

        data.seqon = seqEnableButton.isHit;
        data.arpon = arpEnableButton.isHit;

        data.arpSetting   = arpPattern;
        data.arpSpeed     = arpSpeed;
        data.inputSetting = inputVal ? 1 : 0;

        data.inputSample = new string[2];

        samplerLoad tempSampLoad = sampleBank.GetComponent <samplerLoad>();

        if (tempSampLoad.queuedSample[0] != "")
        {
            data.inputSample[0] = tempSampLoad.queuedSample[0];
            data.inputSample[1] = tempSampLoad.queuedSample[1];
        }
        else
        {
            tempSampLoad.getTapeInfo(out data.inputSample[0], out data.inputSample[1]);
        }

        oscillatorBankComponentInterface _oscInterface = oscBank.GetComponent <oscillatorBankComponentInterface>();

        data.oscAamp  = _oscInterface.ampPercent[0];
        data.oscAfreq = _oscInterface.freqPercent[0];
        data.oscAwave = _oscInterface.wavePercent[0];

        data.oscBamp  = _oscInterface.ampPercent[1];
        data.oscBfreq = _oscInterface.freqPercent[1];
        data.oscBwave = _oscInterface.wavePercent[1];

        data.jackOutID = output.transform.GetInstanceID();

        data.midiInConnection  = _midiIn.connectedDevice;
        data.midiOutConnection = _midiOut.connectedDevice;

        data.timelinePresent = true;
        data.timelineData    = _timeline.GetTimelineData();
        data.timelineHeight  = _timeline.heightHandle.transform.localPosition.y;
        List <timelineEvent.eventData> tempevents = new List <timelineEvent.eventData>();

        for (int i = 0; i < _timeline._tlEvents.Count; i++)
        {
            if (_timeline._tlEvents[i] != null)
            {
                tempevents.Add(_timeline._tlEvents[i].getEventInfo());
            }
        }
        data.timelineEvents = tempevents.ToArray();

        return(data);
    }