Пример #1
0
        public void AllPrefab(MidiSynth instance)
        {
            float volume = EditorGUILayout.Slider(new GUIContent("Volume", "Set global volume for this midi playing"), instance.MPTK_Volume, 0f, 1f);

            if (instance.MPTK_Volume != volume)
            {
                instance.MPTK_Volume = volume;
            }
            EditorGUILayout.BeginHorizontal();
            string tooltipDistance = "Playing is paused if distance between AudioListener and this component is greater than MaxDistance";

            instance.MPTK_PauseOnDistance = EditorGUILayout.Toggle(new GUIContent("Pause With Distance", tooltipDistance), instance.MPTK_PauseOnDistance);
            //Debug.Log("Camera: " + instance.distanceEditorModeOnly);
            EditorGUILayout.LabelField(new GUIContent("Current:" + Math.Round(instance.distanceToListener, 2), tooltipDistance));
            EditorGUILayout.EndHorizontal();

            float distance = EditorGUILayout.Slider(new GUIContent("Max Distance", tooltipDistance), instance.MPTK_MaxDistance, 0f, 500f);

            if (instance.MPTK_MaxDistance != distance)
            {
                instance.MPTK_MaxDistance = distance;
            }

            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Transpose");
            instance.MPTK_Transpose = EditorGUILayout.IntSlider(instance.MPTK_Transpose, -24, 24);
            EditorGUILayout.EndHorizontal();
        }
Пример #2
0
 public int count;     // count of noteon for the channel
 //private int channum;
 //private MidiSynth synth;
 public mptk_channel(MidiSynth psynth, int pchanum)
 {
     //synth = psynth;
     //channum = pchanum;
     enabled = true;
     volume  = 1f;
     count   = 0;
 }
Пример #3
0
        public void AllPrefab(MidiSynth instance)
        {
            float volume = EditorGUILayout.Slider(new GUIContent("Volume", "Set global volume for this midi playing"), instance.MPTK_Volume, 0f, 1f);

            if (instance.MPTK_Volume != volume)
            {
                instance.MPTK_Volume = volume;
            }



            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Transpose");
            instance.MPTK_Transpose = EditorGUILayout.IntSlider(instance.MPTK_Transpose, -24, 24);
            EditorGUILayout.EndHorizontal();
            //Debug.Log(instance.GetType());
            string foldoutTitle = $"Show Spatialization Parameters - {instance.MPTK_Spatialize} {Math.Round(instance.distanceToListener, 2)}/{instance.MPTK_MaxDistance}";

            instance.showSpatialization = DrawFoldoutAndHelp(instance.showSpatialization, foldoutTitle, "https://paxstellar.fr/midi-file-player-detailed-view-2/#Foldout-Spatialization-Parameters");
            if (instance.showSpatialization)
            {
                EditorGUI.indentLevel++;
                GUIContent labelSpatialization = new GUIContent("Spatialization", "Enable spatialization effect");
#if MPTK_PRO
                if (!(instance is MidiSpatializer))
                {
#endif
                bool spatialize = EditorGUILayout.Toggle(labelSpatialization, instance.MPTK_Spatialize);
                if (instance.MPTK_Spatialize != spatialize)
                {
                    instance.MPTK_Spatialize = spatialize;
                }
#if MPTK_PRO
            }
            else
            {
                // Need to be forced to true, here to check.
                EditorGUILayout.LabelField(labelSpatialization, new GUIContent(instance.MPTK_Spatialize ? "True" : "False"));
            }
#endif

                //EditorGUILayout.BeginHorizontal();
                string tooltipDistance = "Playing is paused if distance between AudioListener and this component is greater than MaxDistance";
                float distance         = EditorGUILayout.IntField(new GUIContent("Max Distance", tooltipDistance), (int)instance.MPTK_MaxDistance);
                if (instance.MPTK_MaxDistance != distance)
                {
                    instance.MPTK_MaxDistance = distance;
                }

                //Debug.Log("Camera: " + instance.distanceEditorModeOnly);
                EditorGUILayout.LabelField(new GUIContent($"Current distance to Camera: {Math.Round(instance.distanceToListener, 2)}", tooltipDistance));
                //EditorGUILayout.EndHorizontal();

                EditorGUI.indentLevel--;
            }
        }
Пример #4
0
        public fluid_channel(MidiSynth psynth, int pchanum)
        {
            gens    = new double[Enum.GetNames(typeof(fluid_gen_type)).Length];
            gen_abs = new bool[Enum.GetNames(typeof(fluid_gen_type)).Length];
            cc      = new short[128];

            synth   = psynth;
            channum = pchanum;
            preset  = null;
            tuning  = null;

            fluid_channel_init();
            fluid_channel_init_ctrl();
        }
