HISE Logo Forum
    • Categories
    • Register
    • Login

    Bit confused: How to load a json file?

    Scheduled Pinned Locked Moved General Questions
    5 Posts 4 Posters 168 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.
    • griffinboyG
      griffinboy
      last edited by griffinboy

      I'm trying to load in an external json file.
      I don't like pasting in giant arrays.

      // We need to create & initialise the network via script, the scriptnode node will then reference
      // the existing network
      const var neuralOsc = Engine.createNeuralNetwork("JoshSine2");
      
                         
      //const var audioFolder = FileSystem.getFolder(FileSystem.AudioFiles);
      
      //var jfile = audioFolder.getChildFile("01.json");
      
      //reg joshJson = jfile.loadAsObject();    
      
      // load the sine wave approximator network
      
      var joshJson = Engine.loadFromJSON("{PROJECT_FOLDER}/01.json"); // loads a JSON file into an object.
      
      neuralOsc.loadTensorFlowModel(joshJson);
      
      // Now head over to the Scriptnode Synthesiser where this model is used by the math.neural node...
      
      

      This is definitely not right

      Oli UllmannO d.healeyD 2 Replies Last reply Reply Quote 0
      • Oli UllmannO
        Oli Ullmann @griffinboy
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • d.healeyD
          d.healey @griffinboy
          last edited by

          @griffinboy said in Bit confused: How to load a json file?:

          This is definitely not right

          Other than var instead of const I don't see a problem.

          If you're loading from outside the project folder you can use the File and FileSystem APIs to load a file as an object.

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

          ustkU 1 Reply Last reply Reply Quote 0
          • ustkU
            ustk @d.healey
            last edited by ustk

            @d-healey But in this case that would mean delivering the file in question along with the binary, right? I am not sure it is "appropriate" for a neural model.

            @griffinboy Why not simply paste it in an included script file that only serves this purpose? After all, having an include line or a variable you load a json into, there are not much differences in terms of code weight

            Can't help pressing F5 in the forum...

            griffinboyG 1 Reply Last reply Reply Quote 0
            • griffinboyG
              griffinboy @ustk
              last edited by

              This post is deleted!
              1 Reply Last reply Reply Quote 0
              • First post
                Last post

              19

              Online

              1.7k

              Users

              11.9k

              Topics

              103.6k

              Posts