HISE Logo Forum
    • Categories
    • Register
    • Login

    MIDI Files Load in HISE, but not in a Compiled Plugin

    Scheduled Pinned Locked Moved Solved Scripting
    12 Posts 5 Posters 708 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.
    • clevername27C
      clevername27
      last edited by clevername27

      I guessed they were embedded in the plugin, but this doesn't find them (macOS):

      midiPlayer.setFile("{PROJECT_FOLDER}" + [MIDI File Name] + ".mid", true, true);
      

      But in HISE, it finds the MIDI files just fine.

      Any ideas?

      Thanks!


      Update: Work now. Checking the preset.h file helped me trouble-shoot when the MIDI files weren't being embedded. From there, I switched to loading all the MIDI files at startup; these two lines were all that was needed:

      const var midiRenderEngine = Synth.getMidiPlayer("midiRenderEngine");
      const var embeddedMidiFilesList = midiRenderEngine.getMidiFileList();
      
      ulrikU GoodflowG 2 Replies Last reply Reply Quote 0
      • ulrikU
        ulrik @clevername27
        last edited by

        @clevername27 strange, that is the function I use to load them, and it's working here.
        watch out for how you make a reference to the midiPlayer, in this case you should use the
        Skärmavbild 2024-05-18 kl. 06.11.30.png

        const midiPlayer = Synth.getMidiPlayer("midiPlayer");
        

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

        clevername27C 1 Reply Last reply Reply Quote 2
        • clevername27C
          clevername27 @ulrik
          last edited by

          @ulrik Thank you, I appreciate that. Unfortunately, I've been using that reference already. :(

          1 Reply Last reply Reply Quote 0
          • GoodflowG
            Goodflow @clevername27
            last edited by

            @clevername27 said in Where are MIDI Files Stored in Compiled Plugins?:

            midiPlayer.setFile("{PROJECT_FOLDER}" + [MIDI File Name] + ".mid", true, true);

            Have you checked the result of this against the respective file/value from midiPlayer.getMidiFileList()? I went through something similar recently and it was from a misplaced text.replace on the [MIDI File Name] variable.

            clevername27C 1 Reply Last reply Reply Quote 1
            • clevername27C
              clevername27 @Goodflow
              last edited by

              @Goodflow Thank you for your reply. A helpful thought, but the MIDI files load in HISE. They just don't load in the compiled plugin.

              GoodflowG 1 Reply Last reply Reply Quote 0
              • GoodflowG
                Goodflow @clevername27
                last edited by

                @clevername27 Sorry I missed that bit, sounds like it could be a missing file pool issue in that case. Have you tried Export > Export Pooled Files To Binary Resource before compiling?

                Christoph HartC clevername27C 2 Replies Last reply Reply Quote 1
                • Christoph HartC
                  Christoph Hart @Goodflow
                  last edited by

                  Have you tried Export > Export Pooled Files To Binary Resource before compiling?

                  Yes try this. Then you can verify that the Midi pool file is not zero bytes. In the Binaries folder, check the PresetData.h file, the Midi Pool byte array should also be non zero (in this case, zero means 28 bytes). So check Binaries/Sources/PresetData.h. If it says this:

                      extern const char*  midiFiles;
                      const int           midiFilesSize = 28;
                  

                  then it hasn't embedded any MIDI files. but usually it should load all the MIDI files in the pool at export.

                  clevername27C 2 Replies Last reply Reply Quote 1
                  • clevername27C
                    clevername27 @Christoph Hart
                    last edited by clevername27

                    @Christoph-Hart said in (Please Help) MIDI Files Load in HISE, but not in a Compiled Plugin:

                    PresetData.h

                    Thank you, Chris. Here's that files:

                    bb755814-93d7-46d8-9d5b-85836c27dcbb-image.png

                    My MIDI files are tiny, though if that 28 is bytes, not that small. 😁

                    (I tried the pooling. Also: considered going to a pool. It's warm out.)

                    I experimented with putting the MIDI files in an external folder, and referring them in the compiled version — that worked OK.

                    Has anyone, on macOS, successfully embedded MIDI files?

                    A 1 Reply Last reply Reply Quote 0
                    • clevername27C
                      clevername27 @Goodflow
                      last edited by

                      @Goodflow I appreciate your response - I've made that mistake many, many times, lol. (Many!)

                      1 Reply Last reply Reply Quote 0
                      • A
                        ally @clevername27
                        last edited by

                        @clevername27 I had this problem yesterday when I was trying to set the MIDI file on init. When I moved setFile into the callback of a viewport, it worked fine. Maybe that's what's going on?

                        clevername27C 1 Reply Last reply Reply Quote 0
                        • clevername27C
                          clevername27 @ally
                          last edited by

                          @ally Ah!!!!!! I will try. Thank you!

                          1 Reply Last reply Reply Quote 0
                          • clevername27C clevername27 has marked this topic as solved on
                          • clevername27C
                            clevername27 @Christoph Hart
                            last edited by

                            @Christoph-Hart Thank you again - I was able to get it working, and added my solution to the original post.

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

                            43

                            Online

                            1.7k

                            Users

                            11.7k

                            Topics

                            101.9k

                            Posts