HISE Logo Forum
    • Categories
    • Register
    • Login

    Colouring Keys on multiple Keyboards

    Scheduled Pinned Locked Moved General Questions
    2 Posts 2 Posters 171 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
      du36cywy
      last edited by

      When I have 2 Keyboards, is there a way to colour them differently, i.e. through Engine.setKeyColour() ?
      My problem is that each keyboard has another Samplemap loaded with different missing samples, which I want to highlight with a red colouring. Do you think it's necessary to use CustomGraphics to achieve this?

      Here's an example-code, which only colours both Keyboards:

      const var Keyboard = Content.addFloatingTile("Keyboard", kbposx, kbposy);
      Content.setPropertiesFromJSON("Keyboard", {
        "width": kbwidth,
        "height": kbheight
      });
      Keyboard.setContentData({"Type": "Keyboard", "LowKey": 31, "HiKey": 84, "MidiChannel": 1, "CustomGraphics": false});
      const var Keyboard2 = Content.addFloatingTile("Keyboard2", kbposx, 450);
      Content.setPropertiesFromJSON("Keyboard2", {
        "width": kbwidth,
        "height": kbheight
      });
      Keyboard2.setContentData({"Type": "Keyboard", "LowKey": 31, "HiKey": 84, "MidiChannel": 2, "CustomGraphics": false});
      const var missing_list_1 = [31, 36, 43, 50, 55, 57, 64, 71, 78, 84];
      const var missing_list_2 = [34, 35, 39, 59, 68, 79];
      
      function markMissing(miss_list) {
          reg i;
          for (i = 0; i < miss_list.length; i++) {
              Engine.setKeyColour(miss_list[i], Colours.withAlpha(Colours.red, 0.3));
          }
      } // this function will be called with one of those arrays as an argument
      

      Thanks in advance, any thoughts on this are appreciated!

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

        I think you'd need to make a custom keyboard for this, either using a panel or via C++.

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

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

        15

        Online

        1.7k

        Users

        11.8k

        Topics

        103.2k

        Posts