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

-
@Chazrox is this working, you have a semicolon instead of a comma?
"*.mid;*.midi"
-
-
@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.
-
@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.
-
-
@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?
-
@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...?
-
@Chazrox said in Save MIDI files to MIDI FOLDER || See code::
but loading doesnt execute.
Do MIDI players have a
setFile
function? -
-
Show me where MIDIPlayer1 is declaredActually if saveAsMidiFile is working then the declaration must be correct.Minimal snippet time.
-
-
@d-healey said in Save MIDI files to MIDI FOLDER || See code::
Show me where MIDIPlayer1 is declared
give me 5 minutes please! brb!
-
HiseSnippet 1031.3ocsV8taaaCDmxNpq1aqnEXO.b9SJEFFx4eKEAEMINwaFKI0XJKXeqfV5TLQjH0nnRlQQA1C0d.1Sy97dC1NJIaK03klYrQCXni2e4ui2cbrR5CooREwp8kyR.h0WX6MSnmNXJiKHiNgX8b6y4Ab5YRV.8RHUSNdVBKMEBHVVM+ViTVs1fju9y2bLKhI7gkaQHWI49vY7Xtd4tiO764QQCYAvk73JRuygi7khAxHYFFQMscIIL+aXWCWvLh0vl7crzoDqWZu0Vg9665t+1auqKisc.isSeX6WAg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vC
-
@Chazrox I'm out for a few hours, I'll take a look when I'm home
-
@d-healey yes sir!
-
This post is deleted! -
Please help. I really cant afford another day of loss this week.
-
@Chazrox Your snippet works here. But I don't understand why you're writing over the selected MIDI file.
-
@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!
-
@Chazrox Actually I was wrong, it isn't working, but I'm not seeing any errors. However I know why it's not working.
// This overwrites the selected file with the contents of the MIDI player - I don't think you want to do this MIDIPlayer1.saveAsMidiFile(file, 1);
// This is almost correct, take another look at that API documentation you posted ;) MIDIPlayer1.setFile(file, true, true);