HISE Logo Forum
    • Categories
    • Register
    • Login

    Scale the "global_cable" from value 0. - 1. to 0. 300.

    Scheduled Pinned Locked Moved ScriptNode
    7 Posts 3 Posters 133 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.
    • R
      Rognvald
      last edited by

      I am attempting to scale the "global_cable" output value 0. - 1. to 0. 300.
      to control a Lottie animation.

      been searching for hours for an answer.. :(

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

        @Rognvald multiply with 300?

        R 1 Reply Last reply Reply Quote 0
        • R
          Rognvald @Christoph Hart
          last edited by

          @Christoph-Hart Thanks Christoph! yes that will work, would this be in the Scriptnode or a call back script?
          Whats the most common way to scale control values in Hise. I am coming from Max Msp..

          ustkU 1 Reply Last reply Reply Quote 0
          • ustkU
            ustk @Rognvald
            last edited by

            @Rognvald Cable should alway transmit a 0-1 data range. Meaning that if the data is coming from scriptnode at let say, a 0-300 range value, you should first divide it by 300 in scriptnode, then send it thorough the cable, then rescale in the interface (or anywhere else) if needed

            Hise made me an F5 dude, browser just suffers...

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

              I meant in the script callback where you set the animation frame.

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

                Like this:

                HiseSnippet 1283.3ocuW8zaaaCEmxIJY1oaXEnXmE5Img.W60+rATLzj3D2YrlDiprfdKfgh1lvTjBTzIwan26sctm19Lra6a09Fz8dhx1RwoYMFqQGLLe+i+3i+dumTOilwSS0FhW0imjvId2yObhxNr8PpPQ5tGw6q7OflZ4l.mncmjPSS4QDOuUdIJvq5pjrm+4E6RkTEiOWDgbhVv3uRDKryk1a6eVHkcnQ7iEwEr9Ia2koUs0R8X.Oq32jjPYinC3GRQyp3S7Va+HgUaB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jf4AUD+xoD68gZyHXtSl6SI6y1Hz+UlsBxIGHT4Ysrtq+46e+e+hCnWVTFgr8uucnkmfsOJZW3H9EtrYw4GtakdbiPGk8JkKDKxM.frmE..D1q.frmON.1v+UZcBzIxXIKD96f8eMXrq8pGcPGo.e7JjgR7xuw235A1njMeLJZ0057Wu6C25RmBbzbjlWibcT5xjHuB4v0+7jCmVPrPX1YrUCufp68CJAqxK1UqGESy5rubui0cwbnXJynOk4FshY1uHSBb4ox9PqpvW7AqCZQN+po3X3CgNkwJGpEb76VVGe7x53SVVGe5x53yVVG+9k0we3+1Q76TyopXEFTRzaeWWYu8UX4bVYL4eAPwssML
                
                1 Reply Last reply Reply Quote 0
                • R
                  Rognvald
                  last edited by

                  Thanks for your time guys!
                  this is the script that got things running smooth. :)

                  const var snailFader = Content.getComponent("snailFader");
                  snailFader.setAnimation(lottie);
                  
                  const lottieData = snailFader.getAnimationData();
                  
                  // Snail Slider to Control Knob / hidden
                  
                  Content.getComponent("KNsnailFader").setControlCallback(onKNsnailFaderControl);
                  
                  const var KNsectionKnob1 = Content.getComponent("KNsectionKnob1");
                  
                  inline function onKNsnailFaderControl(component, value)
                  {
                  	snailFader.setAnimationFrame(value);
                  	KNsectionKnob1.setValue(value * 0.0033);
                  	KNsectionKnob1.changed();
                  };
                  
                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post

                  23

                  Online

                  1.9k

                  Users

                  12.4k

                  Topics

                  108.2k

                  Posts