HISE Logo Forum
    • Categories
    • Register
    • Login

    MidiPlayer ClearSequences?

    Scheduled Pinned Locked Moved Scripting
    16 Posts 6 Posters 959 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      A Former User
      last edited by

      How do I clear sequences from the GUI? I can't get it working connecting a button to the ParameterID, or through generic & typed script references, or using .asMidiPlayer.

      The button itself works fine, but I can't access it from my GUI

      216f35c3-1e81-49df-bd7f-78fcf8e83201-image.png

      ustkU 1 Reply Last reply Reply Quote 0
      • ustkU
        ustk @A Former User
        last edited by

        @iamlamprey Strange, it doesn't seem to work when connected from the property editor either...

        Can't help pressing F5 in the forum...

        ? 1 Reply Last reply Reply Quote 0
        • ?
          A Former User @ustk
          last edited by

          @ustk Yeh exactly, the actual button on the player works as expected, but doesn't seem like the Parameter is publicly accessible or something. I looked at the source and nothing stuck out to me, but who knows

          ustkU 1 Reply Last reply Reply Quote 0
          • ustkU
            ustk @A Former User
            last edited by

            @iamlamprey You can get the attribute list this way

            for (i=0; i<8;i++)
                Console.print(MIDIPlayer1.getAttributeId(i));
            

            But still, MIDIPlayer1.ClearSequences does not work...

            Can't help pressing F5 in the forum...

            1 Reply Last reply Reply Quote 0
            • d.healeyD
              d.healey
              last edited by d.healey

              You might find this useful

              const var MIDIPlayer1 = Synth.getMidiProcessor("MIDI Player1");
              
              const x = MIDIPlayer1.getNumAttributes();
              
              for (i = 0; i < x; i++)
                  Console.print(MIDIPlayer1.getAttributeId(i));
              

              @ustk beat me to it :p

              Libre Wave - Freedom respecting instruments and effects
              My Patreon - HISE tutorials
              YouTube Channel - Public HISE tutorials

              1 Reply Last reply Reply Quote 0
              • ?
                A Former User
                last edited by

                I usually just go to the docs and find the list of parameters there (cause I often have to continually refer back to the docs every 5 seconds anyway 😂 )

                Okay I think we're getting somewhere here.

                The source file has addAttributeID(ClearSequences); inside the MIDIPlayer's undoManager, I wonder if that has something to do with it.

                Now I'm trying to access the Play button (index 1) and getting errors as well. It's like the undoManager somehow privatized the Parameters.

                1 Reply Last reply Reply Quote 0
                • ?
                  A Former User
                  last edited by

                  Okay more discoveries:

                  Connecting a non-momentary button to the "Play" Parameter, instead changes the Sequence number between 0-1.

                  e3a1fb7e-d35a-4e15-aa2d-eec04eba701a-image.png

                  @Christoph-Hart Master I summon thee :)

                  1 Reply Last reply Reply Quote 1
                  • Dan KorneffD
                    Dan Korneff
                    last edited by

                    Running into the same issues. I'm unable to clear sequences, and Parameter Properties seem incorrect.

                    Dan Korneff - Producer / Mixer / Audio Nerd

                    1 Reply Last reply Reply Quote 0
                    • Dan KorneffD
                      Dan Korneff
                      last edited by

                      @Christoph-Hart Any chance you can take a quick look at the midi player? I don't think any of the Parameter Properties are working, which makes it a little difficult to use the player without Play/stop/set sequence/ clear sequence/ etc... 😲

                      Dan Korneff - Producer / Mixer / Audio Nerd

                      DimitrisSPD 1 Reply Last reply Reply Quote 0
                      • DimitrisSPD
                        DimitrisSP @Dan Korneff
                        last edited by

                        @dustbro Play, Stop, getTimeSignature and Drag to DAW works but there are some problems...see this post and if you have the time test the snippet in your system...this way we will be sure if it is a Midi Overlay bug or not
                        https://forum.hise.audio/topic/4656/midi-overlay-panels-in-compiled-plugin-crashing-daws

                        About Drag To DAW it works ok but there are 2 problems...

                        1. If you load a midi and drag n drop to any daw it works like a charm...but if you load another midi after that(or try to drag n drop the same midi for second time) it does not work...I noticed that if you close the interface from the edit button of the daw and load again the instrument you can drag n drop again any loaded midi file...and that story goes on...Or if you try it from Hise plugin in any daw the same thing happens...you can drag n drop any loaded midi file but in order to drag again a second midi file you have to close and open again the (interface preview, or Hit compile and it works...and so on)

                        2. The midi file that is created and dropped to daw is named as temp...
                          Is there a way to have the name of the actual midi file that was loaded?

                        1 Reply Last reply Reply Quote 0
                        • Dan KorneffD
                          Dan Korneff
                          last edited by

                          @DimitrisSP said in MidiPlayer ClearSequences?:

                          Play, Stop, getTimeSignature and Drag to DAW works

                          I can't get them to work from the Property Editor (like above). Some values do nothing, and other values control the wrong parameter.

                          Do you know of a way to clear a sequence via script?

                          Dan Korneff - Producer / Mixer / Audio Nerd

                          DimitrisSPD 1 Reply Last reply Reply Quote 0
                          • DimitrisSPD
                            DimitrisSP @Dan Korneff
                            last edited by

                            @dustbro They will not work from the Property editor...
                            Did you read the post that i mentioned above?
                            You will find a lot of answers there...and load my snippet and test it in your system...you will see that most of the functionality is there and working ok and finaly you will come to the most serious problem that i mention in that post above (the crashing senario) but strangely noone (of the users here not even @Christoph-Hart) was interested about...and in some point anyone who is using a midi overlay panel (for drag to daw or any other functionality) will face it.

                            The part of the code that controls play and stop is that below...

                            //The callback to control playback of the loaded midi file
                            inline function onPlayControl(component, value)
                            {    
                                var position = Engine.getPlayHead().ppqPosition;
                                var last = Engine.getPlayHead().ppqPositionOfLastBarStart;
                                var currentposition = (position - last)/4;  
                                
                                if (Play.getValue())        
                                   {
                                     Player.play(0);
                                     Player.setPlaybackPosition(currentposition);
                                   }
                            	else
                            	   Player.stop(0);
                            };
                            
                            Content.getComponent("Play").setControlCallback(onPlayControl);
                            
                            Dan KorneffD 1 Reply Last reply Reply Quote 1
                            • Dan KorneffD
                              Dan Korneff @DimitrisSP
                              last edited by

                              @DimitrisSP said in MidiPlayer ClearSequences?:

                              Did you read the post that i mentioned above?

                              I did. I'll check out that snip today for any crashes on my rig.
                              Thanks!

                              Dan Korneff - Producer / Mixer / Audio Nerd

                              1 Reply Last reply Reply Quote 1
                              • Dan KorneffD
                                Dan Korneff
                                last edited by

                                Looks like you can use this to clear all sequences

                                MIDIPlayer.setFile("", 1, 1);
                                

                                Dan Korneff - Producer / Mixer / Audio Nerd

                                ulrikU 1 Reply Last reply Reply Quote 2
                                • ulrikU
                                  ulrik @Dan Korneff
                                  last edited by ulrik

                                  @dustbro Good catch! I'll test this now!

                                  Hise Develop branch
                                  MacOs 15.3.1, Xcode 16.2
                                  http://musikboden.se

                                  ulrikU 1 Reply Last reply Reply Quote 0
                                  • ulrikU
                                    ulrik @ulrik
                                    last edited by

                                    @ulrik I just want to confirm that @dustbro example works great for clearing all sequences!

                                    Hise Develop branch
                                    MacOs 15.3.1, Xcode 16.2
                                    http://musikboden.se

                                    1 Reply Last reply Reply Quote 2
                                    • First post
                                      Last post

                                    53

                                    Online

                                    1.7k

                                    Users

                                    11.7k

                                    Topics

                                    101.7k

                                    Posts