Forum

    • Register
    • Login
    • Search
    • Categories

    MidiPlayer ClearSequences?

    Scripting Forum
    6
    16
    254
    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.
    • iamlamprey
      iamlamprey 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

      Music - Instruments

      ustk 1 Reply Last reply Reply Quote 0
      • ustk
        ustk @iamlamprey last edited by

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

        I cannot help pressing F5 in the forum...
        Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

        iamlamprey 1 Reply Last reply Reply Quote 0
        • iamlamprey
          iamlamprey @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

          Music - Instruments

          ustk 1 Reply Last reply Reply Quote 0
          • ustk
            ustk @iamlamprey 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...

            I cannot help pressing F5 in the forum...
            Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

            1 Reply Last reply Reply Quote 0
            • d.healey
              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 😛

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

              1 Reply Last reply Reply Quote 0
              • iamlamprey
                iamlamprey 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.

                Music - Instruments

                1 Reply Last reply Reply Quote 0
                • iamlamprey
                  iamlamprey 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

                  https://i.gyazo.com/ffde183b01f39f14669b298a21d23478.mp4

                  @Christoph-Hart Master I summon thee 🙂

                  Music - Instruments

                  1 Reply Last reply Reply Quote 1
                  • Dan Korneff
                    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 Korneff
                      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

                      DimitrisSP 1 Reply Last reply Reply Quote 0
                      • DimitrisSP
                        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 Korneff
                          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

                          DimitrisSP 1 Reply Last reply Reply Quote 0
                          • DimitrisSP
                            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 Korneff 1 Reply Last reply Reply Quote 1
                            • Dan Korneff
                              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 Korneff
                                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

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

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

                                  Hise Develop branch
                                  MacOs 13, Xcode 14.0.1
                                  http://musikboden.se

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

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

                                    Hise Develop branch
                                    MacOs 13, Xcode 14.0.1
                                    http://musikboden.se

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

                                    12
                                    Online

                                    977
                                    Users

                                    6.6k
                                    Topics

                                    60.5k
                                    Posts