HISE Logo Forum
    • Categories
    • Register
    • Login

    Creating a MIDI sequence browser/selector for MIDI Player

    Scheduled Pinned Locked Moved General Questions
    19 Posts 5 Posters 1.3k 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.
    • M
      Mwins @ulrik
      last edited by

      @ulrik Thanks for the reply. So I have some strange behavior going on. I am sure I'm on the latest script-node.

      Like you said, it should work if you have MIDI file is loaded into the MIDI Player. Below is a snippet where I have loaded a midi file into the MIDI player 1. I have also set the Engine.addModuleStateToUserPreset on the MIDI player so that it retains the file after closing out.

      The combo box only seems to populate if I have placed the MIDI Files in the project MIDI folder. "getMidiFileList" seems to only work or pull from the project MIDI folder.

      So would the example you gave work on an exported plugin? The MIDI files should be contained within the plugin once exported. Then, how would you obtain the filename for MIDIPlayer1.setFile(var fileName.....

      ulrikU 1 Reply Last reply Reply Quote 0
      • M
        Mwins
        last edited by

        Here is the snippet with the MIDI file loaded directly into the MIDI Player. It's got to be something simple that I am missing

        HiseSnippet 2518.3oc6bssaaajFlxNrIVMNHMn.cuYADL5EJHID5rs2hBKKRIaYcvRhR1RZSQAE4HIZQNCEOHY4h9BruA8t8QXeDVf8oXuq.686l2fcmghThRV0Q0HwqcBctIy++b3a9m+CeyvDWQGIBLLP5TA1p9DM.UfmRyOAZ1msufLjJOGUfGSWGnpgnxLQSvv.HQEHvlGQTFXqGQY+y6NHifh.TDLWDE0YHYQPQYUYy4RqjtfrhRNAIPcYUO8NQ57hHHKRAYgAxlzQnzDDGHzCTVfzsMnoB7EYkjMQ57lBl.Cp.OJCRZBeezX3z9elrgbGE.oQTJd7DMUbNjhDAwDoTr8kUjp3tgMnnBDrx7s+lS29eMcIYI4YxmaFdtshPyGgW6QfMtI3E0K7hr9vKfG38nov6qn4E0k0LmqgfsujNOzDn2U.eD3EVS6K0F+kMnYQ3d.MYTEF.xoiaLaDg2ORjWGJU7nu761N31AwG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gys.+RZdBOTaRkNEabaungvQLwWwalPf4Jd9BcvxoPqfLLWV1Gt7fqa4ougd9t3yOm+W3xtfaBTPUVzv4qr31b4hflfqc+cJJh3580AF8w6skUrLu42c.Q503N2JM44i0sg0JVh4JW4BMWcMxo2BuEwLUKiju0yRtB7X+FgfUAFGMqDIN5t9t1QwJtzvbTTRX.vRaES20U7fMGySbS25r0bdNWmVK5uM0B6rsSGO9+5fSsL0rL8J4ZFzecwqpg6z+3fBPfaO9q+xu7OO3Aq06lxj8Lm2DOzza9e+lrwSoseE2PjGc+S4bshtSEdu472serw.aBlQXXCEvHfh2naCqtcIPZC5ay2DIl+2Dw+ah7+kuIRzO69lHwVuuIBdstO+MQ9j9cfi4+Nv9uC7mR+SivmDnOIv2KIv39j.8IA5SB7NgDXbeRf22IAF2mDnOIPeRf9j.+rhDXBeRf9j.8IAdmPBLgOIv66j.S3SBzmDnOIPeRfeVQBLoOIPeRf9j.uSHAlzmD38cRfI8IA5SBzmDnOIvOqHAlxmDnOIPeRf2Ij.S4SB79NIvT9j.8IA5SBzmD3CXRf2EnTUPTG8ihS+UJGAqOwVBFkP6e8mrEcIR6Py9sHGMcDlHTp3xH+nnHIP3MXK7pGSrawXheKFShawXRdKFSpawX18VLl8twwPpfenkIRcZRRrfJYm5XEvy+Eko9e.8BObHA
        
        ulrikU 1 Reply Last reply Reply Quote 0
        • M
          Mwins
          last edited by Mwins

          Update:

          MIDIPlayer1.setFile(var fileName, bool clearExistingSequences, bool selectNewSequence)
          

          This does infact load the file from the MIDI folder. Thanks @ulrik I actually figured out how to define the file name. However, I am not sure of how it will work once the plugin has been compiled.

          @Christoph-Hart does setSequence in conjunction with getMidiFileList work on files that have been simply dragged into the midi player? I am not able to get this to work. I have several different midi players that will each contain a separate set of midi files. Although "setFile" works to load the file, It's only ideal if you have 1 MIDI player with 1 set of Midi files. I need a solution that will locate only the MIDI files that are contained within a specific MIDI player. It's not ideal for me to select the midi files from the project MIDI folder because I am trying to categorize and group them based on the MIDI player they are in. For example, midi player 1 has flute midi and midi player 2 has bass midi and so on. When the user clicks the combo box, I only want them to be able to select from a list of midi files that are exclusive to the slected MIDI player. Not every MIDI file in my project. I Hope that makes sense. Is there a solution or am I missing something simple?

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

            @Mwins if you Console.print the "list", you can see that it's empty,
            so this line don't get anything

            const var list = MIDIPlayer1.getMidiFileList();
            

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

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

              @Mwins said in Creating a MIDI sequence browser/selector for MIDI Player:

              Update:

              MIDIPlayer1.setFile(var fileName, bool clearExistingSequences, bool selectNewSequence)
              

              This does infact load the file from the MIDI folder. Thanks @ulrik I actually figured out how to define the file name. However, I am not sure of how it will work once the plugin has been compiled.

              It will work just fine in the compiled plugin

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

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

                @Mwins said in Creating a MIDI sequence browser/selector for MIDI Player:
                Then, how would you obtain the filename for MIDIPlayer1.setFile(var fileName.....
                You have to store the midi files names in an array or something,

                this is how I've done it:

                const var DemoSongsArr = ["Bel viso", "Lorda mornar", "Sakkijarven polkka", "Vals i natta", "Miss Karting",
                "La China", "Invention 1", "Kass theme", "Libertango"];
                
                //populating the cmb
                inline function onDemoSongsControl(component, value)
                {
                    DemoSongs.set("items", DemoSongsArr.join("\n"));
                
                if(value < SongInfo.length)
                    {
                // Set the midifile
                        MIDIPlay.setFile("{PROJECT_FOLDER}"+DemoSongsArr[value]+".mid", true, true);
                

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

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

                  @ulrik said in Creating a MIDI sequence browser/selector for MIDI Player:

                  @Mwins said in Creating a MIDI sequence browser/selector for MIDI Player:
                  Then, how would you obtain the filename for MIDIPlayer1.setFile(var fileName.....
                  You have to store the midi files names in an array or something,

                  this is how I've done it:

                  const var DemoSongsArr = ["Bel viso", "Lorda mornar", "Sakkijarven polkka", "Vals i natta", "Miss Karting",
                  "La China", "Invention 1", "Kass theme", "Libertango"];
                  
                  //populating the cmb
                  inline function onDemoSongsControl(component, value)
                  {
                      DemoSongs.set("items", DemoSongsArr.join("\n"));
                  
                  if(value < SongInfo.length)
                      {
                  // Set the midifile
                          MIDIPlay.setFile("{PROJECT_FOLDER}"+DemoSongsArr[value]+".mid", true, true);
                  

                  I have also tried there and given it up for the time being.
                  Do you have a working snippet here?

                  "One hour of trial and error can save 10 minutes of reading the manual."
                  "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                  HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

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

                    @MikeB Here is a working example
                    midiplayer

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

                    1 Reply Last reply Reply Quote 1
                    • MikeBM
                      MikeB
                      last edited by

                      Super - Many thanks for that

                      "One hour of trial and error can save 10 minutes of reading the manual."
                      "It's easier to hit the developer with feature requests than to spend 10 minutes reading the manual. :-)))"
                      HISE Develop - Mac Pro 5.1, OS X 10.14.6, Projucer 6.02, Xcode 10.3

                      1 Reply Last reply Reply Quote 1
                      • Y
                        yall
                        last edited by

                        I just tried the midi player for the first time. i just have a problem with the play and stop buttons. even if I assign them the play button does not work. it does another function. i am using scriptnode version about 1 month ago.

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

                          @yall What kind of reference do you do to the MidiPlayer?
                          There is 2 kind
                          Skärmavbild 2021-05-14 kl. 00.23.22.png

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

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

                            @ulrik I didn't pay attention to 2. but the one I use is simply called the midi player in the midi part of the containers. the one where there is the drag n drop, choice of sequence, play stop rec.

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

                            17

                            Online

                            1.7k

                            Users

                            11.9k

                            Topics

                            103.3k

                            Posts