Esempio n. 1
0
    public void SetFloatParameter(Hv_FilterBased_AudioLib.Parameter param, float x)
    {
        switch (param)
        {
        case Parameter.Amp1: {
            x    = Mathf.Clamp(x, 0.0f, 1.0f);
            amp1 = x;
            break;
        }

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

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

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

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

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

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

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

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

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

        case Parameter.Freq1: {
            x     = Mathf.Clamp(x, 20.0f, 20000.0f);
            freq1 = x;
            break;
        }

        case Parameter.Freq10: {
            x      = Mathf.Clamp(x, 20.0f, 20000.0f);
            freq10 = x;
            break;
        }

        case Parameter.Freq2: {
            x     = Mathf.Clamp(x, 20.0f, 20000.0f);
            freq2 = x;
            break;
        }

        case Parameter.Freq3: {
            x     = Mathf.Clamp(x, 20.0f, 20000.0f);
            freq3 = x;
            break;
        }

        case Parameter.Freq4: {
            x     = Mathf.Clamp(x, 20.0f, 20000.0f);
            freq4 = x;
            break;
        }

        case Parameter.Freq5: {
            x     = Mathf.Clamp(x, 20.0f, 20000.0f);
            freq5 = x;
            break;
        }

        case Parameter.Freq6: {
            x     = Mathf.Clamp(x, 20.0f, 20000.0f);
            freq6 = x;
            break;
        }

        case Parameter.Freq7: {
            x     = Mathf.Clamp(x, 20.0f, 20000.0f);
            freq7 = x;
            break;
        }

        case Parameter.Freq8: {
            x     = Mathf.Clamp(x, 20.0f, 20000.0f);
            freq8 = x;
            break;
        }

        case Parameter.Freq9: {
            x     = Mathf.Clamp(x, 20.0f, 20000.0f);
            freq9 = x;
            break;
        }

        case Parameter.Impactforce: {
            x           = Mathf.Clamp(x, 0.0f, 10.0f);
            impactForce = x;
            break;
        }

        case Parameter.Object_roughness: {
            x = Mathf.Clamp(x, 0.0f, 50.0f);
            object_roughness = x;
            break;
        }

        case Parameter.Qfactor: {
            x       = Mathf.Clamp(x, 20.0f, 5000.0f);
            qfactor = x;
            break;
        }

        case Parameter.Size: {
            x    = Mathf.Clamp(x, 0.1f, 2.0f);
            size = x;
            break;
        }

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

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

        case Parameter.Velocity: {
            x        = Mathf.Clamp(x, 0.0f, 10.0f);
            velocity = x;
            break;
        }

        default: return;
        }
        if (IsInstantiated())
        {
            _context.SendFloatToReceiver((uint)param, x);
        }
    }
Esempio n. 2
0
    // see Hv_FilterBased_AudioLib.Parameter for definitions
    public float GetFloatParameter(Hv_FilterBased_AudioLib.Parameter param)
    {
        switch (param)
        {
        case Parameter.Amp1: return(amp1);

        case Parameter.Amp10: return(amp10);

        case Parameter.Amp2: return(amp2);

        case Parameter.Amp3: return(amp3);

        case Parameter.Amp4: return(amp4);

        case Parameter.Amp5: return(amp5);

        case Parameter.Amp6: return(amp6);

        case Parameter.Amp7: return(amp7);

        case Parameter.Amp8: return(amp8);

        case Parameter.Amp9: return(amp9);

        case Parameter.Freq1: return(freq1);

        case Parameter.Freq10: return(freq10);

        case Parameter.Freq2: return(freq2);

        case Parameter.Freq3: return(freq3);

        case Parameter.Freq4: return(freq4);

        case Parameter.Freq5: return(freq5);

        case Parameter.Freq6: return(freq6);

        case Parameter.Freq7: return(freq7);

        case Parameter.Freq8: return(freq8);

        case Parameter.Freq9: return(freq9);

        case Parameter.Impactforce: return(impactForce);

        case Parameter.Object_roughness: return(object_roughness);

        case Parameter.Qfactor: return(qfactor);

        case Parameter.Size: return(size);

        case Parameter.Time_roll: return(time_roll);

        case Parameter.Time_scratch: return(time_scratch);

        case Parameter.Velocity: return(velocity);

        default: return(0.0f);
        }
    }