Пример #5
0
        public void AllPrefab(MidiSynth instance)
        {
            float volume = EditorGUILayout.Slider(new GUIContent("Volume", "Set global volume for this midi playing"), instance.MPTK_Volume, 0f, 1f);

            if (instance.MPTK_Volume != volume)
            {
                instance.MPTK_Volume = volume;
            }



            EditorGUILayout.BeginHorizontal();
            EditorGUILayout.PrefixLabel("Transpose");
            instance.MPTK_Transpose = EditorGUILayout.IntSlider(instance.MPTK_Transpose, -24, 24);
            EditorGUILayout.EndHorizontal();

            instance.showSpatialization = DrawFoldoutAndHelp(instance.showSpatialization, "Show Spatialization Parameters", "https://paxstellar.fr/midi-file-player-detailed-view-2/#Foldout-Spatialization-Parameters");
            if (instance.showSpatialization)
            {
                EditorGUI.indentLevel++;

                //EditorGUILayout.BeginHorizontal();
                string tooltipspatialize = "";
                bool   spatialize        = EditorGUILayout.Toggle(new GUIContent("Spatialization", tooltipspatialize), instance.MPTK_Spatialize);
                if (instance.MPTK_Spatialize != spatialize)
                {
                    instance.MPTK_Spatialize = spatialize;
                }

                //EditorGUILayout.EndHorizontal();

                string tooltipDistance = "Playing is paused if distance between AudioListener and this component is greater than MaxDistance";
                float  distance        = EditorGUILayout.Slider(new GUIContent("Max Distance", tooltipDistance), instance.MPTK_MaxDistance, 0f, 500f);
                if (instance.MPTK_MaxDistance != distance)
                {
                    instance.MPTK_MaxDistance = distance;
                }

                //Debug.Log("Camera: " + instance.distanceEditorModeOnly);
                EditorGUILayout.LabelField(new GUIContent($"Current distance to Camera: {Math.Round(instance.distanceToListener, 2)}", tooltipDistance));

                EditorGUI.indentLevel--;
            }
        }
