HISE Logo Forum
    • Categories
    • Register
    • Login

    Display TimeSync Value 1/2, 1/2 dotted , 1/4 triplt via Label

    Scheduled Pinned Locked Moved General Questions
    12 Posts 4 Posters 481 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.
    • DabDabD
      DabDab
      last edited by DabDab

      How can I display Time synced value (e.g Delay time) via Label ? 1/1, 1/2, 1/2 dotted, 1/4 triplt etc ?

      Bollywood Music Producer and Trance Producer.

      M_HollowayM LindonL 2 Replies Last reply Reply Quote 0
      • M_HollowayM
        M_Holloway @DabDab
        last edited by

        @DabDab There are probably other ways to do it but I've done it by putting them into an array. The knob outputs discrete integer values so you can just set the "text" value of the label in the callback but using the "value" returned.

        inline function myCallback(component, value)
        {
                   label.set("text", myArray[value]);
        }
        
        DabDabD 1 Reply Last reply Reply Quote 0
        • LindonL
          Lindon @DabDab
          last edited by Lindon

          @DabDab set up an array of the string values:

          const mySyncText = ["1Bar","1/2D","1/2""1/2T",...etc]
          

          then set the label text:

          mySyncLabel.set("text", mySyncText[mySyncControl.getValue()]);
          
          

          HISE Development for hire.
          www.channelrobot.com

          DabDabD 1 Reply Last reply Reply Quote 0
          • DabDabD
            DabDab @M_Holloway
            last edited by

            @M_Holloway Okay, I will try it.

            Bollywood Music Producer and Trance Producer.

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

              @Lindon said in Display TimeSync Value 1/2, 1/2 dotted , 1/4 triplt via Label:

              mySyncLabel.set("text", mySyncText[mySyncControl.getValue()]);

              MySyncControl is Knob right?

              Will I write it inside label CB?

              Bollywood Music Producer and Trance Producer.

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

                @DabDab yes, yes

                HISE Development for hire.
                www.channelrobot.com

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

                  10f33f6b-09c8-4963-8f04-8e8189f0987a-image.png

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

                  M_HollowayM 1 Reply Last reply Reply Quote 0
                  • M_HollowayM
                    M_Holloway @d.healey
                    last edited by

                    @d-healey Nice, every day is a school day 😆... off to go deleting some arrays now...

                    1 Reply Last reply Reply Quote 1
                    • DabDabD
                      DabDab
                      last edited by DabDab

                      I didn't figure out How to use the getTemponame function. I had seen it in API browser but there is no clue or an Example.

                      I have another question... @d-healey @Lindon @M_Holloway How can i switch between temposync and frequency ? right now it is only showing tempo synced value.

                      inline function onTempoLeftControl(component, value)
                      {
                      	Delay1.setAttribute(Delay1.DelayTimeLeft, value);
                         reg tempos = ["1/1", "1/2D", "1/2", "1/2T", "1/4D","1/4","1/4T","1/8D","1/8","1/8T","1/16D","1/16","1/16T","1/32D","1/32","1/32T","1/64D","1/64","1/64T"];
                         TempLblL.set("text", tempos[value]);			
                      	
                      };
                      
                      Content.getComponent("TempoLeft").setControlCallback(onTempoLeftControl);
                      

                      Bollywood Music Producer and Trance Producer.

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

                        @DabDab said in Display TimeSync Value 1/2, 1/2 dotted , 1/4 triplt via Label:

                        I didn't figure out How to use the getTemponame function.

                        Engine.getTempoName(put your knob's value here);

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

                        1 Reply Last reply Reply Quote 1
                        • M_HollowayM
                          M_Holloway @DabDab
                          last edited by M_Holloway

                          @DabDab

                          Something like this should do it...

                          const var myKnob = Content.getComponent("myKnob");
                          const var myLabel = Content.getComponent("myLabel");
                          
                          inline function onmyButtonControl(component, value)
                          {
                          	if(value)
                          		myKnob.setMode("TempoSync");
                          	else
                          		myKnob.setMode("Frequency");
                          };
                          
                          Content.getComponent("myButton").setControlCallback(onmyButtonControl);
                          
                          
                          inline function onmyKnobControl(component, value)
                          {
                          	local mode = myKnob.get("mode");
                          	if(mode == "TempoSync")
                          		myLabel.set("text", Engine.getTempoName(value));
                          	else
                          		myLabel.set("text", value + " Hz");
                          		
                          };
                          
                          Content.getComponent("myKnob").setControlCallback(onmyKnobControl);
                          
                          DabDabD 1 Reply Last reply Reply Quote 1
                          • DabDabD
                            DabDab @M_Holloway
                            last edited by

                            @M_Holloway Nice... Very cool. Thank you so much.

                            Bollywood Music Producer and Trance Producer.

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

                            48

                            Online

                            1.7k

                            Users

                            11.7k

                            Topics

                            102.0k

                            Posts