HISE Logo Forum
    • Categories
    • Register
    • Login

    Object in JSON to Object in HISE

    Scheduled Pinned Locked Moved Scripting
    6 Posts 2 Posters 241 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.
    • CasmatC
      Casmat
      last edited by

      Hey!

      I have this JSON file in my expansion:

      {
      	"name": "Night Owl",
      	"type": "Morphology",
      	"version": "1.0.0",
      	"samplemaps":
      	{
      		"Bionic Morph":
      		{
      			"instrument": "Night Owl",
      			"samplemap": "{EXP::Morphology - Night Owl}Bionic Morph",
      			"tags": ["Pad"]
      		},
      		"Native Morph": 
      		{
      			"instrument": "Night Owl",
      			"samplemap": "{EXP::Morphology - Night Owl}Native Morph",
      			"tags": ["Chord"]
      		},
      		"Plucked Morph":
      		{
      			"instrument": "Night Owl",
      			"samplemap": "{EXP::Morphology - Night Owl}Plucked Morph",
      			"tags": ["Pluck"]
      		}
      	}
      }
      

      In my HISE project, I have an object called layerScreenObject:

      reg layerScreenObject = {};
      

      I'm currently in my installation callback and I'd like to get the objects within the "samplemaps" object inside the json file. So in this case, it'd be the "Bionic Morph", "Native Morph", and "Plucked Morph" objects and I'd like to "push" them into layerScreenObject. I've already have the json file defined in my callback such that any data in it can be called with jsonFile, such as jsonFile["samplemaps"]. Any ideas on how I could do this?

      Thanks!

      i make music

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @Casmat
        last edited by

        @Casmat Why not just reg thingIwant = dataFile.samplemaps["Bionic Morph"];?

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

        CasmatC 1 Reply Last reply Reply Quote 0
        • CasmatC
          Casmat @d.healey
          last edited by

          @d-healey the layerScreenObject object would house all of the samplemap objects from every instrument the user has installed. So there may be multiple objects existing in layerScreenObject and the installation callback would add more objects (Bionic Morph, Native Morph, and Plucked Morph) to the main layerScreenObject

          i make music

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @Casmat
            last edited by

            @Casmat Ok, so what's the problem with just adding the result of the thingy I put into your layerScreenObject ?

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

            CasmatC 2 Replies Last reply Reply Quote 0
            • CasmatC
              Casmat @d.healey
              last edited by Casmat

              @d-healey what do you mean by add?

              Edit: i guess i'm trying to figure out how you add something to an object, like pushing something in a list

              i make music

              1 Reply Last reply Reply Quote 0
              • CasmatC
                Casmat @d.healey
                last edited by

                @d-healey got it fixed! I fell victim to HISEing fatigue 😲

                i make music

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

                41

                Online

                1.7k

                Users

                11.7k

                Topics

                102.1k

                Posts