Forum

    • Register
    • Login
    • Search
    • Categories

    Engine.getKeyColour()

    Feature Requests
    3
    7
    67
    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.
    • iamlamprey
      iamlamprey 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.

      New Song 🥰 - Instruments

      d.healey 1 Reply Last reply Reply Quote 0
      • d.healey
        d.healey @iamlamprey 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

        iamlamprey 1 Reply Last reply Reply Quote 0
        • iamlamprey
          iamlamprey @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

          New Song 🥰 - Instruments

          d.healey 1 Reply Last reply Reply Quote 0
          • d.healey
            d.healey @iamlamprey 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 1
            • iamlamprey
              iamlamprey last edited by

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

              New Song 🥰 - Instruments

              marcLab 1 Reply Last reply Reply Quote 0
              • marcLab
                marcLab @iamlamprey 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!

                iamlamprey 1 Reply Last reply Reply Quote 1
                • iamlamprey
                  iamlamprey @marcLab last edited by

                  @marcLab i forgot all about the source code folders 😖

                  New Song 🥰 - Instruments

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

                  9
                  Online

                  1.1k
                  Users

                  7.0k
                  Topics

                  64.7k
                  Posts