public override void Awake()
    {
        base.Awake();

        curKey = -1;

        _adsrInterface = GetComponentInChildren <adsrInterface>();
        octaveToggle   = GetComponentInChildren <basicSwitch>();

        freqSignal = GetComponent <keyFrequencySignalGenerator>();
        adsrSignal = GetComponent <adsrSignalGenerator>();

        freqoutput.homesignal = freqSignal;
        ampoutput.homesignal  = adsrSignal;

        keys = new key[keyCount];
        adsrSignal.durations = _adsrInterface.durations;
        adsrSignal.volumes   = _adsrInterface.volumes;
        SpawnKeys();

        for (int i = 0; i < 25; i++)
        {
            keyStates[i] = new keyState(false);
        }
    }
 public override void Awake()
 {
     base.Awake();
     _adsrInterface           = GetComponentInChildren <adsrInterface>();
     adsrSignal               = GetComponent <adsrSignalGenerator>();
     adsrSignal._devinterface = this;
     adsrSignal.durations     = _adsrInterface.durations;
     adsrSignal.volumes       = _adsrInterface.volumes;
 }
Exemple #3
0
    public override void Awake()
    {
        base.Awake();
        _beatManager   = ScriptableObject.CreateInstance <beatTracker>();
        sticks         = GetComponentsInChildren <drumstick>();
        signal         = GetComponent <xylorollSignalGenerator>();
        _adsrInterface = GetComponentInChildren <adsrInterface>();
        inputSwitch    = GetComponentInChildren <basicSwitch>();
        signal.spawnVoices(voiceCount, _adsrInterface.volumes, _adsrInterface.durations);

        SpawnKeys();
        oscBank.SetActive(inputVal);
        sampleBank.SetActive(!inputVal);

        _timeline.setStartTracks(24);

        for (int i = 0; i < 24; i++)
        {
            keyStates[i] = new keyState(false);
        }
    }