HISE Logo Forum
    • Categories
    • Register
    • Login

    Colour Sample Map Keys by Sampler ID? // Help.

    Scheduled Pinned Locked Moved Unsolved Scripting
    4 Posts 2 Posters 47 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.
    • ChazroxC
      Chazrox
      last edited by

      I know how to colour the keyboard keys by samplemaps, but If I have two 'Samplers' how do I separate the colours for them? At this time, both 'Samplers' are showing their mappings in the same colour, I'd like to separate them by colour and possibly just do some general identifiers per Sampler. Can anyone help with this?

      This is for one sampler. Can you help modify? Im not sure how to call on separate samplers maps.

      const samplerIds = Synth.getIdList("Sampler");
      const samplers = [];
      
      for (id in samplerIds)
      	samplers.push(Synth.getSampler(id));
      
      
      
      pnlPreLoad.setLoadingCallback(function(isPreloading)
      {
      	if (!isPreloading)
      	{
      		setKeyColours();
      	}
      });
      
      
      inline function setKeyColours()
      {
      	for (i = 0; i < 128; i++)
      	{
      		Engine.setKeyColour(i, Colours.withAlpha(Colours.black, 0.90));
      		
      	}
      	for (i = 0; i < 128; i++)
      	{
      		for (s in samplers)
      		{
      			if (s.isNoteNumberMapped(i))
      			{	
      				
      				Engine.setKeyColour(i, Colours.withAlpha(0xFF327E66, 0.6));
      			}
      		}
      	}
      }
      
      setKeyColours();
      
      Christoph HartC 1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart @Chazrox
        last edited by

        @Chazrox basic JS stuff:

        inline function setKeyColours()
        {
            for(i = 0; i < 128; i++)
            {
                  if(samplers[0].isNoteNumberMapped(i))
                  {
                      Engine.setKeyColour(i, Colours.red);
                  }
                  else if(samplers[1].isNoteNumberMapped(i))
                  {
                      Engine.setKeyColour(i, Colours.blue);
                  }
                  else
                  {
                      Engine.setKeyColour(i, Colours.white);
                  }
            }
        }
        ChazroxC 2 Replies Last reply Reply Quote 1
        • ChazroxC
          Chazrox @Christoph Hart
          last edited by

          @Christoph-Hart Thank you sir. 🙏

          1 Reply Last reply Reply Quote 0
          • ChazroxC
            Chazrox @Christoph Hart
            last edited by

            @Christoph-Hart Screenshot 2025-10-01 at 5.14.38 AM.png

            sweeet! 🙏

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

            36

            Online

            2.0k

            Users

            12.6k

            Topics

            109.5k

            Posts