예제 #1
0
    public override void OnInspectorGUI()
    {
        bool isEnabled = _dsp.IsInstantiated();

        if (!isEnabled)
        {
            EditorGUILayout.LabelField("Press Play!", EditorStyles.centeredGreyMiniLabel);
        }
        GUILayout.BeginVertical();
        // EVENTS
        GUI.enabled = isEnabled;
        EditorGUILayout.Space();

        // babang
        if (GUILayout.Button("babang"))
        {
            _dsp.SendEvent(Hv_pedSynths_AudioLib.Event.Babang);
        }
        // PARAMETERS
        GUI.enabled = true;
        EditorGUILayout.Space();
        EditorGUI.indentLevel++;

        // del1F
        GUILayout.BeginHorizontal();
        float del1F    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Del1f);
        float newDel1f = EditorGUILayout.Slider("del1F", del1F, 0.1f, 1.0f);

        if (del1F != newDel1f)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Del1f, newDel1f);
        }
        GUILayout.EndHorizontal();

        // del1T
        GUILayout.BeginHorizontal();
        float del1T    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Del1t);
        float newDel1t = EditorGUILayout.Slider("del1T", del1T, 10.0f, 2000.0f);

        if (del1T != newDel1t)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Del1t, newDel1t);
        }
        GUILayout.EndHorizontal();

        // del2F
        GUILayout.BeginHorizontal();
        float del2F    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Del2f);
        float newDel2f = EditorGUILayout.Slider("del2F", del2F, 0.1f, 1.0f);

        if (del2F != newDel2f)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Del2f, newDel2f);
        }
        GUILayout.EndHorizontal();

        // del2T
        GUILayout.BeginHorizontal();
        float del2T    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Del2t);
        float newDel2t = EditorGUILayout.Slider("del2T", del2T, 10.0f, 2000.0f);

        if (del2T != newDel2t)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Del2t, newDel2t);
        }
        GUILayout.EndHorizontal();

        // delay1Wet
        GUILayout.BeginHorizontal();
        float delay1Wet    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Delay1wet);
        float newDelay1wet = EditorGUILayout.Slider("delay1Wet", delay1Wet, 0.0f, 1.0f);

        if (delay1Wet != newDelay1wet)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Delay1wet, newDelay1wet);
        }
        GUILayout.EndHorizontal();

        // delay2Wet
        GUILayout.BeginHorizontal();
        float delay2Wet    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Delay2wet);
        float newDelay2wet = EditorGUILayout.Slider("delay2Wet", delay2Wet, 0.0f, 1.0f);

        if (delay2Wet != newDelay2wet)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Delay2wet, newDelay2wet);
        }
        GUILayout.EndHorizontal();

        // endd1
        GUILayout.BeginHorizontal();
        float endd1    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Endd1);
        float newEndd1 = EditorGUILayout.Slider("endd1", endd1, 20.0f, 20000.0f);

        if (endd1 != newEndd1)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Endd1, newEndd1);
        }
        GUILayout.EndHorizontal();

        // qq2
        GUILayout.BeginHorizontal();
        float qq2    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Qq2);
        float newQq2 = EditorGUILayout.Slider("qq2", qq2, 1.0f, 256.0f);

        if (qq2 != newQq2)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Qq2, newQq2);
        }
        GUILayout.EndHorizontal();

        // rootNote
        GUILayout.BeginHorizontal();
        float rootNote    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Rootnote);
        float newRootnote = EditorGUILayout.Slider("rootNote", rootNote, 0.0f, 127.0f);

        if (rootNote != newRootnote)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Rootnote, newRootnote);
        }
        GUILayout.EndHorizontal();

        // speed
        GUILayout.BeginHorizontal();
        float speed    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Speed);
        float newSpeed = EditorGUILayout.Slider("speed", speed, 0.0f, 4.0f);

        if (speed != newSpeed)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Speed, newSpeed);
        }
        GUILayout.EndHorizontal();

        // startt1
        GUILayout.BeginHorizontal();
        float startt1    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Startt1);
        float newStartt1 = EditorGUILayout.Slider("startt1", startt1, 20.0f, 20000.0f);

        if (startt1 != newStartt1)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Startt1, newStartt1);
        }
        GUILayout.EndHorizontal();

        // synth1A
        GUILayout.BeginHorizontal();
        float synth1A    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1a);
        float newSynth1a = EditorGUILayout.Slider("synth1A", synth1A, 10.0f, 10010.0f);

        if (synth1A != newSynth1a)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1a, newSynth1a);
        }
        GUILayout.EndHorizontal();

        // synth1D
        GUILayout.BeginHorizontal();
        float synth1D    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1d);
        float newSynth1d = EditorGUILayout.Slider("synth1D", synth1D, 10.0f, 10010.0f);

        if (synth1D != newSynth1d)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1d, newSynth1d);
        }
        GUILayout.EndHorizontal();

        // synth1End
        GUILayout.BeginHorizontal();
        float synth1End    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1end);
        float newSynth1end = EditorGUILayout.Slider("synth1End", synth1End, 20.0f, 20000.0f);

        if (synth1End != newSynth1end)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1end, newSynth1end);
        }
        GUILayout.EndHorizontal();

        // synth1Q
        GUILayout.BeginHorizontal();
        float synth1Q    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1q);
        float newSynth1q = EditorGUILayout.Slider("synth1Q", synth1Q, 0.0f, 15.0f);

        if (synth1Q != newSynth1q)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1q, newSynth1q);
        }
        GUILayout.EndHorizontal();

        // synth1R
        GUILayout.BeginHorizontal();
        float synth1R    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1r);
        float newSynth1r = EditorGUILayout.Slider("synth1R", synth1R, 10.0f, 10010.0f);

        if (synth1R != newSynth1r)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1r, newSynth1r);
        }
        GUILayout.EndHorizontal();

        // synth1S
        GUILayout.BeginHorizontal();
        float synth1S    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1s);
        float newSynth1s = EditorGUILayout.Slider("synth1S", synth1S, 0.1f, 1.1f);

        if (synth1S != newSynth1s)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1s, newSynth1s);
        }
        GUILayout.EndHorizontal();

        // synth1Start
        GUILayout.BeginHorizontal();
        float synth1Start    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1start);
        float newSynth1start = EditorGUILayout.Slider("synth1Start", synth1Start, 20.0f, 20000.0f);

        if (synth1Start != newSynth1start)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1start, newSynth1start);
        }
        GUILayout.EndHorizontal();

        // synth1Vol
        GUILayout.BeginHorizontal();
        float synth1Vol    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1vol);
        float newSynth1vol = EditorGUILayout.Slider("synth1Vol", synth1Vol, 0.0f, 1.0f);

        if (synth1Vol != newSynth1vol)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1vol, newSynth1vol);
        }
        GUILayout.EndHorizontal();

        // synth2A
        GUILayout.BeginHorizontal();
        float synth2A    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2a);
        float newSynth2a = EditorGUILayout.Slider("synth2A", synth2A, 10.0f, 10010.0f);

        if (synth2A != newSynth2a)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2a, newSynth2a);
        }
        GUILayout.EndHorizontal();

        // synth2D
        GUILayout.BeginHorizontal();
        float synth2D    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2d);
        float newSynth2d = EditorGUILayout.Slider("synth2D", synth2D, 10.0f, 10010.0f);

        if (synth2D != newSynth2d)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2d, newSynth2d);
        }
        GUILayout.EndHorizontal();

        // synth2Octave
        GUILayout.BeginHorizontal();
        float synth2Octave    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2octave);
        float newSynth2octave = EditorGUILayout.Slider("synth2Octave", synth2Octave, 0.0f, 2.0f);

        if (synth2Octave != newSynth2octave)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2octave, newSynth2octave);
        }
        GUILayout.EndHorizontal();

        // synth2R
        GUILayout.BeginHorizontal();
        float synth2R    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2r);
        float newSynth2r = EditorGUILayout.Slider("synth2R", synth2R, 10.0f, 10010.0f);

        if (synth2R != newSynth2r)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2r, newSynth2r);
        }
        GUILayout.EndHorizontal();

        // synth2S
        GUILayout.BeginHorizontal();
        float synth2S    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2s);
        float newSynth2s = EditorGUILayout.Slider("synth2S", synth2S, 0.1f, 1.1f);

        if (synth2S != newSynth2s)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2s, newSynth2s);
        }
        GUILayout.EndHorizontal();

        // synth2Volume
        GUILayout.BeginHorizontal();
        float synth2Volume    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2volume);
        float newSynth2volume = EditorGUILayout.Slider("synth2Volume", synth2Volume, 0.0f, 1.0f);

        if (synth2Volume != newSynth2volume)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2volume, newSynth2volume);
        }
        GUILayout.EndHorizontal();

        // synthOctave1
        GUILayout.BeginHorizontal();
        float synthOctave1    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synthoctave1);
        float newSynthoctave1 = EditorGUILayout.Slider("synthOctave1", synthOctave1, 0.0f, 2.0f);

        if (synthOctave1 != newSynthoctave1)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synthoctave1, newSynthoctave1);
        }
        GUILayout.EndHorizontal();

        // timme1
        GUILayout.BeginHorizontal();
        float timme1    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Timme1);
        float newTimme1 = EditorGUILayout.Slider("timme1", timme1, 10.0f, 10000.0f);

        if (timme1 != newTimme1)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Timme1, newTimme1);
        }
        GUILayout.EndHorizontal();

        // volume
        GUILayout.BeginHorizontal();
        float volume    = _dsp.GetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Volume);
        float newVolume = EditorGUILayout.Slider("volume", volume, 0.0f, 1.0f);

        if (volume != newVolume)
        {
            _dsp.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Volume, newVolume);
        }
        GUILayout.EndHorizontal();

        EditorGUI.indentLevel--;



        GUILayout.EndVertical();
    }
예제 #2
0
 // Update is called once per frame
 void Update()
 {
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Del1t, del1T);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Del2f, del2F);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Del2t, del2T);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Del1f, del1F);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Delay1wet, delay1Wet);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Delay2wet, delay2Wet);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Endd1, endd1);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Qq2, qq2);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Rootnote, rootnote);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Speed, speed);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Startt1, startt1);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1a, synth1A);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1d, synth1D);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1end, synth1End);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1q, synth1Q);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1r, synth1R);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1s, synth1S);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1start, synth1Start);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth1vol, synth1Vol);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2a, synth2A);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2d, synth2D);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2octave, synth2Octave);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2r, synth2R);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2s, synth2S);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synth2volume, synth2Volume);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Synthoctave1, synthOctave1);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Timme1, timme1);
     lib.SetFloatParameter(Hv_pedSynths_AudioLib.Parameter.Volume, volume);
 }