Пример #6
0
        //static public float _ratioHalfTone = 0.0594630943592952645618252949463f;

        static public void DisplayInfoSynth(MidiSynth synth, int width, CustomStyle myStyle)
        {
            string info;

            GUILayout.BeginHorizontal(GUILayout.Width(width));
            GUILayout.Label("Synthesizer statistics", myStyle.TitleLabel3, GUILayout.Width(150));
            if (GUILayout.Button("Reset Stat", GUILayout.Width(100)))
            {
                synth.MPTK_ResetStat();
            }
            GUILayout.EndHorizontal();
            info  = string.Format("Mode:\t{0}\tRate:{1}\tBuffer:{2}\tDSP:{3,-5:F2} ms\n", synth.MPTK_CorePlayer ? "Core" : "AudioSource", synth.OutputRate, synth.DspBufferSize, Math.Round(synth.StatDeltaAudioFilterReadMS, 2));
            info += string.Format("Voice:\tPlayed:{0,-4}\tFree:{1,-4}\tActive:{2,-4}\tReused:{3} %\n",
                                  synth.MPTK_StatVoicePlayed, synth.MPTK_StatVoiceCountFree,
                                  synth.MPTK_StatVoiceCountActive, Mathf.RoundToInt(synth.MPTK_StatVoiceRatioReused));

#if DEBUG_STATUS_STAT
            if (synth.StatusStat != null && synth.StatusStat.Length >= (int)fluid_voice_status.FLUID_VOICE_OFF + 2)
            {
                info += string.Format("\t\tSustain:{0,-4}\tRelease:{1,-4}\n\n",
                                      synth.StatusStat[(int)fluid_voice_status.FLUID_VOICE_SUSTAINED],
                                      synth.StatusStat[(int)fluid_voice_status.FLUID_VOICE_OFF + 1]
                                      );
            }
#endif
            if (synth.StatAudioFilterReadMA != null)
            {
                info += string.Format("Stat Synth:\tSample:{0,-5:F2} ms\tMini:{1,-5:F2}\tMaxi:{2,-5:F2}\tAvg:{3,-5:F2}\n",
                                      Math.Round(synth.StatAudioFilterReadMS, 2),
                                      synth.StatAudioFilterReadMIN < double.MaxValue ? Math.Round(synth.StatAudioFilterReadMIN, 2) : 0,
                                      Math.Round(synth.StatAudioFilterReadMAX, 2),
                                      Math.Round(synth.StatAudioFilterReadAVG, 2));
            }

            if (synth.StatDspLoadMAX != 0f)
            {
                info += string.Format("\tLoad:{0} %\tMini:{1,-5:F2}\tMaxi:{2,-5:F2}\tAvg:{3,-5:F2}",//\tLong Avg:{3,-5:F2}",
                                      Math.Round(synth.StatDspLoadPCT, 2),
                                      Math.Round(synth.StatDspLoadMIN, 2),
                                      Math.Round(synth.StatDspLoadMAX, 2),
                                      Math.Round(synth.StatDspLoadAVG, 2));
            }
            //Math.Round(synth.StatDspLoadLongAVG, 1));
            else
            {
                info += string.Format("\tDSP Load:{0} % ", Math.Round(synth.StatDspLoadPCT, 1));
            }

            if (synth.StatDspLoadPCT >= 100f)
            {
                info += string.Format("\n\t<color=red>\tDSP Load over 100%</color>");
            }
            else if (synth.StatDspLoadPCT >= synth.MaxDspLoad)
            {
                info += string.Format("\n\t<color=orange>\tDSP Load over {0}%</color>", synth.MaxDspLoad);
            }
            else
            {
                info += "\n";
            }

            // Available only when a file Midi reader is enabled
            if (synth.StatDeltaThreadMidiMA != null && synth.StatDeltaThreadMidiMIN < double.MaxValue)
            {
                info += string.Format("\nStat Sequencer:\tDelta:{0,-5:F2} ms\tMini:{1,-5:F2}\tMaxi:{2,-5:F2}\tAvg:{3,-5:F2}\n",
                                      Math.Round(synth.StatDeltaThreadMidiMS, 2),
                                      synth.StatDeltaThreadMidiMIN < double.MaxValue ? Math.Round(synth.StatDeltaThreadMidiMIN, 2) : 0,
                                      Math.Round(synth.StatDeltaThreadMidiMAX, 2),
                                      Math.Round(synth.StatDeltaThreadMidiAVG, 2));
                info += string.Format("\tRead:{0,-5:F2} ms\tTreat:{1,-5:F2}\tMaxi:{2,-5:F2}",
                                      Math.Round(synth.StatReadMidiMS, 2),
                                      Math.Round(synth.StatProcessMidiMS, 2),
                                      Math.Round(synth.StatProcessMidiMAX, 2));
            }

            //#if !UNITY_ANDROID
            //#endif
            GUILayout.Label(info, myStyle.TextFieldMultiCourier);
        }
