HISE Logo Forum
    • Categories
    • Register
    • Login

    Custom Keyboard - bug in compiled product

    Scheduled Pinned Locked Moved Bug Reports
    14 Posts 2 Posters 712 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.healeyD
      d.healey @Lindon
      last edited by

      @Lindon Need to see some code

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

      LindonL 1 Reply Last reply Reply Quote 0
      • LindonL
        Lindon @d.healey
        last edited by

        @d-healey sure..

        namespace keys 
        {
        
        	for (i = 36; i<68;i++)
        	{
        		Engine.setKeyColour(i,0);
        	}
        
        	const var KeyboardTile = Content.getComponent("KeyboardTile");
        	
        	const keyboardLAF = Content.createLocalLookAndFeel();
        	
        	keyboardLAF.registerFunction("drawWhiteNote", function(g, obj)
        	{
        		 var a = obj.area;
        		 //Console.print(trace(colourSet));
        		 if (obj.noteNumber-36 <= colourSet.length-1 )
        		 {
        			 g.setColour(colourSet[obj.noteNumber- 36]);
        		 }else{
        		 	g.setColour(0xff333333);
        
        		 }
        		 g.fillEllipse([a[0]+9,a[1]+32,5,5]);
        	});
        	
        	
        	keyboardLAF.registerFunction("drawBlackNote", function(g, obj)
        	{
        	var a = obj.area;
        	if (obj.noteNumber- 36 <= colourSet.length-1 )
        	 {
        		 g.setColour(colourSet[obj.noteNumber- 36]);
        	 }else{
        	 	g.setColour(0xff333333);
        	 }
        
        	g.fillEllipse([a[0]+6,a[1]+15,5,5]);
        	});
        	
        	
        	
        	KeyboardTile.setLocalLookAndFeel(keyboardLAF);
        	
        	
        }
        

        HISE Development for hire.
        www.channelrobot.com

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

          @Lindon I'm not seeing anything in there to differentiate between on and off. if (obj.down) etc.

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

          LindonL 1 Reply Last reply Reply Quote 0
          • LindonL
            Lindon @d.healey
            last edited by

            @d-healey - I see what you mean - strange tho as it works correctly...

            still, did you mean something like this:

            keyboardLAF.registerFunction("drawWhiteNote", function(g, obj)
            	{
            		 var a = obj.area;
            
            		 if (obj.noteNumber-36 <= colourSet.length-1 )
            		 {
            			 if(!obj.down)
            			 {
            			 	g.setColour(colourSet[obj.noteNumber- 36]);
            			 }else{
            				g.setColour(0xFFFFFFFF); 
            			 }
            		 }else{
            		 	g.setColour(0xff333333);
            
            		 }
            		 	g.fillEllipse([a[0]+9,a[1]+32,5,5]);
            	});
            

            HISE Development for hire.
            www.channelrobot.com

            LindonL 1 Reply Last reply Reply Quote 0
            • LindonL
              Lindon @Lindon
              last edited by

              @Lindon - hmm that makes it worse not better....now its doing it nearly all the time...

              HISE Development for hire.
              www.channelrobot.com

              LindonL 1 Reply Last reply Reply Quote 0
              • LindonL
                Lindon @Lindon
                last edited by

                @Lindon - yeah now its producing all sorts oh half drawn artifacts..

                41528127-c17a-45cd-a9c5-9ac928166165-image.png

                HISE Development for hire.
                www.channelrobot.com

                d.healeyD 2 Replies Last reply Reply Quote 0
                • d.healeyD
                  d.healey @Lindon
                  last edited by

                  @Lindon I'll take a look when I'm back home in an hour or so

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

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

                    @Lindon This is how I would do it. Set all of the key colours outside of the LAF function (unless you need them to change to some other colour). I don't have access to your colourSets array so I've just added some placeholder code.

                    To solve the half drawn artefacts you need to increase the key width in the floating tile's properties.

                    Peek 2022-05-17 16-02.gif

                    HiseSnippet 1292.3ocsVs0SabDEdVfEk08JR8o9zHdHxHbsVCAykTZ.7k.JbwJlPpDJMZX2Ysm50yrZ2w.VQ7R+k0W6+l9OfdN6E60.kPrZsPn4ba1u4b9lybZEpb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INZ1koDYvrGCZlFa+P0UPXfpMiE2WjHAc2ikqMHRq5+5PVPWgSzDQVm6wF3q2MHfyBwm2mvZ78ZXudKjUUfE6xU2L92FaXu9l1qWI1qSUc53yOR4NYv3ypvyrRI2GwRrt2EwOi6.btbfQGNfmYroOS2VOz+N6TqFY0f6pG3tg5wekUxz2P5l6aWsvMHsaDs4YeFZy2YlWUEj2XZ7WYblsLFwgSnHeS7HDsgxJPxmfk.g7.rjrB+cXIYpI2eTAXHEk6.H4L4jK3HZoFfa7SLt.NRfLRnGleDtufwYrezwYdpPbAyVBsS2GFiy7.XD5E7+AFmMqP0vyC3eiA3blM+0ochuOym+spAHCBFBJTfDH3daBEIkXFgboYv9gIx1nLlAZyktwBXaiTiUPYiTiUxLR5ybBUezIoOONl4yh0.XRFOUsk4QnLsBIt2ODmocYaReft9QGG73+SPK5GNlUlhXVcJh4ESQLqMEwTcJhY8oHlMdzXvNE6N.ZGmbc.TzpQ7C.FFMjLfYEyBI+CXaTSSC
                    

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

                    LindonL 1 Reply Last reply Reply Quote 1
                    • LindonL
                      Lindon @d.healey
                      last edited by

                      @d-healey thanks for this - however this make no difference to the problem in the compiled version...its still randomly failing to change the colours on key press/release, especially for very fast key sequences...

                      HISE Development for hire.
                      www.channelrobot.com

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

                        @Lindon It works here compiled as standalone. Can you send me a MIDI file that triggers the glitchyness and I can try it in a plugin version. Which DAW are you testing in?

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

                        LindonL 1 Reply Last reply Reply Quote 0
                        • LindonL
                          Lindon @d.healey
                          last edited by

                          @d-healey - well I should have been more clear

                          • your example compiles and works fine
                          • but its missing a lot of functionality in that the colour set used changes based upon the number and sequence of samplers the user has inserted...
                          • so I added your "?" operator to my code and it still breaks - this may be because I'm changing the displayed colourset dynamically

                          I'm using the ever reliable Reaper by the way - not that this is the problem..

                          HISE Development for hire.
                          www.channelrobot.com

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

                            @Lindon If you can show me exactly what you're doing I can take a look. You could send me the project in a pm.

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

                            LindonL 1 Reply Last reply Reply Quote 0
                            • LindonL
                              Lindon @d.healey
                              last edited by

                              @d-healey sure I'll do that...

                              HISE Development for hire.
                              www.channelrobot.com

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

                              24

                              Online

                              1.8k

                              Users

                              12.1k

                              Topics

                              105.7k

                              Posts