HISE Logo Forum
    • Categories
    • Register
    • Login

    Help with displaying knob value in a label

    Scheduled Pinned Locked Moved Solved Scripting
    18 Posts 3 Posters 859 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.
    • M
      Mighty23
      last edited by

      @d-healey I'm developing a plugin for volume control using a table, but this doesn't affect the issue discussed in the post. The other control the user has is on the tempo-synced frequency. I need a label because I might also expand the UI and use the label values to indicate each position transparently above the table dynamicaly. A Volume Shaper-like vst.

      I've tried to correct the code without much success

      // Get the reference to the label and knob in user interface
      const var tempoLabel = Content.getComponent("tempoLabel");
      const var tempoKnob = Content.getComponent("tempoKnob");
      
      // Define the callback function for the knob control
      inline function onTempoKnobControl(component, value)
      {
          // Update the text of the label with the value of the knob
          tempoLabel.set("text", value); 
      }
      
      // Set the control callback for the knob
      tempoKnob.setControlCallback(onTempoKnobControl);
      
      

      Free Party, Free Tekno & Free Software too

      d.healeyD M 2 Replies Last reply Reply Quote 0
      • d.healeyD
        d.healey @Mighty23
        last edited by

        @Mighty23 If you have linked the knob to a module using processor/parameter ID (as indicated in your original post) then your callback won't fire.

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

        1 Reply Last reply Reply Quote 0
        • M
          Mighty23 @Mighty23
          last edited by

          @d-healey I can't understand what you're trying to tell me. In JUCE, I use labels to indicate the values of knobs (rotary sliders) without any issues, but I can't grasp the logic you're advising me to use.
          (I think I'm more confused now than at the beginning of the post :grinning_face_with_sweat: )

          I have linked the knob to a module using parameterID to control the Frequency, so I can't use a callback? How should I proceed then?

          Free Party, Free Tekno & Free Software too

          LindonL d.healeyD 2 Replies Last reply Reply Quote 0
          • LindonL
            Lindon @Mighty23
            last edited by

            @Mighty23 move the knob....

            HISE Development for hire.
            www.channelrobot.com

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

              @Mighty23 to have a callback fire you must set the proccessorId to blank

              e34846bc-4d00-4d74-b644-031bdf343719-image.png

              now you cna use a callback - to both set the laebel text AND set your back-end Frequency.....

              what David is about to say...

              HISE Development for hire.
              www.channelrobot.com

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

                @Mighty23 said in Help with displaying knob value in a label:

                I have linked the knob to a module using parameterID to control the Frequency, so I can't use a callback?

                Correct.

                Unlink the knob from processor/parameter ID and instead set the attribute you were trying to control from within the control callback.

                Edit: What Lindon said.

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

                1 Reply Last reply Reply Quote 0
                • M
                  Mighty23 @Lindon
                  last edited by

                  @Lindon said in Help with displaying knob value in a label:

                  @Mighty23 move the knob....

                  If you're suggesting moving the knob to see the result displayed in the label, the answer is: no.

                  Free Party, Free Tekno & Free Software too

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

                    @Mighty23 said in Help with displaying knob value in a label:

                    @Lindon said in Help with displaying knob value in a label:

                    @Mighty23 move the knob....

                    If you're suggesting moving the knob to see the result displayed in the label, the answer is: no.

                    read what we have said first...

                    HISE Development for hire.
                    www.channelrobot.com

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

                      here... liker this:

                      const var Filter1 = Synth.getEffect("Filter1");
                      
                      // Get the reference to the label and knob in user interface
                      const var tempoLabel = Content.getComponent("tempoLabel");
                      const var tempoKnob = Content.getComponent("tempoKnob");
                      
                      // Set the control callback for the knob
                      tempoKnob.setControlCallback(onTempoKnobControl);
                      
                      // Define the callback function for the knob control
                      inline function onTempoKnobControl(component, value)
                      {
                          // Update the text of the label with the value of the knob
                          tempoLabel.set("text", value); 
                         // Update the freq
                         Filter1.setAttribute(Filter1.Frequency, value);
                      }
                      

                      HISE Development for hire.
                      www.channelrobot.com

                      1 Reply Last reply Reply Quote 0
                      • M
                        Mighty23
                        last edited by

                        I managed to display the usual knob value on the label, but since it's no longer linked to the processor ID, the two values range from 0 to 18.0 (this is quite-okay). Now I need to reconnect the knob with its corresponding backend.

                        <?xml version="1.0" encoding="UTF-8"?>
                        
                        <Processor Type="LFO" ID="LFOModulator1" Bypassed="0" Intensity="1.0" Frequency="18.0"
                                   FadeIn="43.13000106811523" WaveformType="6.0" Legato="1.0" TempoSync="1.0"
                                   SmoothingTime="5.690000057220459" LoopEnabled="1.0" PhaseOffset="0.0"
                                   SyncToMasterClock="1.0" IgnoreNoteOn="0.0" CustomWaveform="24..........9C...vO...f+....9C...vO"
                                   StepData="64....f+....9C...3O...f+....9C...3O...f+....9C...3O...f+....9C...3O...f+....9C...3O...f+.">
                          <EditorStates BodyShown="1" Visible="1" Solo="0"/>
                          <ChildProcessors>
                            <Processor Type="ModulatorChain" ID="LFO Intensity Mod" Bypassed="0" Intensity="1.0">
                              <EditorStates BodyShown="1" Visible="1" Solo="0" Folded="1"/>
                              <ChildProcessors/>
                            </Processor>
                            <Processor Type="ModulatorChain" ID="LFO Frequency Mod" Bypassed="0" Intensity="1.0">
                              <EditorStates BodyShown="1" Visible="0" Solo="0" Folded="1"/>
                              <ChildProcessors/>
                            </Processor>
                          </ChildProcessors>
                        </Processor>
                        

                        Free Party, Free Tekno & Free Software too

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

                          @Mighty23 Lindon shows how to do this in his last post. Filter1.setAttribute...etc

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

                          1 Reply Last reply Reply Quote 0
                          • M
                            Mighty23
                            last edited by

                            Ok, done. Many Thanks, We can mark it as "Solved"

                            Free Party, Free Tekno & Free Software too

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

                              @Mighty23 said in Help with displaying knob value in a label:

                              We can mark it as "Solved"

                              Click this button and select Ask a question. Then click it again and select solved.

                              6c38e55d-e93d-496e-bdf9-5cc05e67218d-image.png

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

                              1 Reply Last reply Reply Quote 1
                              • M Mighty23 marked this topic as a question on
                              • M Mighty23 has marked this topic as solved on
                              • First post
                                Last post

                              14

                              Online

                              1.8k

                              Users

                              12.1k

                              Topics

                              105.8k

                              Posts