Пример #7
0
        public void SynthParameters(MidiSynth instance, SerializedObject sobject)
        {
            instance.showSynthParameter = DrawFoldoutAndHelp(instance.showSynthParameter, "Show Synth Parameters", "https://paxstellar.fr/midi-file-player-detailed-view-2/#Foldout-Synth-Parameters");
            if (instance.showSynthParameter)
            {
                EditorGUI.indentLevel++;

                GUIContent labelCore   = new GUIContent("Core Player", "Play music with a non Unity thread. Change this properties only when not running");
                string     labelRate   = "Rate Synth Output";
                string     labelBuffer = "Buffer Synth Size";
                instance.showUnitySynthParameter = DrawFoldoutAndHelp(instance.showUnitySynthParameter, "Show Unity Audio Parameters", "https://paxstellar.fr/midi-file-player-detailed-view-2/#Foldout-Audio-Parameters");
                if (instance.showUnitySynthParameter)
                {
                    EditorGUI.indentLevel++;
                    if (myStyle == null)
                    {
                        myStyle = new CustomStyle();
                    }
                    EditorGUILayout.LabelField("With Core Player checked (fluidsynth mode), the synthesizer is working on a thread apart from the main Unity thread. Accuracy is much better. The legacy mode which is using many AudioSource will be removed with the next major version.", myStyle.LabelGreen);
                    if (!EditorApplication.isPlaying)
                    {
                        instance.MPTK_CorePlayer = EditorGUILayout.Toggle(labelCore, instance.MPTK_CorePlayer);
                    }
                    else
                    {
                        EditorGUILayout.LabelField(labelCore, new GUIContent(instance.MPTK_CorePlayer ? "True" : "False"));
                    }

                    if (NoErrorValidator.CantChangeAudioConfiguration)
                    {
                        EditorGUILayout.LabelField("Warning: Audio configuration change is disabled on this platform.", myStyle.LabelAlert);
                    }
                    else if (instance.MPTK_CorePlayer)
                    {
                        EditorGUILayout.Space();
                        EditorGUILayout.LabelField("Changing synthesizer rate and buffer size can produce unexpected effect according to the hardware. Save your work before!", myStyle.LabelGreen);
                        EditorGUILayout.Space();
                        if (!EditorApplication.isPlaying)
                        {
                            EditorGUILayout.LabelField("Increase the rate to get a better sound.", myStyle.LabelGreen);
                            synthRateLabel[0] = "Default: " + AudioSettings.outputSampleRate + " Hz";
                            int indexrate = EditorGUILayout.IntPopup(labelRate, instance.MPTK_IndexSynthRate, synthRateLabel, synthRateIndex);
                            if (indexrate != instance.MPTK_IndexSynthRate)
                            {
                                instance.MPTK_IndexSynthRate = indexrate;
                            }
                            EditorGUILayout.Space();
                        }
                        else
                        {
                            EditorGUILayout.LabelField(labelRate, instance.OutputRate.ToString());
                        }

                        if (!EditorApplication.isPlaying)
                        {
                            EditorGUILayout.LabelField("Decrease the buffer size to get a more accurate playing.", myStyle.LabelGreen);
                            int bufferLenght;
                            int numBuffers;
                            AudioSettings.GetDSPBufferSize(out bufferLenght, out numBuffers);
                            synthBufferSizeLabel[0] = "Default: " + bufferLenght;
                            int indexBuffSize = EditorGUILayout.IntPopup(labelBuffer, instance.MPTK_IndexSynthBuffSize, synthBufferSizeLabel, synthBufferSizeIndex);
                            if (indexBuffSize != instance.MPTK_IndexSynthBuffSize)
                            {
                                instance.MPTK_IndexSynthBuffSize = indexBuffSize;
                            }
                            EditorGUILayout.Space();
                        }
                        else
                        {
                            EditorGUILayout.LabelField(labelBuffer, instance.DspBufferSize.ToString());
                        }

                        EditorGUILayout.Space();
                        EditorGUILayout.LabelField("Interpolation is the core of the synth process. Linear is a good balacing between quality and performance", myStyle.LabelGreen);
                        instance.InterpolationMethod = (fluid_interp)EditorGUILayout.IntPopup("Interpolation Method", (int)instance.InterpolationMethod, synthInterpolationLabel, synthInterpolationIndex);
                    }
                    else
                    {
                        EditorGUILayout.LabelField("Warning: with non core mode, all voices will be played in separate Audio Source. SoundFont synth is not fully implemented. This mode will be removed with a future version.", myStyle.LabelAlert);
                    }

                    EditorGUI.indentLevel--;
                }

                instance.MPTK_LogWave = EditorGUILayout.Toggle(new GUIContent("Log Samples", "Log information about sample played for a NoteOn event."), instance.MPTK_LogWave);

                //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);

                instance.showSoundFontEffect = MidiCommonEditor.DrawFoldoutAndHelp(instance.showSoundFontEffect, "Show SoundFont Effect Parameters", "https://paxstellar.fr/midi-file-player-detailed-view-2/#Foldout-SoundFont-Effects");
                if (instance.showSoundFontEffect)
#if MPTK_PRO
                { CommonProEditor.EffectSoundFontParameters(instance, myStyle); }
#else
                {
                    EditorGUI.indentLevel++;
                    EditorGUILayout.LabelField("[Available with MPTK Pro] These effects will be applied independently on each voices. Effects values are defined in the SoundFont, so limited modification can't be applied.", myStyle.LabelGreen);
                    EditorGUI.indentLevel--;
                }
#endif

                instance.showUnitySynthEffect = MidiCommonEditor.DrawFoldoutAndHelp(instance.showUnitySynthEffect, "Show Unity Effect Parameters", "https://paxstellar.fr/midi-file-player-detailed-view-2/#Foldout-Unity-Effects");
                if (instance.showUnitySynthEffect)
#if MPTK_PRO
                { CommonProEditor.EffectUnityParameters(instance, myStyle); }
#else
                {
                    EditorGUI.indentLevel++;
                    EditorGUILayout.LabelField("[Available with MPTK Pro] These effects will be applied to all voices processed by the current MPTK gameObject. You can add multiple MPTK gameObjects to apply for different effects.", myStyle.LabelGreen);
                    EditorGUI.indentLevel--;
                }
#endif
                instance.showUnityPerformanceParameter = DrawFoldoutAndHelp(instance.showUnityPerformanceParameter, "Show Performance Parameters", "https://paxstellar.fr/midi-file-player-detailed-view-2/#Foldout-Performance");
                if (instance.showUnityPerformanceParameter)
                {
                    EditorGUI.indentLevel++;
                    instance.waitThreadMidi    = EditorGUILayout.IntSlider(new GUIContent("Thread Midi Delay", "Delay in milliseconds between call to the midi sequencer"), instance.waitThreadMidi, 1, 30);
                    instance.MaxDspLoad        = EditorGUILayout.IntSlider(new GUIContent("Max Level DSP Load", "When DSP is over the 'Max Level DSP Load' (by default 50%), some actions are taken on current playing voices for better performance"), (int)instance.MaxDspLoad, 0, 100);
                    instance.DevicePerformance = EditorGUILayout.IntSlider(new GUIContent("Device Performance", "Define amount of cleaning of the voice. 1 for weak device and high cleaning. If <=25 some voice could be stopped."), instance.DevicePerformance, 1, 100);
                    EditorGUI.indentLevel--;
                }

                instance.showSynthEvents = MidiCommonEditor.DrawFoldoutAndHelp(instance.showSynthEvents, "Show Synth Unity Events", "https://paxstellar.fr/midi-file-player-detailed-view-2/#Foldout-Synth-Unity-Events");
                if (instance.showSynthEvents)
                {
                    EditorGUI.indentLevel++;
                    if (CustomEventSynthAwake == null)
                    {
                        CustomEventSynthAwake = sobject.FindProperty("OnEventSynthAwake");
                    }
                    EditorGUILayout.PropertyField(CustomEventSynthAwake);

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

                    sobject.ApplyModifiedProperties();
                    EditorGUI.indentLevel--;
                }
                EditorGUI.indentLevel--;
            }
        }
