Forum
    • Categories
    • Register
    • Login

    Custom JSON preset file support

    Scheduled Pinned Locked Moved General Questions
    6 Posts 2 Posters 97 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.
    • D
      dezertaudio
      last edited by

      Hi, I’m working on a HISE FX plugin and wanted to ask whether there is any safe way in Hise to package native .preset files into a single custom bank file without losing preset data.

      What I was trying to do:

      • export a whole preset bank into one portable json file
      • then import that file back into the plugin and recreate the original .preset files

      My first attempt was:

      1. read each .preset with loadFromXmlFile()
      2. store the returned object inside a JSON container
      3. write that container with writeObject()
      4. read it back with loadAsObject()
      5. recreate each preset with writeAsXmlFile()

      Problem:
      This appears to be lossy for real HISE preset files.
      A native preset contains many repeated <Control> elements, and loadFromXmlFile() seems to collapse repeated child tags into a single object entry, so after round-trip only one control survives instead of the full preset.

      So my question is:
      Is there any HISE-supported way in script to preserve the raw contents of a .preset file for single-file bank export/import?

      More specifically, is there any API in Hise for:

      • reading a file as raw text/string
      • reading raw bytes/binary
      • copying files into/from an archive-like container
      • base64 encode/decode
      • or any other safe way to round-trip a .preset file exactly

      Any recommended approach here would be really appreciated.

      1 Reply Last reply Reply Quote 0
      • David HealeyD
        David Healey
        last edited by

        Sounds like something that could easily get messy. What's the end goal?

        Free HISE Bootcamp Full Course for beginners.
        YouTube Channel - Public HISE tutorials
        My Patreon - HISE tutorials

        D 1 Reply Last reply Reply Quote 0
        • D
          dezertaudio @David Healey
          last edited by

          @David-Healey essentially just to be able to export and import user preset banks. It seems like Hise cant import folders though? So I was trying to find another way

          David HealeyD D 2 Replies Last reply Reply Quote 0
          • David HealeyD
            David Healey @dezertaudio
            last edited by

            @dezertaudio said in Custom JSON preset file support:

            essentially just to be able to export and import user preset banks.

            If you're using the stock preset browser this functionality is built in.

            b47e9ccf-de8f-4539-a9b1-2879041266db-image.png

            Free HISE Bootcamp Full Course for beginners.
            YouTube Channel - Public HISE tutorials
            My Patreon - HISE tutorials

            1 Reply Last reply Reply Quote 0
            • D
              dezertaudio @dezertaudio
              last edited by

              @dezertaudio ah I'm using a custom preset browser though. Do you think Hise could ever get a raw string read/write API? @Christoph-Hart

              David HealeyD 1 Reply Last reply Reply Quote 0
              • David HealeyD
                David Healey @dezertaudio
                last edited by

                @dezertaudio said in Custom JSON preset file support:

                I'm using a custom preset browser though.

                Are you using a custom preset format as well?

                Free HISE Bootcamp Full Course for beginners.
                YouTube Channel - Public HISE tutorials
                My Patreon - HISE tutorials

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

                21

                Online

                2.2k

                Users

                13.5k

                Topics

                117.6k

                Posts