HISE Logo Forum
    • Categories
    • Register
    • Login

    Engine.getKeyColour()

    Scheduled Pinned Locked Moved Feature Requests
    7 Posts 3 Posters 251 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.
    • ?
      A Former User
      last edited by

      I have a custom colour scheme for my keyboard that changes depending on the expansion, and I need to change the colour of 1 key when pressed, then change it back on noteOff, so would be great if I could store the colour as a local var, then just restore it afterwards.

      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @A Former User
        last edited by

        @iamlamprey Can't you store the key colours when you set them?

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

        ? 1 Reply Last reply Reply Quote 0
        • ?
          A Former User @d.healey
          last edited by

          @d-healey So push them into an array or something? I'd still have to use a case statement for each expansion

          d.healeyD 1 Reply Last reply Reply Quote 0
          • d.healeyD
            d.healey @A Former User
            last edited by

            @iamlamprey

            Yeah just put the colour of each key in an array at the time you set the key colour.

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

            1 Reply Last reply Reply Quote 0
            • ?
              A Former User
              last edited by

              All good just have to rework some bits of code then :) cheers

              marcLabM 1 Reply Last reply Reply Quote 0
              • marcLabM
                marcLab @A Former User
                last edited by

                @iamlamprey You can also add a .JSON file containing some specific data in the AdditionalSourceCode of your expansion.

                var e = expHandler.getCurrentExpansion();
                var data = e.loadDataFile("data.json");

                and accessing data like this:
                data.colour

                the JSON file should look like this

                {
                "colour": "red",
                }

                Cheers!

                ? 1 Reply Last reply Reply Quote 0
                • ?
                  A Former User @marcLab
                  last edited by

                  @marcLab i forgot all about the source code folders :confounded_face:

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

                  32

                  Online

                  1.7k

                  Users

                  11.7k

                  Topics

                  102.0k

                  Posts