Esempio n. 1
0
    public void SetFloatParameter(Hv_pedSynths_AudioLib.Parameter param, float x)
    {
        switch (param)
        {
        case Parameter.Del1f: {
            x     = Mathf.Clamp(x, 0.1f, 1.0f);
            del1F = x;
            break;
        }

        case Parameter.Del1t: {
            x     = Mathf.Clamp(x, 10.0f, 2000.0f);
            del1T = x;
            break;
        }

        case Parameter.Del2f: {
            x     = Mathf.Clamp(x, 0.1f, 1.0f);
            del2F = x;
            break;
        }

        case Parameter.Del2t: {
            x     = Mathf.Clamp(x, 10.0f, 2000.0f);
            del2T = x;
            break;
        }

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

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

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

        case Parameter.Qq2: {
            x   = Mathf.Clamp(x, 1.0f, 256.0f);
            qq2 = x;
            break;
        }

        case Parameter.Rootnote: {
            x        = Mathf.Clamp(x, 0.0f, 127.0f);
            rootNote = x;
            break;
        }

        case Parameter.Speed: {
            x     = Mathf.Clamp(x, 0.0f, 4.0f);
            speed = x;
            break;
        }

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

        case Parameter.Synth1a: {
            x       = Mathf.Clamp(x, 10.0f, 10010.0f);
            synth1A = x;
            break;
        }

        case Parameter.Synth1d: {
            x       = Mathf.Clamp(x, 10.0f, 10010.0f);
            synth1D = x;
            break;
        }

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

        case Parameter.Synth1q: {
            x       = Mathf.Clamp(x, 0.0f, 15.0f);
            synth1Q = x;
            break;
        }

        case Parameter.Synth1r: {
            x       = Mathf.Clamp(x, 10.0f, 10010.0f);
            synth1R = x;
            break;
        }

        case Parameter.Synth1s: {
            x       = Mathf.Clamp(x, 0.1f, 1.1f);
            synth1S = x;
            break;
        }

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

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

        case Parameter.Synth2a: {
            x       = Mathf.Clamp(x, 10.0f, 10010.0f);
            synth2A = x;
            break;
        }

        case Parameter.Synth2d: {
            x       = Mathf.Clamp(x, 10.0f, 10010.0f);
            synth2D = x;
            break;
        }

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

        case Parameter.Synth2r: {
            x       = Mathf.Clamp(x, 10.0f, 10010.0f);
            synth2R = x;
            break;
        }

        case Parameter.Synth2s: {
            x       = Mathf.Clamp(x, 0.1f, 1.1f);
            synth2S = x;
            break;
        }

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

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

        case Parameter.Timme1: {
            x      = Mathf.Clamp(x, 10.0f, 10000.0f);
            timme1 = x;
            break;
        }

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

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

        case Parameter.Del1t: return(del1T);

        case Parameter.Del2f: return(del2F);

        case Parameter.Del2t: return(del2T);

        case Parameter.Delay1wet: return(delay1Wet);

        case Parameter.Delay2wet: return(delay2Wet);

        case Parameter.Endd1: return(endd1);

        case Parameter.Qq2: return(qq2);

        case Parameter.Rootnote: return(rootNote);

        case Parameter.Speed: return(speed);

        case Parameter.Startt1: return(startt1);

        case Parameter.Synth1a: return(synth1A);

        case Parameter.Synth1d: return(synth1D);

        case Parameter.Synth1end: return(synth1End);

        case Parameter.Synth1q: return(synth1Q);

        case Parameter.Synth1r: return(synth1R);

        case Parameter.Synth1s: return(synth1S);

        case Parameter.Synth1start: return(synth1Start);

        case Parameter.Synth1vol: return(synth1Vol);

        case Parameter.Synth2a: return(synth2A);

        case Parameter.Synth2d: return(synth2D);

        case Parameter.Synth2octave: return(synth2Octave);

        case Parameter.Synth2r: return(synth2R);

        case Parameter.Synth2s: return(synth2S);

        case Parameter.Synth2volume: return(synth2Volume);

        case Parameter.Synthoctave1: return(synthOctave1);

        case Parameter.Timme1: return(timme1);

        case Parameter.Volume: return(volume);

        default: return(0.0f);
        }
    }