MIDI Tempo in Expansions
-
Hi Everyone! I'm building a MIDI Player for a Plugin with Expansions and I have been able to get MidiFileList of each expansion, put it in a viewport and load the files in the midi player, but I would like to get the Tempo information of each midi file in from the expansion, I have tried harcoding the Tempo in a JSON file in the "Additional Source" folder but I haven't been able to get a correct array from any source, this is how the JSON File looks Like:
{ "tempo": [140, 85, 100, 90, 120, 90, 130] }
I Tried Calling the Json File with .loadDataFile, .getChildFile but everything returns a "null" or "undefined" Object
This is something like im trying to do:
const MidiFileData = currentExpansion.loadDataFile("../Tempo.js"); const MidiTempoData = MidiFileData.tempo; inline function onMidiFileListViewPortControl(component, value) { MIDIPlayer1.setFile(MIDIList[value], true, false); Engine.setHostBpm(MidiTempoData[value]); };
-
@Soundavid json file should have a .json extension. You don't need to use a relative path, just put the file name.
-
@d-healey Thank you David! Worked Perfectly!