HISE Logo Forum
    • Categories
    • Register
    • Login

    dB meter

    Scheduled Pinned Locked Moved General Questions
    26 Posts 3 Posters 919 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.
    • U
      udalilprofile
      last edited by

      const timer = Engine.createTimerObject();
      
      const var Input = Synth.getEffect("Input");
      
      const var Label1 = Content.getComponent("Label1");
      
      timer.setTimerCallback(function()
      {
      	
      	Label1.set("text", Math.round(Engine.getDecibelsForGainFactor(Input.getCurrentLevel(1))) + "dB");
      	
      });
      
      timer.startTimer(100);
      

      Hi) I have the code and this indicator. How can I make it disappear over time?

      111111.jpeg

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

        @udalilprofile I wouldn't use a timer and label for this. Use the built in peak meter floating tile and look and feel.

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

        U 1 Reply Last reply Reply Quote 0
        • U
          udalilprofile @d.healey
          last edited by

          @d-healey Peak meter floating doesn't work for me. I can't start it. No reactions.

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

            @udalilprofile

            HiseSnippet 1290.3oc2Ws0aaTDEdVmrUXWnPQUHdbzJdvELQ1k1BhJTct4JKhasx5zVopppI6d7lAu6LKyNNIlpHwOQ9oz+AkyL653carBoV.Ufevxmay7ctNGOTICfrLoh3TezrTf37wt9yD5i19HFWP5uCw4FtCXYZPQyYs0rTVVFDRbbV6QFFN0WmX+7lGtEKlIBfErHjmJ4Avd7DtdA2gc+YdbbOVHLhmTR661sefTrsLVNEwyZtsIorfIrH3wLiZ0bINWa2PtVp70LMjg5rkLbl+QxSD45+TdF+vXvPzg3iGTNax1GwiCGN2WyHDG2gK770x87a4NfGxOm+hHvmYEPWXQ4XfSsKCRcdOfjSIHsdNjtoqefhmpWHwfmq61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Jm02Gv2ohh.UYruTGZSsF28dAma0ceHFXkqf+pt6gUdLEFmfULV79uQ7RyWeoaNboltQ5+cmXu1+umXuubpY2p7kkv+B1imlTcuAjmSMyvtb51F57IkhPKwawOEB6XncJD1Ytv+UtiDVfR9pf70kM0oejkC52B6eTsNtOHRS6PrqPWNWlfS4dUPP0i5BFdmU0vuaUM7tqpg2aUM79qpge+pZ3O7Wan4QnMmpkI4slDxfg6ZWE2wYWACqxscDj+jEO069
            

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

            U 1 Reply Last reply Reply Quote 0
            • U
              udalilprofile @d.healey
              last edited by

              @d-healey super! Thank you! How can I make the indicator invisible? when sound arrives, a meter appears; when there is no sound, the numbers disappear. The number -100 is always displayed. But I’m trying to figure out how to make it appear when there is sound.

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

                @udalilprofile You could change the text colour alpha value in the laf function based on the peak value. Or you could use an if statement that checks the peak value and only if it's above -100 draw the text.

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

                U 1 Reply Last reply Reply Quote 0
                • U
                  udalilprofile @d.healey
                  last edited by

                  @d-healey Can you help with this? Please.)

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

                    @udalilprofile Do you know what an if statement is?

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

                    U 1 Reply Last reply Reply Quote 0
                    • CatABCC
                      CatABC @udalilprofile
                      last edited by

                      @udalilprofile

                      	if (dB > -100)
                      		
                      	g.drawAlignedText(Engine.doubleToString(dB, 1) + "dB", a, "centred");
                      

                      //I am a new student at HISE._
                      //Windows11 & MacOS Ventura 13.6.7_

                      1 Reply Last reply Reply Quote 0
                      • U
                        udalilprofile @d.healey
                        last edited by

                        @d-healey I'm just learning. )

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

                          @udalilprofile Cool, start here - https://docs.hise.dev/scripting/scripting-in-hise/javascript.html

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

                          U 1 Reply Last reply Reply Quote 0
                          • U
                            udalilprofile @d.healey
                            last edited by

                            @d-healey Thank you. I'm only 11 years old. I want to create music software.

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

                              @udalilprofile I think you must be the youngest member here :) you should pick it up pretty quickly I think.

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

                              U 2 Replies Last reply Reply Quote 0
                              • U
                                udalilprofile @d.healey
                                last edited by

                                @d-healey I'm trying. Thanks for your help

                                1 Reply Last reply Reply Quote 0
                                • U
                                  udalilprofile @d.healey
                                  last edited by

                                  @d-healey Can I ask you again? I already used const laf = Content.createLocalLookAndFeel(); to configure combobox. Can I use two functions? Or how is this problem solved?IMG_0764.jpeg

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

                                    @udalilprofile You give each variable a different name. Something like const comboBoxLaf, const peakMeterLaf

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

                                    U 1 Reply Last reply Reply Quote 0
                                    • U
                                      udalilprofile @d.healey
                                      last edited by

                                      @d-healey I couldn't get a numeric indicator. I now have a vertical indicator.

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

                                        @udalilprofile Post a snippet

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

                                        U 4 Replies Last reply Reply Quote 0
                                        • U
                                          udalilprofile @d.healey
                                          last edited by

                                          This post is deleted!
                                          1 Reply Last reply Reply Quote 0
                                          • U
                                            udalilprofile @d.healey
                                            last edited by

                                            This post is deleted!
                                            1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            11

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            103.2k

                                            Posts