HISE Logo Forum
    • Categories
    • Register
    • Login

    MIDI Tempo in Expansions

    Scheduled Pinned Locked Moved General Questions
    3 Posts 2 Posters 196 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.
    • S
      Soundavid
      last edited by

      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]);
      };
      
      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @Soundavid
        last edited by

        @Soundavid json file should have a .json extension. You don't need to use a relative path, just put the file name.

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

        S 1 Reply Last reply Reply Quote 1
        • S
          Soundavid @d.healey
          last edited by

          @d-healey Thank you David! Worked Perfectly!

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

          58

          Online

          1.7k

          Users

          11.7k

          Topics

          101.8k

          Posts