Пример #8
0
        public void SynthParameters(MidiSynth instance, SerializedObject sobject)
        {
            showSynthParameter = EditorGUILayout.Foldout(showSynthParameter, "Show Synth Parameters");
            if (showSynthParameter)
            {
                EditorGUI.indentLevel++;

                //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();

                GUIContent labelCore = new GUIContent("Core Player", "Play music with a non Unity thread. Change this properties only when not running");
                if (!EditorApplication.isPlaying)
                {
                    instance.MPTK_CorePlayer = EditorGUILayout.Toggle(labelCore, instance.MPTK_CorePlayer);
                }
                else
                {
                    EditorGUILayout.LabelField(labelCore, new GUIContent(instance.MPTK_CorePlayer ? "True" : "False"));
                }

                showUnitySynthParameter = EditorGUILayout.Foldout(showUnitySynthParameter, "Show Unity Audio Parameters");
                if (showUnitySynthParameter)
                {
                    EditorGUI.indentLevel++;
                    if (myStyle == null)
                    {
                        myStyle = new CustomStyle();
                    }
                    EditorGUILayout.LabelField("Changing synth rate and buffer size can produce unexpected effect according to the hardware. Save your work before!", myStyle.LabelAlert);

                    synthRateLabel[0] = "Default: " + AudioSettings.outputSampleRate + " Hz";
                    int indexrate = EditorGUILayout.IntPopup("Rate Synth Output", instance.MPTK_IndexSynthRate, synthRateLabel, synthRateIndex);
                    if (indexrate != instance.MPTK_IndexSynthRate)
                    {
                        instance.MPTK_IndexSynthRate = indexrate;
                    }

                    int bufferLenght;
                    int numBuffers;
                    AudioSettings.GetDSPBufferSize(out bufferLenght, out numBuffers);
                    synthBufferSizeLabel[0] = "Default: " + bufferLenght;
                    int indexBuffSize = EditorGUILayout.IntPopup("Buffer Synth Size", instance.MPTK_IndexSynthBuffSize, synthBufferSizeLabel, synthBufferSizeIndex);
                    if (indexBuffSize != instance.MPTK_IndexSynthBuffSize)
                    {
                        instance.MPTK_IndexSynthBuffSize = indexBuffSize;
                    }
                    EditorGUI.indentLevel--;
                }

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

                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 (100 nano seconds) to avoid abrupt sound stop and remove unpleasant sound. 50ms is a good tradoff for most of the case."));
                //instance.MPTK_ReleaseTimeMin = (uint)EditorGUILayout.IntSlider((int)instance.MPTK_ReleaseTimeMin, 0, 5000000);
                //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();

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

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

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