HISE Logo Forum
    • Categories
    • Register
    • Login

    Loading Files Into MIDIPlayer via script?? || SOLVED! 🙏

    Scheduled Pinned Locked Moved Solved Scripting
    34 Posts 5 Posters 116 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.
    • ChazroxC
      Chazrox @tsempire
      last edited by Chazrox

      @tsempire Thanks! I just checked it out. I cant tell what you're doing different from my script above. Can you possibly give me some insight if you see what im doing wrong?

      This is what I have now and still not working. Obviously doing wrong.

      const var MIDIPlayer1NOW = Synth.getMidiProcessor("MIDI Player1");
      
      inline function onbtnLoadNewMidiControl(component, value)
      {
          if (!value) return;
         
          local root = FileSystem.Downloads;
         
          FileSystem.browse(root, false, "*.mid;*.midi", function(file)
          {
              
      		MIDIPlayer1NOW.saveAsMidiFile(file, 1);
              
              MIDIPlayer1NOW.setFile(file, true, true);
       
      		//pnlCustomMidiRipView.sendRepaintMessage();
      		//pnlCustomMidiPanel.sendRepaintMessage();
                  
          });
      }
      Content.getComponent("btnLoadNewMidi").setControlCallback(onbtnLoadNewMidiControl);
      
      ulrikU 1 Reply Last reply Reply Quote 0
      • ulrikU
        ulrik @Chazrox
        last edited by

        @Chazrox is this working, you have a semicolon instead of a comma?

        "*.mid;*.midi"
        

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

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

          @ulrik I tried it without it but, its not working...

          What am I doing wrong?

          Screenshot 2025-08-29 at 12.28.23 AM.png

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

            @Chazrox When the user installs your plugin they won't have the project folder, so you don't want to store your files there unless it's for them to be embedded in the plugin. For any files the user should be able to modify you probably want to place them in an app data folder.

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

            ChazroxC 1 Reply Last reply Reply Quote 0
            • ChazroxC
              Chazrox @d.healey
              last edited by Chazrox

              @d-healey I tried this same method with AppData and it didnt go well. It has to be something else. I've been trying for a few hours but I cant seem to find it.

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

                via GIPHY

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

                  @Chazrox said in Save MIDI files to MIDI FOLDER || See code::

                  @d-healey I tried this same method with AppData and it didnt go well. It has to be something else. I've been trying for a few hours but I cant seem to find it.

                  Which issue are you referring to?

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

                  ChazroxC 1 Reply Last reply Reply Quote 0
                  • ChazroxC
                    Chazrox @d.healey
                    last edited by Chazrox

                    @d-healey I cant get the midi files to load into the midi player.

                    inline function onbtnLoadNewMidiControl(component, value)
                    {
                        if (!value) return;
                       
                        local root = FileSystem.MidiFiles;
                    
                        FileSystem.browse(root, false, "*.mid", function(file)
                    
                        {        	
                    		MIDIPlayer1.saveAsMidiFile(file, 1);        
                            MIDIPlayer1.setFile(file, true, true);                           
                        });
                    }
                    Content.getComponent("btnLoadNewMidi").setControlCallback(onbtnLoadNewMidiControl);
                    
                    

                    I've tried .AppData .Downloads and .Documents. I can open the folder and click on the file but loading doesnt execute.

                    Trying to load .mid files from anywhere doesn't work so it has to be the way im reading the file in or something...?

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

                      @Chazrox said in Save MIDI files to MIDI FOLDER || See code::

                      but loading doesnt execute.

                      Do MIDI players have a setFile function?

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

                      ChazroxC 1 Reply Last reply Reply Quote 0
                      • ChazroxC
                        Chazrox @d.healey
                        last edited by

                        @d-healey Screenshot 2025-08-29 at 5.23.00 AM.png

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

                          @Chazrox

                          Show me where MIDIPlayer1 is declared Actually if saveAsMidiFile is working then the declaration must be correct.

                          Minimal snippet time.

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

                          ChazroxC 3 Replies Last reply Reply Quote 1
                          • ChazroxC
                            Chazrox @d.healey
                            last edited by

                            @d-healey Screenshot 2025-08-29 at 5.27.42 AM.png

                            1 Reply Last reply Reply Quote 0
                            • ChazroxC
                              Chazrox @d.healey
                              last edited by

                              @d-healey

                              @d-healey said in Save MIDI files to MIDI FOLDER || See code::

                              Show me where MIDIPlayer1 is declared

                              give me 5 minutes please! brb! 🙏

                              1 Reply Last reply Reply Quote 0
                              • ChazroxC
                                Chazrox @d.healey
                                last edited by

                                @d-healey

                                HiseSnippet 1031.3ocsV8taaaCDmxNpq1aqnEXO.b9SJEFFx4eKEAEMINwaFKI0XJKXeqfV5TLQjH0nnRlQQA1C0d.1Sy97dC1NJIaK03klYrQCXni2e4ui2cbrR5CooREwp8kyR.h0WX6MSnmNXJiKHiNgX8b6y4Ab5YRV.8RHUSNdVBKMEBHVVM+ViTVs1fju9y2bLKhI7gkaQHWI49vY7Xtd4tiO764QQCYAvk73JRuygi7khAxHYFFQMscIIL+aXWCWvLh0vl7crzoDqWZu0Vg9665t+1auqKisc.isSeX6WAg6E5uq6qbClrqK9aOh0SNMfqkJOMSConQOVFLyap7NQgCthmxmDAFh9DOzyEaSFLkGELdN7jRHVaLdIX0r.r9pbrYw92CzVpQUPypwCER8+WDRMpDRe177WdHEwlAp7P4Y1mO5jQzhc5WKPFjoTfP6A+bF7QYsRVWpP7uZB9LoL4TACCufpaar9DTTuDnNCql+GcVIli0PdDX9txwdihi8Kr87U7D8RNly9maORnAUHCObUO3ExRZ7GMrGHQID5dwrafgJjXgFN6451kh+s4AsaiWKS0zaYJpAMKAS5qo4EK8tFzKQcmNUA7Nn1KUdhVXJjt.tK+9wqoycOZgAx3Do.Ib5TWLiIvEWDwE.MLS3q4RAUJpKlwTJYji+b6zEcYTFrY622lhKdH04qK1gp.clRbfY+bdQReVDUIkZLlLnr2rTMD26njjSXZF5eiTUXLQIuKEbLZzkFxhRgtzNurWLOnS2EgnSHpvlE59dZ4pU6Vspfg8RY2BGkNO6lqRWZ+MOXt7sm+QMk.cEo0prx+Wp1JV4V5CHX9g1ONX23lRTc.KJxbA24e.0MonJYlKjZ3sBGCz2BcG8iYEFtRdkFKBuDsJ1llkpGRQGQV7DPUIwmKHVkTuJ7IOtpP+BTphfRwHAW+1DnjdnLJvTRY9dE0rkvL1oxpLBQQ04ErOqrf83LsVJH7.SSy5PKI+TTsqD4GGYtNN2dnoQ2k.JM2bprNAtEm0TzPnk8IP5MZYRtrkoXrK4i26+xBO+qWc3rED+9jCuiGnwoP1V+FROE3WOUanbPJd54xXzSLEpgUiUzoBGMHCxhX55yKLSRKYfozZcqLcjDob8rZMVe7CQbe3FqOxP7E1i4Z+oqNFarhXzLe5+gXrbz6WZeZXH3qWFfaXO7mV24reB2+CxLMWb84LshiWKruHK1CehhOfdWHfnTS5ug4BeAsqg1f.dfHHm3uvUIy9FZqRl8myjDy7Ux24WTlXFt+z7cvXRj+3mV1mano8ueYA10k+Ne+5l5dJt05p31qqh6rtJt65p3dqqhey5p39eZEMcSNJSKiKJavmxL9z71XVVKdJkUSxeCLcj3vC
                                
                                d.healeyD 1 Reply Last reply Reply Quote 0
                                • d.healeyD
                                  d.healey @Chazrox
                                  last edited by

                                  @Chazrox I'm out for a few hours, I'll take a look when I'm home

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

                                  ChazroxC 1 Reply Last reply Reply Quote 1
                                  • ChazroxC
                                    Chazrox @d.healey
                                    last edited by

                                    @d-healey yes sir! 🙏

                                    1 Reply Last reply Reply Quote 0
                                    • ChazroxC
                                      Chazrox
                                      last edited by

                                      This post is deleted!
                                      ChazroxC 1 Reply Last reply Reply Quote 0
                                      • ChazroxC
                                        Chazrox @Chazrox
                                        last edited by

                                        Please help. I really cant afford another day of loss this week. 🙏

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

                                          @Chazrox Your snippet works here. But I don't understand why you're writing over the selected MIDI file.

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

                                          ChazroxC 1 Reply Last reply Reply Quote 0
                                          • ChazroxC
                                            Chazrox @d.healey
                                            last edited by Chazrox

                                            @d-healey explain please! I dont know what you mean? Im not intending to write over it. I just want to load it. Any clues why its not working in mine? I dont even get errors, it just doesnt load. Kinda hard to chase down with no errors and minimal knowledge. haha.

                                            So you're saying midi file loads when you select from the pop up browser? Can you show me please! 🙏

                                            d.healeyD HISEnbergH 2 Replies Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            9

                                            Online

                                            1.9k

                                            Users

                                            12.4k

                                            Topics

                                            107.9k

                                            Posts