HISE Logo Forum
    • Categories
    • Register
    • Login

    Is there a way to peek inside sample objects?

    Scheduled Pinned Locked Moved Scripting
    5 Posts 3 Posters 231 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.
    • SimonS
      Simon
      last edited by Simon

      I've noticed trace() doesn't work on all objects. Is there a way to peek inside them without checking the source code? What's special about those objects?

      Concretely, I wanted to get the properties of some mapped samples using createSelection(). It would be nice to be able to just dump all the sample properties with trace(), but it prints empty.

      I know I can get properties with sample.get, but mostly was curious why trace() doesn't work and if there's maybe another way.

      HiseSnippet 1373.3ocyW81aaSDF+bS8zZXLwl1K3E7BSERjNlBIsooqfPKsMock0rZEWFHgfna1maNE66rt6bKgoI9JwGA9HsuAvyY6jXmE5RCaikWDkm+d+tm+dwVvcIRIWfLJe1nHBx3VlNiXpAGL.SYniaiLtsYWrTQDVor1eTDVJIdHCiRGoYXr1pnjOu5Q6iCvLWxTVHzy3TWxIzPpZJW6VOgFDbH1ibFMLm1MZcrKmc.OfGC3ojYMTD1cH9bxSwZ0VwD8Xrb.x39l01tIgryV9dd3s1xqYyl69vcaracresF3mWu4tM1rwNa9vc7QF2niGUwENJrhHQFqtO2ajy.9krzC3YTI84ADMQcjCbxorOjG3ouhZtnCFPC7rGGnjHjgo8zvVozv18L6R8nS3OM78IIBrlZQ9.nwJEgWoBvq9+F7lCjLxAoUSgzcLcbEzH0TIZ77QlGyfroOFxS4gRptnUNZEyC3fFLU0P7PxgBfXhEUZVq1Crfu13aKCoJoxRRBHtJJmY8cVIENUOmnRfWBUk0cvgQADQ802nJVlQTYiptBBbkcFack0+0p2e8MJCGsjGPpFInLUk0Oa.UZEv4CguoCIVjvH0HKphDJsV25qrTBMnlfgM.XMOOHUP8Vd+fY4b0mOOW8y09k43s8iUVWRrFx3WBl9kRKrqJFGDLxB+ModAh7b+2javLOsabAX.QKqHAOhHTThzxWvCAOm5r7d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UHTW6NoM2FclzbWB8O78wakH
      
      d.healeyD SimonS 2 Replies Last reply Reply Quote 0
      • d.healeyD
        d.healey @Simon
        last edited by d.healey

        @Simon Script watch table

        361a69b9-d67e-4ec5-949f-7043c08a177d-image.png

        Trace is working here, but it only goes one level, each sample is an object. Actually I don't think that's the reason because when I manually create such a multi-level object trace still displays it.

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

        1 Reply Last reply Reply Quote 0
        • SimonS
          Simon @Simon
          last edited by Simon

          The script watch table only shows the path to the .wav sample though, not all the other attributes. Just had to expand it more lol.

          Did you try the snippet? trace() for me prints empty when called on a single sample object, not just when they're in an array.

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

            @Simon Yeah I had a look at your snippet. What I notice is the Sample object seems to be a "real" object, in that the variable types it contains are reg variables, so it's something unique to the internal object that HISE is creating here.

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

            Christoph HartC 1 Reply Last reply Reply Quote 1
            • Christoph HartC
              Christoph Hart @d.healey
              last edited by

              Dave is right you can only trace generic JSON objects not the one that wrap around C++ things.

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

              25

              Online

              1.7k

              Users

              11.9k

              Topics

              103.6k

              Posts