HISE Logo Forum
    • Categories
    • Register
    • Login

    LAF KEYS! GOING GREAT!

    Scheduled Pinned Locked Moved Scripting
    7 Posts 2 Posters 90 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 Chazrox

      jk. 😆 Just wanted to share this beauty. 😆

      Any tips on getting these dimensions right off top?

      Any advice is appreciated! I really just wanted to share this because it looks goofy. lol

      Hope everyone's having a great day!

      So far the white keys are responsive to midi input but mouse click bounds are off. I tried setting the area for the key but that resulted in only one key being drawn (does that mean I have to loop all the white keys per this method?). I guess this would solve the issue for black keys also if I figured this out. I'll return if I figure it out.
      Screenshot 2025-05-10 at 6.12.52 PM.png

      Check it out:

      HiseSnippet 1432.3oc2XstSabDEdVCaTsSuk1np9ysVUUlJpkMDHjFUE.eIwEC1x1DZ6ePC6dV6ordls6NFhUDui8QnOB4Mn8Ly5K6BanFqzF0BRHeNm4bYN2lOS6.gMDFJBHF45M1GHFenY2wb4fJCnLNoQUhwma1j5Z0AndVG.iOSPCbH6O1mFFBNDCiUdt5fFYWkn+4MOaepGkaCyYQHuTvrglrgL4bts28.lmWcpCziML1oeztMrE7JBOwHLnVwrDwmZeNsObDUcrLljWPCGPL9VyM1v0dmRk1YyM2pDktoCk9nxvlOAb210dqROojyYaUB+cahw8p4vjhftRpDBQituvYb2AhK4QN3krP1YdfhnLoK54H1jJCXdNsmlgBIDCy1yyWqDkudn4gLG1L9yyaepVf0bMhmzLxbagT46PHYDKjVMJjdfYW6.lubtDU7beyFbID3RwZS7PI5rjL6XZVQfmfKKNjdNTO.IloQgsKUZcK7Oq8zb4xgEnPo0Ez.q5dBpjw62i4Aks9AqoVnOHqHF5K3HQg7INUdzDyM.1acpp2BasBiouc.fIllBapWSg3783N0Avqfx6w0nX.zmEhwX8QbaISvKj2Ifd4ICXR3HgDxutk6TI8WWb1utVtWmKqxuTzY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+tarW4+2ar6HFo.fcHEaBQ7WlHZlt3hRaXxa2gpWnynV1EQWRQGsoj6nI9S7mIBKqnMlHr7Tg+q3igT6.wo1QXpU8oeflCdu45+EOYMOTQaUlnwYGuVND2xcpscRScCE2XYUbykUwGsrJt0xp31KqhOdYUbm+dEUOBs2HDubznIgfXK0.zMLpwoXWtdhf7WITgpiC
      
      Content.makeFrontInterface(600, 600);
      
      
      const var FloatingTile1 = Content.getComponent("FloatingTile1");
      const var Laf_RealKeys = Content.createLocalLookAndFeel();
      
      Laf_RealKeys.registerFunction("drawWhiteNote", function(g,obj)
      {
      	var a = obj.area;
      	var WhiteUp = Laf_RealKeys.loadImage("{PROJECT_FOLDER}WHITE KEY - UP.png", "WHITE KEY - UP.png");
      	var WhiteDown = Laf_RealKeys.loadImage("{PROJECT_FOLDER}WHITE KEY - DOWN.png", "WHITE KEY - DOWN.png");
      	
      	if (obj.down)
      	{
      		g.drawImage("WHITE KEY - DOWN.png", a, 0, 0);
      	}
      	if (!obj.down)
      	{
      		g.drawImage("WHITE KEY - UP.png", a, 0, 0);		
      	}
      });
      Content.getComponent("FloatingTile1").setLocalLookAndFeel(Laf_RealKeys);
      
      
      Laf_RealKeys.registerFunction("drawBlackNote", function(g,obj)
      {
      	var a = obj.area;
      	var BlackUp = Laf_RealKeys.loadImage("{PROJECT_FOLDER}BLACK KEY - UP.png", "BLACK KEY - UP.png");
      	var BlackDown = Laf_RealKeys.loadImage("{PROJECT_FOLDER}BLACK KEY - DOWN.png", "BLACK KEY - DOWN.png");
      	
      	if (obj.down)
      	{
      		g.drawImage("BLACK KEY - DOWN.png", a, 0, 0);	
      	}
      	if (!obj.down)
      	{
      		g.drawImage("BLACK KEY - UP.png", a, 0, 0);	
      	}
      	
      });
      Content.getComponent("FloatingTile1").setLocalLookAndFeel(Laf_RealKeys);
      
      
      d.healeyD 1 Reply Last reply Reply Quote 0
      • d.healeyD
        d.healey @Chazrox
        last edited by

        @Chazrox said in LAF KEYS! GOING GREAT!:

        Any tips on getting these dimensions right off top?

        Use the default values in obj.area as the starting point

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

        ChazroxC 2 Replies Last reply Reply Quote 0
        • ChazroxC
          Chazrox @d.healey
          last edited by Chazrox

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • ChazroxC
            Chazrox
            last edited by

            Got it.

            Screenshot 2025-05-10 at 11.37.47 PM.png

            1 Reply Last reply Reply Quote 0
            • ChazroxC
              Chazrox @d.healey
              last edited by Chazrox

              @d-healey Originally I was trying to draw in a shadow image under the black keys but that seems to throw everything off. I took the shadows off and its good now. Does this drawing function only accept one instance of "g.drawImage()"?

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

                @Chazrox You should be able to draw as many images as you like. If you're using images though you don't need to use laf for this. You can use the CustomGraphics property and HISE will automatically use your images - https://docs.hise.audio/ui-components/floating-tiles/plugin/keyboard.html

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

                ChazroxC 1 Reply Last reply Reply Quote 1
                • ChazroxC
                  Chazrox @d.healey
                  last edited by

                  @d-healey Wow...

                  ok. Thats way easier. I wish I would have known this a few hours ago. lol eh.

                  Thanks!
                  (for the next one)
                  Screenshot 2025-05-11 at 2.39.49 AM.png

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

                  41

                  Online

                  1.7k

                  Users

                  11.7k

                  Topics

                  102.0k

                  Posts