Beispiel #1
0
    private void Start()
    {
        //jeden kanal
        wahwah                  = musicCube.GetComponent <WahWahFilter>();
        wahwah.QValue           = 1.5f;
        wahwah.CutOffFrequency  = 300.0f;
        wahwah.FrequencyRange   = 800.0f;
        lowpass                 = musicCube.GetComponent <LowPassFilter>();
        lowpass.CutOffFrequency = 400.0f;
        lowpass.QValue          = 0.5f;


        //drugi kanal
        envelope                 = musicCube.GetComponent <EnvelopGenerator>();
        envelope.AttackRate      = 0.15f * 44100.0f;
        envelope.DecayRate       = 0.15f * 44100.0f;
        envelope.SustainLevel    = 0.6f;
        envelope.ReleaseRate     = 0.1f * 44100.0f;
        highpass                 = musicCube.GetComponent <HighPassFilter>();
        highpass.QValue          = 0.5f;
        highpass.CutOffFrequency = 300.0f;
        bandpass                 = musicCube.GetComponent <BandPassFilter>();
        bandpass.centreFrequency = 350.0f;
        bandpass.q               = 0.4f;
        bandpass.BandPassFilterConstantPeakGain();
        vibrato           = musicCube.GetComponent <VibratoFilter>();
        vibrato.delay     = 0.2f;
        vibrato.depth     = 0.03f;
        vibrato.frequency = 0.8f;
    }
 public void IsEnabled(bool enable)
 {
     Debug.Log("Updating all pass filter state, is enabled: " + enable);
     filter.SetIsFilterActive(enable);
     filter.BandPassFilterConstantPeakGain();
 }