示例#1
0
        public void SynthParameters(MidiPlayer instance, SerializedObject sobject)
        {
            showSynthParameter = EditorGUILayout.Foldout(showSynthParameter, "Show Synth Parameters");
            if (showSynthParameter)
            {
                //EditorGUILayout.BeginHorizontal();
                //EditorGUILayout.PrefixLabel(new GUIContent("Cutoff Volume", "Level of volume when the sound is cut. Could be usefull on weak device to rise this value, but sound experience is less good. "));
                //instance.CutoffVolume = EditorGUILayout.Slider((float)instance.CutoffVolume*1000f, 0.1f, 5f)/1000f;
                //EditorGUILayout.EndHorizontal();

                instance.MPTK_PlayOnlyFirstWave = EditorGUILayout.Toggle(new GUIContent("Play Only First Wave", "Some Instrument in Preset are using more of one wave at the same time. If checked, play only the first wave, usefull on weak device, but sound experience is less good."), instance.MPTK_PlayOnlyFirstWave);
                instance.MPTK_WeakDevice        = EditorGUILayout.Toggle(new GUIContent("Weak Device", "Playing Midi files with WeakDevice activated could cause some bad interpretation of Midi Event, consequently bad sound."), instance.MPTK_WeakDevice);
                instance.MPTK_EnablePanChange   = EditorGUILayout.Toggle(new GUIContent("Pan Change", "Enable midi event pan change when playing. Uncheck if you want to manage Pan in your application."), instance.MPTK_EnablePanChange);

                instance.MPTK_ApplyRealTimeModulator = EditorGUILayout.Toggle(new GUIContent("Apply Modulator", "Real-Time change Modulator from Midi and ADSR enveloppe Modulator parameters from SoundFont could have an impact on CPU. Initial value of Modulator set at Note On are keep. Uncheck to gain some % CPU on weak device."), instance.MPTK_ApplyRealTimeModulator);
                instance.MPTK_ApplyModLfo            = EditorGUILayout.Toggle(new GUIContent("Apply Mod LFO", "LFO modulation are defined in SoudFont. Uncheck to gain some % CPU on weak device."), instance.MPTK_ApplyModLfo);
                instance.MPTK_ApplyVibLfo            = EditorGUILayout.Toggle(new GUIContent("Apply Vib LFO", "LFO vibrato are defined in SoudFont. Uncheck to gain some % CPU on weak device."), instance.MPTK_ApplyVibLfo);

                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PrefixLabel(new GUIContent("Release Time Minimum", "A default release time is defined at the preset level in the SoundFont. Setting a minimum time (milliseconds) to avoid abrupt sound stop and remove unpleasant sound. 50ms is a good tradoff for most of the case."));
                instance.MPTK_ReleaseTimeMin = EditorGUILayout.Slider(instance.MPTK_ReleaseTimeMin, 0f, 500f);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.Space();
                instance.MPTK_ApplyFilter = EditorGUILayout.Toggle(new GUIContent("Apply Filter", "Low pass filter is defined in each preset of the SoudFont. Uncheck to gain some % CPU on weak device."), instance.MPTK_ApplyFilter);
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PrefixLabel(new GUIContent("Offset Filter Freq.", "Offset on the SF frequency set for this preset. 1000 seems a good value with the Unity filter ..."));
                instance.FilterOffset = EditorGUILayout.Slider(instance.FilterOffset, -2000f, 3000f);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.Space();
                instance.MPTK_ApplyReverb = EditorGUILayout.Toggle(new GUIContent("Apply Reverb", "Reverb is defined in each preset of the SoudFont."), instance.MPTK_ApplyReverb);
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PrefixLabel(new GUIContent("Supersede Reverb", "If greater than 0, this parameter supersedes the value found in SF. 0:low dry signal 1: high dry signal"));
                instance.ReverbMix = EditorGUILayout.Slider(instance.ReverbMix, 0f, 1f);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.Space();
                instance.MPTK_ApplyChorus = EditorGUILayout.Toggle(new GUIContent("Apply Chorus", "Chorus is defined in each preset of the SoudFont."), instance.MPTK_ApplyChorus);
                EditorGUILayout.BeginHorizontal();
                EditorGUILayout.PrefixLabel(new GUIContent("Supersede Chorus", "If greater than 0, this parameter supersedes the value found in SF. 0:low original signal 1: high original signal"));
                instance.ChorusMix = EditorGUILayout.Slider(instance.ChorusMix, 0f, 1f);
                EditorGUILayout.EndHorizontal();

                EditorGUILayout.Space();
                instance.MPTK_LogWave = EditorGUILayout.Toggle(new GUIContent("Log Waves", "Log information about wave found for a NoteOn event."), instance.MPTK_LogWave);
                EditorGUILayout.Space();

                EditorGUI.indentLevel++;
                showSynthEvents = EditorGUILayout.Foldout(showSynthEvents, "Show Synth Events");
                if (showSynthEvents)
                {
                    if (CustomEventSynthAwake == null)
                    {
                        CustomEventSynthAwake = sobject.FindProperty("OnEventSynthAwake");
                    }
                    EditorGUILayout.PropertyField(CustomEventSynthAwake);

                    if (CustomEventSynthStarted == null)
                    {
                        CustomEventSynthStarted = sobject.FindProperty("OnEventSynthStarted");
                    }
                    EditorGUILayout.PropertyField(CustomEventSynthStarted);

                    sobject.ApplyModifiedProperties();
                }
                EditorGUI.indentLevel--;
            }
        }