HISE Logo Forum
    • Categories
    • Register
    • Login

    how do I set the value to an object/component in a different script processor?

    Scheduled Pinned Locked Moved Scripting
    6 Posts 4 Posters 124 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.
    • CyberGenC
      CyberGen
      last edited by CyberGen

      Hi,

      Little problem. I'm trying to control my UI pitchwheel knob from a different script processor. I used to have a const car reference, and it worked fine. like so:

      if (Message.getControllerNumber() == 128)
      {
      	var PitchMod = (Message.getControllerValue());
      	Interface.setAttribute(Interface.pitchWheel, PitchMod);		
      }
      

      But in a new project I have all my UI elements as parts of one object and this set attribute approach does not work anymore. I would think this would work but it's not.

      if (Message.getControllerNumber() == 128)
      {
      	var PitchMod = (Message.getControllerValue());
      	Interface.setAttribute(Interface.KEYBOARD.UI.wheel.pitch, PitchMod);		
      }
      

      My question is how do I setValue() to an object in a different script processor?

      clevername27C Matt_SFM d.healeyD 3 Replies Last reply Reply Quote 0
      • clevername27C
        clevername27 @CyberGen
        last edited by

        @CyberGen Global variable is one way.

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

          @CyberGen A simple example:

          HiseSnippet 922.3oc6V0saaaCElzwbsQqqnEsO.B9Jmgh.KO2DODLDm3jrZzlTipzrtqJnoniIrDofDU2bGJvtXOH6QYXOB6pd41avtoW2cnjbjTr6eFK2Ucg.342Od32gGNLRw3wwpHD15zYgbD9FD2YR8j9SnBIZvAH7MIGSi07H6LQ6OKjFGy8PX7ZeuQ.d85nzu+c28o9TIiWHBgNSIX7GIBD5BoC68Pgu+QTO9ohfRV2o2.lR1W4qR.7rFoEJjxlROmeB0XVMB5Az3IH7WS7b53LtKitUWmNsYr1c2t82tMiSGOluky82tS2wcFSYsZivewgdBsJxUS07XDt99JuYtST+jLKAmIhEi74lENHWHyYhOR46Y1hFon9SD9dCmWnhQPTFVT1VKqrcWxwBOwExKJe2JUgcgGkKf3ZUg2ZUfmSY30pD7VBjpUBR0yfzsItrHQntPiAOeIYfDNMgxCuBTxrEU6uvj9JvBody.5T9QQvhK7n4VsZcOa32F6XYAmUwZ6WPiruTdbr+N6TRzlmy0UJKMajYZQ4vogITVBouPxsGmHYZgRZqjOTpF4XPRjxuISEDpj.ltGjO+D9FV+h05WNqaFy06o0QhQIZdyEzNEB3OpR9ApTep5QB4z4wZGqWAPX9lFfb+4YqYiTTzXCSnywRepu+HfV1rJDgnTB7mnz7GKalBSqWYYeYUiGuTc4wxmGsT0ltkn2miMkIAi3QkKRFCAFQUZF4cSyJ2EvxJIkLTIGHE5GGxkuqdCTdcDnj3bTAlpSIj2LmP55K73QHAv6tFIsHhRAb9MA+5e9l+dWzSGb.USmGFHhPVB4QZgYCfOf+B3dkLd95jC3wS0pvTayO5fM4GLo+bwUOzdytXwuOpGbeWnq3kyQTu+4k+1tnO1Nr6PVfjurNM7qIEcPF.AcMKmDt.yMsm4yzsOc51cHKTKuJnd0+j.PAM7ONqDMD0n2Rnbv3DkWhOUWcFiYRbtB3HpBcyb4sLVnmUdR8+aCd9Xg3sICEZ1jkiwZKAilYZWAXLeb8WQNDdq.SW.v5jid1UyrYzSTIZg77iovrI3vlbRRfK7DGFGxtTx8MsH3ZFxb15Vl0lJfKW5kt3svWtRGyZbtRm4JQATVj54rrV.yCBtdpD.SxzGOsN7JNXsc0qZS+BfIzOmwpFpEbr8p532rpN1YUc79qpiaspNt8p5X2OrilGPsWhVEj01fPGO7vz6mv3CkTfAlxVQ+GmUMX0C
          

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

          CyberGenC 1 Reply Last reply Reply Quote 1
          • d.healeyD
            d.healey @CyberGen
            last edited by d.healey

            @CyberGen said in how do I set the value to an object/component in a different script processor?:

            I'm trying to control my UI pitchwheel knob from a different script processor

            Keep the two things separate. UI does one job, your other script does another. The two don't need to be able to talk to each other.

            In your UI's on controller callback you put the code that handles the UI stuff. In your other script's on controller callback you put the code that handles the realtime stuff.

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

            CyberGenC 1 Reply Last reply Reply Quote 1
            • CyberGenC
              CyberGen @d.healey
              last edited by

              @d-healey Thanks, Wishing you a speedy recovery.

              1 Reply Last reply Reply Quote 1
              • CyberGenC
                CyberGen @Matt_SF
                last edited by

                @Matt_SF Thank you for this example. My old code worked in this way. The issue is that now I am not declaring knobs in the standard Content.getComponent() way. I'm using objects. As in reg UIObjects = {}; and these do not seem to be added as attributes to their parent script like normal const var do. I was wondering if there was a different way that wouldn't require the use of const var nor global references.

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

                47

                Online

                1.7k

                Users

                11.7k

                Topics

                101.9k

                Posts