HISE Logo Forum
    • Categories
    • Register
    • Login

    Rotate an Image

    Scheduled Pinned Locked Moved General Questions
    35 Posts 9 Posters 4.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.
    • JayJ
      Jay @d.healey
      last edited by

      @d-healey thanks

      Joansi Villalona

      1 Reply Last reply Reply Quote 0
      • JayJ
        Jay @d.healey
        last edited by

        @d-healey is there any way to make a button to stop the rotation and if so what should I add?
        Any example?

        Joansi Villalona

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

          @Jay What is your end goal? i.e. why do you want a button to stop the rotation?

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

          JayJ 1 Reply Last reply Reply Quote 0
          • JayJ
            Jay @d.healey
            last edited by

            @d-healey let's say I want to make a plug-in with a bypass button that when I bypass it the rotation stop and when I enable it the rotation start.

            I don't know if it make sense.

            Joansi Villalona

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

              @Jay said in Rotate an Image:

              @d-healey let's say I want to make a plug-in with a bypass button that when I bypass it the rotation stop and when I enable it the rotation start.

              I don't know if it make sense.

              Well, do you understand the script I gave you? If you can see what starts the rotation you should be able to figure out how to stop it. I don't want to give you the answer, I want you to learn so you fully understand how it works.

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

              1 Reply Last reply Reply Quote 1
              • Dominik MayerD
                Dominik Mayer
                last edited by Dominik Mayer

                deskrotate.gif
                HISE Turntable Tapemachine?

                JayJ 3 Replies Last reply Reply Quote 4
                • JayJ
                  Jay @Dominik Mayer
                  last edited by

                  @Dominik-Mayer yes something like this

                  Joansi Villalona

                  1 Reply Last reply Reply Quote 0
                  • JayJ
                    Jay @Dominik Mayer
                    last edited by Jay

                    @Dominik-Mayer can I have the code ?

                    Joansi Villalona

                    1 Reply Last reply Reply Quote 0
                    • JayJ
                      Jay @Dominik Mayer
                      last edited by

                      @Dominik-Mayer ???

                      Joansi Villalona

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

                        @Jay said in Rotate an Image:

                        @Dominik-Mayer ???

                        Have you tried to understand the code I gave you? If so, which part are you struggling with?

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

                        1 Reply Last reply Reply Quote 0
                        • Dominik MayerD
                          Dominik Mayer
                          last edited by

                          Here is the script with a little embedded Task ;)
                          You can surely figure it out.

                          resource:
                          logo_new.png
                          save as logo_bw.png in the Images Folder of your project.

                          Content.makeFrontInterface(600, 500);
                          
                          const var Panel1 = Content.getComponent("Panel1");
                          const var Knob1 = Content.getComponent("Knob1");
                          const var Button1 = Content.getComponent("Button1");
                          
                          reg angle = 0;
                          reg speed = 0;
                          
                          Panel1.loadImage("{PROJECT_FOLDER}logo_bw.png", "test");
                          
                          Panel1.setPaintRoutine(function(g){
                              g.rotate(Math.toRadians(angle), [this.get("width")/2, this.get("height")/2]);
                              g.drawImage("test", [0, 0, this.get("width"), this.get("height")], 0, 0);
                          });
                          
                          Panel1.setTimerCallback(function(){
                              angle = (angle + speed) % 360;
                              this.repaint();
                          });
                          
                          
                          // Custom Callbacks for Knob1 and Button1
                          
                          inline function onKnob1Control(component, value)
                          {
                              // TASK: set something to the value of the Knob
                          };
                          Content.getComponent("Knob1").setControlCallback(onKnob1Control);
                          
                          
                          inline function onButton1Control(component, value)
                          {
                              if (value)
                              {  
                                  Panel1.startTimer(40);
                              }
                              else
                              {
                                  Panel1.stopTimer();
                              }
                          };
                          
                          Content.getComponent("Button1").setControlCallback(onButton1Control);
                          
                          HiseSnippet 1202.3ocsW0saaaCElxIpq1adXEnWrKILv.jwxRTZSyJZwvbiiyfWZRLhyJJvPQ.iDkLQjHEjnZh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56g2Y0ONzzdWZ14PgAXpYYd3oSsYaW9zgp.pvpOzVWLgtrxfecuoUB3dEMblsPO+d51MyV4286gpYplezvyk0e0uxT+QXu3ZiT72I+YL4xZh8jzKkpSYrp0DJSRSFy9MZ8YPxxCBX.FaabpOBcy.vcF2qwqmWmWbike.XYffyGOPm1Ccy2ngIED94vvSyO9fZlIyFPk9buSqdKlmwjSq6OKwLEt26YJtuz8Q1iXRuIKluMV.eU2R9elulIzZaOHHf5IqH6p1681O0wwVBpnGGHDdxOsnN6v73wv.qdTfIb3djpcjUC0EdsrqRVEYFS49EB+K7Y1bSkrkYyMK2DES7REm5o6XnlA7gEq.bhWLJbS6CTx3YMJT7NFFL8TOOUf36.luXDOYoQ7zkFwVKMhmszH1doQ78KMhmeGHT+JfWkCi6nuV.KLZPQCZKqAbBTUUTAh9Ojd9pJF
                          

                          Greetings,
                          d

                          orangeO 1 Reply Last reply Reply Quote 3
                          • orangeO
                            orange @Dominik Mayer
                            last edited by

                            @Dominik-Mayer Can we make this with animation image strips? It will loop the image strip. I tried but coulsn't figured it out. Please help...

                            develop Branch / XCode 13.1
                            macOS Monterey / M1 Max

                            ossian1961O 1 Reply Last reply Reply Quote 0
                            • ossian1961O
                              ossian1961 @orange
                              last edited by

                              @orange said in Rotate an Image:

                              @Dominik-Mayer Can we make this with animation image strips? It will loop the image strip. I tried but coulsn't figured it out. Please help...

                              So you don't need a rotate image function, just an amimated picture... isn't it?

                              https://www.kontakthub.com/label/Imagik-Sound/
                              https://mirtklaar.bandcamp.com/

                              orangeO 1 Reply Last reply Reply Quote 1
                              • orangeO
                                orange @ossian1961
                                last edited by orange

                                @ossian1961 Yes, definately.... Because I've allready made a rotated image animation inside the strip. I only need to loop it.

                                develop Branch / XCode 13.1
                                macOS Monterey / M1 Max

                                1 Reply Last reply Reply Quote 0
                                • ossian1961O
                                  ossian1961
                                  last edited by ossian1961

                                  I used do that on KSP... I never tried it on Hise, but I think it could be make a looped slider with buttons that handle on and off and fps into java script... @d-healey surely knows how do it ;)

                                  https://www.kontakthub.com/label/Imagik-Sound/
                                  https://mirtklaar.bandcamp.com/

                                  1 Reply Last reply Reply Quote 0
                                  • orangeO
                                    orange
                                    last edited by

                                    @Christoph-Hart @d-healey Is it possible to make an animated image strip loop view? It will loop from first to last frame, over and over again.

                                    develop Branch / XCode 13.1
                                    macOS Monterey / M1 Max

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

                                      @orange Almost certainly but I've never done it

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

                                      1 Reply Last reply Reply Quote 0
                                      • Christoph HartC
                                        Christoph Hart
                                        last edited by

                                        The & operator is your friend here...

                                        orangeO 1 Reply Last reply Reply Quote 1
                                        • orangeO
                                          orange @Christoph Hart
                                          last edited by

                                          @Christoph-Hart @d-healey Do you mean I should use && operator in an "if else" conditional statement?

                                          develop Branch / XCode 13.1
                                          macOS Monterey / M1 Max

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

                                            @orange & is not the same as && - https://www.w3schools.com/js/js_operators.asp

                                            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

                                            65

                                            Online

                                            1.7k

                                            Users

                                            11.7k

                                            Topics

                                            102.2k

                                            Posts