how to use Resources using LUA scripting?

Home Forums General Programming how to use Resources using LUA scripting?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #34652
    m.tarenskeen
    Participant
      • Topics: 30
      • Replies: 113
      • Total: 143
      • ★★

      If I include a SysEx file – for example with Factory preset data, or Initial voice parameters – in the Resources of my panel, how can I access this included file from a LUA script, just like an external file? I want to load such data if I start the panel or maybe add an “INIT” button in my panel.

      #34669
      dasfaker
      Keymaster
        • Topics: 80
        • Replies: 793
        • Total: 873
        • ★★★

        Try this

        init_patch = MemoryBlock()
        init_patch:createFromTable({0xF0, 0x00, 0x20, 0x33, 0x01, …, 0xF7})

        #34670
        m.tarenskeen
        Participant
          • Topics: 30
          • Replies: 113
          • Total: 143
          • ★★

          Thanks, but that is not what I meant. (BTW: how could anyone know such a thing? The Ctrlr API still lacks any proper documentation)

          I want to load an external *.syx file in the Resources section of Ctrlr and save it with my panel when I export as *.panelz including resources. (just like I can include an image or fontfile). Then I want to know if I have access to such files from within a LUA script.

          #34672
          dasfaker
          Keymaster
            • Topics: 80
            • Replies: 793
            • Total: 873
            • ★★★

            I know that’s not what you asked for, but for a single patch, or a bunch of patches, it’s easier to store them inside a script. At the end, the result is the same (storing internally some data).

            I never imported such kind of data as a resource, only images and fonts, so I can’t give you a better reply.

            To look for help with the API, look here: https://www.juce.com/api/classes.html

          Viewing 4 posts - 1 through 4 (of 4 total)
          • The forum ‘Programming’ is closed to new topics and replies.
          There is currently 0 users and 108 guests online
          No users are currently active
          Forum Statistics
          Threads: 2,495, Posts: 17,374, Members: 77,605
          Most users ever online was 12 on January 22, 2019 3:47 pm
          Ctrlr