Ejemplo n.º 1
0
    public void SetFloatParameter(Hv_oscilloSix_AudioLib.Parameter param, float x)
    {
        switch (param)
        {
        case Parameter.Freqmaster: {
            x          = Mathf.Clamp(x, 0.0f, 20000.0f);
            freqMaster = x;
            break;
        }

        case Parameter.Gain: {
            x    = Mathf.Clamp(x, 0.0f, 1.0f);
            gain = x;
            break;
        }

        case Parameter.Glide: {
            x     = Mathf.Clamp(x, 0.0f, 1000.0f);
            glide = x;
            break;
        }

        case Parameter.Interpolationfreq: {
            x = Mathf.Clamp(x, 0.0f, 12000.0f);
            interpolationFreq = x;
            break;
        }

        case Parameter.Midfreq: {
            x       = Mathf.Clamp(x, 0.0f, 5.0f);
            midFreq = x;
            break;
        }

        case Parameter.Nbharmo: {
            x       = Mathf.Clamp(x, 0.0f, 5.0f);
            nbHarmo = x;
            break;
        }

        case Parameter.Selectoutput: {
            x            = Mathf.Clamp(x, 0.0f, 2.0f);
            selectOutput = x;
            break;
        }

        case Parameter.Smoothgain: {
            x          = Mathf.Clamp(x, 0.0f, 100.0f);
            smoothGain = x;
            break;
        }

        default: return;
        }
        if (IsInstantiated())
        {
            _context.SendFloatToReceiver((uint)param, x);
        }
    }
Ejemplo n.º 2
0
    // see Hv_oscilloSix_AudioLib.Parameter for definitions
    public float GetFloatParameter(Hv_oscilloSix_AudioLib.Parameter param)
    {
        switch (param)
        {
        case Parameter.Freqmaster: return(freqMaster);

        case Parameter.Gain: return(gain);

        case Parameter.Glide: return(glide);

        case Parameter.Interpolationfreq: return(interpolationFreq);

        case Parameter.Midfreq: return(midFreq);

        case Parameter.Nbharmo: return(nbHarmo);

        case Parameter.Selectoutput: return(selectOutput);

        case Parameter.Smoothgain: return(smoothGain);

        default: return(0.0f);
        }
    }