HISE Logo Forum
    • Categories
    • Register
    • Login

    Panel animation movement

    Scheduled Pinned Locked Moved Solved General Questions
    28 Posts 5 Posters 1.1k 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.
    • S
      Sawer
      last edited by Sawer

      This post is deleted!
      S 1 Reply Last reply Reply Quote 0
      • S
        Sawer @Sawer
        last edited by

        @Sawer

        HiseSnippet 906.3ocsV8taaaCDmzIrnRqEnEXO.B4SJXsA1IsKCXHqtwIYvaKIByoAsepiQhNhHRjBTzM0XH.8InOS8QpuAcGIkrjSsCJLVMfMz8me28imt6niTxXVYoTgvdmMsfgvOfLZpPmNHkxEngGfv2mDoXkLMZ+oEzxRVBBiW62MVwdqire97K1mlQEwrFUHz4RdL6u34bci1n9+IOK6HZB6LddKueV+gwRw.YlbBvj0HcQEz3qnWxNgZbqCAgu2gIbsTMRS0rRDd88kISGkJuV37+bdI+hLlQnGZDDHm5ijYIFFazhFjxyRhpOwkHHJQMm+0bm+ejbLOgOSeSc3QVCAMHZWOvclmdqMG850ldcaQuEPIbKJstiROlLJVwKzMVL74GHCEZlZLEJ6sohyWTmO1gLPBdHzakSuhcjBDlgH74c69j.3mM+Ueeen1WpCdGUETHxdofGrWPMzKY5Ax7Bo.DB2vYdC.TCjHpfk0aoPbl2vlGe+wSDwZtTDHEmH0rSEga5+u9dt3tUolpzlNCU3NFl44eiuesMlNRVxMfCApaYu4qMvM9XQOflkcAz.EVmtprHKeCvyJmAZFtwTCwbF9o8B5YRo2BSn0kV4D7iONzp82.f6t6l9dPJbg5otP4Yj+lB1M9d5Td4VJVAztoCAc2XOX2tdMd7sJXxh4qWKo.CExfkEqaYy7ZTIyxfftHytzcG.CESxufodBzbjMgMyQnad9QDxxGQZOAG65pZ4nTLTv0mVvDKatFU0JBO8pgGP0TybUkNvuBlRyMT.e.6cvRJ2TlG4.V4UPA05aU+Kr2Qas9v5YPS6LhmX2KZasQuu8VuoyD9v48ulmnSmo3etoeJieYZy9vOk0etb4s7b4dgaxEAWkG2CU4ff2FDpiuShqY406T8t2eb8weAMm1saqtfp.NzhLyNenudiDrKTlLIipmeAo4VgJCPKwbakLadDv.vz12Z7+1VyuUJ9XRDWGmtXN1YAbDZb9dvwp6ZdH4vwiYw5FBtN4nW+84hEzeKmn4hKOlpUbSazISxGAMAwLH6B3EsYjD2wL73j6V2gMhIRrBeA9TYrmQFWYrWsQTNMVIearaQf41r6a0.bRXuH2ibrQNnGxtb.vQ5tUWTNbw5aiiMG+mB8aKFy1q.lcVALOaEv77U.yOuBX1cEv7K2IFy+o4kSzxb23.nH5P6FSL9PAE5rrcgn+Cfxi0KF
        

        Let's see if this works.

        Matt_SFM 1 Reply Last reply Reply Quote 0
        • S
          Sawer
          last edited by

          Content.makeFrontInterface(500, 500);
          
          
          const var pnlAni = Content.getComponent("pnlAni");
          const var Panel1 = Content.getComponent("Panel1");
          
          
          function onNoteOn()
          {
          	pnlAni.startTimer(30);
          	
          }
          
          
          
          pnlAni.setPosition(0, 0, 50, 50);
          
          
          pnlAni.setTimerCallback(function()
          {
          	var start = 0;
          	var end = 177;
          	var mover = pnlAni.get("y");
          	
          	if(mover >= start && mover <= end)
          	{
          		pnlAni.setPosition(0,mover , 50, 50);
          	}
          	
          	this.repaint();
          });
          
          
          function onNoteOff()
          {
          	pnlAni.stopTimer();
          	
          }
          
          

          Retrying with the panel.

          1 Reply Last reply Reply Quote 0
          • Matt_SFM
            Matt_SF @Sawer
            last edited by Matt_SF

            @Sawer said in Panel animation movement:

            @Sawer

            HiseSnippet 906.3ocsV8taaaCDmzIrnRqEnEXO.B4SJXsA1IsKCXHqtwIYvaKIByoAsepiQhNhHRjBTzM0XH.8InOS8QpuAcGIkrjSsCJLVMfMz8me28imt6niTxXVYoTgvdmMsfgvOfLZpPmNHkxEngGfv2mDoXkLMZ+oEzxRVBBiW62MVwdqire97K1mlQEwrFUHz4RdL6u34bci1n9+IOK6HZB6LddKueV+gwRw.YlbBvj0HcQEz3qnWxNgZbqCAgu2gIbsTMRS0rRDd88kISGkJuV37+bdI+hLlQnGZDDHm5ijYIFFazhFjxyRhpOwkHHJQMm+0bm+ejbLOgOSeSc3QVCAMHZWOvclmdqMG850ldcaQuEPIbKJstiROlLJVwKzMVL74GHCEZlZLEJ6sohyWTmO1gLPBdHzakSuhcjBDlgH74c69j.3mM+Ueeen1WpCdGUETHxdofGrWPMzKY5Ax7Bo.DB2vYdC.TCjHpfk0aoPbl2vlGe+wSDwZtTDHEmH0rSEga5+u9dt3tUolpzlNCU3NFl44eiuesMlNRVxMfCApaYu4qMvM9XQOflkcAz.EVmtprHKeCvyJmAZFtwTCwbF9o8B5YRo2BSn0kV4D7iONzp82.f6t6l9dPJbg5otP4Yj+lB1M9d5Td4VJVAztoCAc2XOX2tdMd7sJXxh4qWKo.CExfkEqaYy7ZTIyxfftHytzcG.CESxufodBzbjMgMyQnad9QDxxGQZOAG65pZ4nTLTv0mVvDKatFU0JBO8pgGP0TybUkNvuBlRyMT.e.6cvRJ2TlG4.V4UPA05aU+Kr2Qas9v5YPS6LhmX2KZasQuu8VuoyD9v48ulmnSmo3etoeJieYZy9vOk0etb4s7b4dgaxEAWkG2CU4ff2FDpiuShqY406T8t2eb8weAMm1saqtfp.NzhLyNenudiDrKTlLIipmeAo4VgJCPKwbakLadDv.vz12Z7+1VyuUJ9XRDWGmtXN1YAbDZb9dvwp6ZdH4vwiYw5FBtN4nW+84hEzeKmn4hKOlpUbSazISxGAMAwLH6B3EsYjD2wL73j6V2gMhIRrBeA9TYrmQFWYrWsQTNMVIearaQf41r6a0.bRXuH2ibrQNnGxtb.vQ5tUWTNbw5aiiMG+mB8aKFy1q.lcVALOaEv77U.yOuBX1cEv7K2IFy+o4kSzxb23.nH5P6FSL9PAE5rrcgn+Cfxi0KF
            

            @Sawer you have to write

            var posY = pnlAni.get("y");
            

            first thing in your timer callback (otherwise the 'posY' variable is not declared and the function won't work).

            And you can't 'define' the onNote / noteOff callbacks into the init callback. Use the dedicated tab for these :

            7e5451ed-429b-412a-a630-eb9f737d5b3e-image.png

            Develop branch
            Win10 & VS17 / Ventura & Xcode 14. 3

            S 1 Reply Last reply Reply Quote 0
            • S
              Sawer @Matt_SF
              last edited by

              @Matt_SF
              Thanks.
              That's what I'm consistently trying. The thing is that when I export the snippet, none of the code there appears. Don't know where I am mistaking.

              Matt_SFM 1 Reply Last reply Reply Quote 0
              • S
                Sawer
                last edited by

                Screen Recording 2022-03-09 at 15.36.08.gif

                Don't know why it's not going up even by setting up the conditional statement.. There's the problem I think.

                I tried also to use a while loop, without any positive outcome.

                1 Reply Last reply Reply Quote 0
                • Matt_SFM
                  Matt_SF @Sawer
                  last edited by

                  @Sawer which version of HISE (develop) are you using ? IIRC there was a lookalike bug a few commits ago... Try to compile a more recent version to see if that solves your problem.

                  Develop branch
                  Win10 & VS17 / Ventura & Xcode 14. 3

                  S 1 Reply Last reply Reply Quote 0
                  • S
                    Sawer @Matt_SF
                    last edited by

                    @Matt_SF
                    This is the latest on probably. I got it a month ago or less probably

                    Matt_SFM 1 Reply Last reply Reply Quote 0
                    • Matt_SFM
                      Matt_SF @Sawer
                      last edited by

                      @Sawer that's odd, because if you load the snippet I posted, the panel moves correctly when pressing a key. I simply moved the start/stop timer calls to the appropriate CB tabs.

                      Develop branch
                      Win10 & VS17 / Ventura & Xcode 14. 3

                      S 1 Reply Last reply Reply Quote 0
                      • S
                        Sawer @Matt_SF
                        last edited by

                        @Matt_SF
                        Uhm..
                        Does yours move backwards after reaching the final point?

                        Matt_SFM 1 Reply Last reply Reply Quote 0
                        • Matt_SFM
                          Matt_SF @Sawer
                          last edited by Matt_SF

                          @Sawer I just got it to move but if you want to move it back and forth you have to create another variable which holds the direction of the panel and change the direction when the panel reaches the value you want.

                          Try this :

                          HiseSnippet 931.3ocsV0saaaCElzIrnRaEXEXO.B4JEzl.4z1kBTTL23jL3skTg4tfsq5XjnsHhDo.EcSMJBvdN1E6Y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vkruMIwT96A5s0i4fM.yS1.LOcCv7rM.y2rAXNbCv77+ULl+eyqVnkEt1AvQ7I1IlX7IBJnrrpPz+.CNAw0B
                          

                          Develop branch
                          Win10 & VS17 / Ventura & Xcode 14. 3

                          S 3 Replies Last reply Reply Quote 1
                          • S
                            Sawer @Matt_SF
                            last edited by

                            @Matt_SF Ok thanks. 🙏
                            Will try the snippet in a bit.

                            1 Reply Last reply Reply Quote 0
                            • S
                              Sawer @Matt_SF
                              last edited by

                              @Matt_SF Man it works!!!
                              Will compare the code and give feedback on where I messed up. Thanks so much man!!

                              1 Reply Last reply Reply Quote 1
                              • S Sawer has marked this topic as solved on
                              • S
                                Sawer @Matt_SF
                                last edited by

                                @Matt_SF Hello man.
                                Thanks again for the snippet.
                                Trying to figure out how and why you got it right and what was missing on my side. I tried iterating through your code to understand it, but I'm still not getting it.

                                const var pnlAni = Content.getComponent("pnlAni");
                                const var Panel1 = Content.getComponent("Panel1");
                                
                                
                                
                                pnlAni.setPosition(0, 0, 50, 50);
                                
                                
                                pnlAni.setTimerCallback(function()
                                {
                                	var posY = pnlAni.get("y");
                                	
                                	if (posY == 0)
                                		posY++;
                                	
                                	else if (posY == 177)
                                		posY--;
                                		
                                	pnlAni.setPosition(0,posY , 50, 50);
                                	this.repaint();
                                });
                                

                                This is what I created based on your working snippet. It's not working and I'm not understanding why. Based on my logic, I think this code is right (which is totally not), and I want to understand why I think this is. What am I missing here?

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

                                  @Sawer look at your code:

                                  if posY == 0 -- do something...
                                  if posY == 177 do something...

                                  So assuming posY == 0 the first time, what happens then? and what does posY ==?

                                  HISE Development for hire.
                                  www.channelrobot.com

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

                                    @Lindon It does nothing. Because is neither equal to 0 or 177. True, thanks..

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

                                      @Sawer said in Panel animation movement:

                                      @Lindon It does nothing. Because is neither equal to 0 or 177. True, thanks..

                                      correct so try this:

                                      var summingValue = -1;
                                      
                                      pnlAni.setTimerCallback(function()
                                      {
                                      	var posY = pnlAni.get("y");
                                      	
                                      	if (posY == 0)
                                      		summingValue = 1;
                                      	
                                      	if (posY == 177)
                                      		summingValue = -1;
                                      
                                              posY = posY + summingValue;
                                      
                                      
                                      		
                                      	pnlAni.setPosition(0,posY , 50, 50);
                                      	this.repaint();
                                      });
                                      

                                      HISE Development for hire.
                                      www.channelrobot.com

                                      Matt_SFM 1 Reply Last reply Reply Quote 1
                                      • Matt_SFM
                                        Matt_SF @Lindon
                                        last edited by

                                        @Lindon I would never have thought of doing it like this. Nice 👍

                                        Develop branch
                                        Win10 & VS17 / Ventura & Xcode 14. 3

                                        S 1 Reply Last reply Reply Quote 0
                                        • S
                                          Sawer @Matt_SF
                                          last edited by

                                          @Lindon Thanks so much for the explanation and the new code!

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

                                          19

                                          Online

                                          1.7k

                                          Users

                                          11.9k

                                          Topics

                                          103.7k

                                          Posts