Solved MIDI Files Load in HISE, but not in a Compiled Plugin
-
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();
-
@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
const midiPlayer = Synth.getMidiPlayer("midiPlayer");
-
@ulrik Thank you, I appreciate that. Unfortunately, I've been using that reference already. :(
-
@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.
-
@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.
-
@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?
-
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.
-
@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:
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?
-
@Goodflow I appreciate your response - I've made that mistake many, many times, lol. (Many!)
-
@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?
-
@ally Ah!!!!!! I will try. Thank you!
-
C clevername27 has marked this topic as solved on
-
@Christoph-Hart Thank you again - I was able to get it working, and added my solution to the original post.