public override void OnInspectorGUI()
    {
        bool isEnabled = _dsp.IsInstantiated();

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

        // OnOff_trigger
        if (GUILayout.Button("OnOff_trigger"))
        {
            _dsp.SendEvent(Hv_BoidSynth06_Sine_AudioLib.Event.Onoff_trigger);
        }

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

        // freq
        GUILayout.BeginHorizontal();
        float freq    = _dsp.GetFloatParameter(Hv_BoidSynth06_Sine_AudioLib.Parameter.Freq);
        float newFreq = EditorGUILayout.Slider("freq", freq, 50.0f, 2000.0f);

        if (freq != newFreq)
        {
            _dsp.SetFloatParameter(Hv_BoidSynth06_Sine_AudioLib.Parameter.Freq, newFreq);
        }
        GUILayout.EndHorizontal();

        // gain
        GUILayout.BeginHorizontal();
        float gain    = _dsp.GetFloatParameter(Hv_BoidSynth06_Sine_AudioLib.Parameter.Gain);
        float newGain = EditorGUILayout.Slider("gain", gain, 0.0f, 1.0f);

        if (gain != newGain)
        {
            _dsp.SetFloatParameter(Hv_BoidSynth06_Sine_AudioLib.Parameter.Gain, newGain);
        }
        GUILayout.EndHorizontal();

        // gainSmoothTime
        GUILayout.BeginHorizontal();
        float gainSmoothTime    = _dsp.GetFloatParameter(Hv_BoidSynth06_Sine_AudioLib.Parameter.Gainsmoothtime);
        float newGainsmoothtime = EditorGUILayout.Slider("gainSmoothTime", gainSmoothTime, 1.0f, 1000.0f);

        if (gainSmoothTime != newGainsmoothtime)
        {
            _dsp.SetFloatParameter(Hv_BoidSynth06_Sine_AudioLib.Parameter.Gainsmoothtime, newGainsmoothtime);
        }
        GUILayout.EndHorizontal();

        // mstrAttackRelease
        GUILayout.BeginHorizontal();
        float mstrAttackRelease    = _dsp.GetFloatParameter(Hv_BoidSynth06_Sine_AudioLib.Parameter.Mstrattackrelease);
        float newMstrattackrelease = EditorGUILayout.Slider("mstrAttackRelease", mstrAttackRelease, 1.0f, 1000.0f);

        if (mstrAttackRelease != newMstrattackrelease)
        {
            _dsp.SetFloatParameter(Hv_BoidSynth06_Sine_AudioLib.Parameter.Mstrattackrelease, newMstrattackrelease);
        }
        GUILayout.EndHorizontal();

        // pan
        GUILayout.BeginHorizontal();
        float pan    = _dsp.GetFloatParameter(Hv_BoidSynth06_Sine_AudioLib.Parameter.Pan);
        float newPan = EditorGUILayout.Slider("pan", pan, 0.0f, 100.0f);

        if (pan != newPan)
        {
            _dsp.SetFloatParameter(Hv_BoidSynth06_Sine_AudioLib.Parameter.Pan, newPan);
        }
        GUILayout.EndHorizontal();

        // phase
        GUILayout.BeginHorizontal();
        float phase    = _dsp.GetFloatParameter(Hv_BoidSynth06_Sine_AudioLib.Parameter.Phase);
        float newPhase = EditorGUILayout.Slider("phase", phase, 0.0f, 1.0f);

        if (phase != newPhase)
        {
            _dsp.SetFloatParameter(Hv_BoidSynth06_Sine_AudioLib.Parameter.Phase, newPhase);
        }
        GUILayout.EndHorizontal();

        EditorGUI.indentLevel--;



        GUILayout.EndVertical();
    }
Пример #2
0
 public void NoteToggle()
 {
     synth.SendEvent(Hv_BoidSynth06_Sine_AudioLib.Event.Noteon_trigger);
 }