private void OnPressedPlay()
 {
     if (MidiPlayer.IsPlaying)
     {
         MidiPlayer.Stop();
     }
     else
     {
         MidiPlayer.ContinuePlay();
     }
 }
        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            if (GUILayout.Button("Play"))
            {
                if (target is MidiAsset midiAsset)
                {
                    //using (var outputDevice = OutputDevice.GetById(0))
                    //using(var playback = midiAsset.MidiFile.GetPlayback(outputDevice))
                    //{
                    //    playback.Play();
                    //}
                    MidiPlayer.Play(midiAsset.MidiFile);
                }
            }
        }
 public void Play()
 {
     //Debug.Log("Play L: "+encodedMidi.Length);
     //DebugTask();
     MidiPlayer.Play(MuseDecoder.DecodeMuseEncoding(EncodedMidi));
 }
 public void Update()
 {
     playSlider.SetValueWithoutNotify(MidiPlayer.Progress);
     timeLabel.text  = MidiPlayer.GetPlayString();
     playButton.text = MidiPlayer.IsPlaying ? "Stop" : "Play";
 }