HISE Logo Forum
    • Categories
    • Register
    • Login

    vuuuu meter.... vu meter? vu meter master?

    Scheduled Pinned Locked Moved General Questions
    54 Posts 11 Posters 4.4k 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.
    • Casey KolbC
      Casey Kolb
      last edited by Casey Kolb

      Hmm, wine is never a bad thing :smiling_face_with_heart-eyes:

      Sounds like the design for the VuMeter you want won't really work with the VuMeter script because you're using image and the script is using graphics to draw the lines.

      However, it's totally possible and you can easily adapt the VuMeter script to update the film strip value rather than draw lines based on the value.

      These functions will be your best friend in this situation. You need to grab the value of the left and right, and then update the position of each film strip based on those values.

      lvalue = getNormalizedPeakValue(Engine.getMasterPeakLevel(0));
      rvalue = getNormalizedPeakValue(Engine.getMasterPeakLevel(1));
      

      Here's a great example for how you can draw filmstrips using the graphics module:
      https://docs.hise.audio/scripting/scripting-in-hise/scriptpanel.html#a-six-state-button

      You'll need to pull some code from there and embed it in the VuMeter for your design to work.

      Casey Kolb
      Founder & CEO of Lunacy Audio
      Composer | Producer | Software Developer

      Y 1 Reply Last reply Reply Quote 0
      • lalalandsynthL
        lalalandsynth
        last edited by

        An interesting trick that sometimes saves time is to use just a static image of the meter and use an inverted Vector meter on top of it to reveal the meter , which looks like its animating up and down.

        https://lalalandaudio.com/

        https://lalalandsynth.com/

        https://www.facebook.com/lalalandsynth

        https://www.facebook.com/lalalandsynth

        1 Reply Last reply Reply Quote 1
        • Y
          yall @Casey Kolb
          last edited by

          @Lunacy-Audio thank you I will try this solution :) and if it works I will post the extract

          1 Reply Last reply Reply Quote 0
          • Y
            yall
            last edited by

            @lalalandsynth @Lunacy-Audio
            I just spent 2 hours trying to understand. and I still don't understand ... I really can't, don't you have an extract to share?
            the @lalalandsynth method can be really interesting however my saw meter is not straight but rounded like an arc of a circle.

            1 Reply Last reply Reply Quote 0
            • Y
              yall
              last edited by

              they look like that!VU HISE.png

              1 Reply Last reply Reply Quote 0
              • Casey KolbC
                Casey Kolb
                last edited by

                I'm pretty sure all you need to do is make a VuMeter object as you normally would with the extra script, but in the timer callback you need to set the value of your custom sliders to the left and right master peak levels. That's really it – everything else is already taken care of.

                So basically:

                • Create a VuMeter object by calling createVuMeter()

                • In the VuMeter script, you'll want to comment out the widget.setPaintRoutine() section because you don't need to draw anything now.

                • At the bottom of the timer callback, simply update the value of both of your sliders using the lvalue = getNormalizedPeakValue(Engine.getMasterPeakLevel(0)); rvalue = getNormalizedPeakValue(Engine.getMasterPeakLevel(1));

                Casey Kolb
                Founder & CEO of Lunacy Audio
                Composer | Producer | Software Developer

                1 Reply Last reply Reply Quote 0
                • Y
                  yall
                  last edited by

                  @LightandSound in fact, i have tried all the solutions and it is for me impossible to separate the right and the left with 2 different film strip. there is also the following problem, the vu meter must only be 127 * 167 in size or its proportionality otherwise it does not work. for my case i managed to do some weird stuff but which worked. i created a transparent shape with photoshop. a kind of background image with my 2 seen without background. and at the level of the script I simply duplicated my saw metress and the boards moved so that they are as wide as possible. now my saw meter works but it's still a hack

                  1 Reply Last reply Reply Quote 0
                  • Casey KolbC
                    Casey Kolb
                    last edited by

                    @yall Post your two film strips and I'll try to upload a snippet. This should be fairly straightforward, so I'm confused as to where you're getting stuck. The VuMeter can be any size you want and you can absolutely separate the right and left with 2 different film strips.

                    Casey Kolb
                    Founder & CEO of Lunacy Audio
                    Composer | Producer | Software Developer

                    Y 1 Reply Last reply Reply Quote 0
                    • Y
                      yall @Casey Kolb
                      last edited by

                      @Lunacy-Audio it's this code
                      maybe you will manage to integrate a strip film for the right and one for the left. but me impossible .thank you for your help

                      Content.makeFrontInterface(600, 500);

                      /** Creates a VU-Meter from a filmstrip for the master volume. /
                      /
                      * Creates a VU-Meter from a filmstrip for the master volume. */
                      inline function createFilmStripVuMeter(name, x, y, isLeft)
                      {
                      local widget = Content.addPanel(name, x, y);

                      Content.setPropertiesFromJSON(name, {
                        "width": 130, // this uses the exact dimensions of one filmstrip
                        "height": 65,
                        "opaque": true // opaque is important in order to increase the drawing performance
                      });
                      
                      // Put the image in your image folder
                      widget.loadImage("{PROJECT_FOLDER}vu_meter_128_frames.png", "filmstrip");
                      
                      widget.data.value = 0.0;
                      widget.data.isLeft = isLeft;
                      
                      // Set the initial image 
                      widget.setImage("filmstrip", 0, 0);
                      
                      widget.setTimerCallback(function()
                      {
                      	// Get the peak value from the master output
                      	var newValue = Engine.getMasterPeakLevel(this.data.isLeft ? 0 : 1);
                      	
                      	if(newValue > this.data.value)
                      		this.data.value = newValue;
                      	else
                      		// Just decay the current value (0.92 controls the decay time)
                      		this.data.value = this.data.value * 0.92;
                      	
                      	// Calculate the filmstrip index
                      	// this must be an integer value
                      	// 84 is used instead of 128 because 84 is ~0dB which is
                      	// more accurate for this example filmstrip
                      	var index = parseInt(this.data.value * 84.0);
                      	
                      	// If you just want to paint one image, 
                      	// you don't need the paint routine, but
                      	// just use this method
                      	// the yOffset is index * heightOfFilmstrip
                      	this.setImage("filmstrip", 0, index * 65);	
                      });
                      
                      widget.startTimer(30);
                      return widget;
                      

                      };

                      const var VuMeterLeft = createFilmStripVuMeter("VuMeterLeft", 11, 10, false);
                      const var VuMeterRight = createFilmStripVuMeter("VuMeterRight", 160, 10, true);

                      1 Reply Last reply Reply Quote 0
                      • Casey KolbC
                        Casey Kolb
                        last edited by

                        All you need to do is this:

                        • Make two sliders and assign the film strips to them in the HISE interface

                        • Create an Engine timer which updates each slider's value according to the left and right output

                        It works in this basic example below.

                        HiseSnippet 1342.3oc4X0saaTDEd1jLUwNMnVTQhKWUUgbjJA6ze.TEpaqiSkg3Zq3PZ6EnxjcO1dHyNypcGmVqp9RvMbKOJbMOEk2.dCfyr+3cbqIw0TPUfuxy4mY9N+er6Eq7gjDULwoxgSh.hyEo8mH0iZNhwkj16RbVm1KFR.M49ShXIIP.wwY0GX35TYMR5me+t2mIXRenjDgbjh6C6yC45Rp879FtPrGK.NjGZI8M8Z6qjMUB0XDIqRqShX9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K7xoc80HDNLlIShTIPC6a903siMucA8X4rhmQZFoLl2dn4YI25dED2wlH1XZlKKsQk04NbqdVu5tsjLLfzGPqInahOZrFemc4PuwhD3QlBwF1JVRdGaxNqtTK8NaMpk7umrf969B8+98kVcwf647aHpTfw97vHAzRhqwh6EjhwODWDX.arPWPc1ZpNJoJZjRx8sSvN.vt7CGByjDMWC5dZMtjdIkq3c.H.VhUc1071G2zlEi9IXI8EMVbewYEu9XZFbcMMBb+uw7jU+e+7jytBE6U9dPj9.0XMWNrCCqqLaZ8PbgMbriOfPUJAQhYknULa2kctt4rAP8AYP5g+.+jyrg4rSNyFEL+W4MBY9wpm5m8CYLkdqmRAsaY5+nSEZGyY2FE+3EJs910I3V67m56axN9Tz+Lec1YIz4FKgN2bIz4VKgN2dIz4yWBc9hyTGyry6MVqByx+QB8Zk9iHcbx1aHsTf7m.CgwXQB
                        

                        Casey Kolb
                        Founder & CEO of Lunacy Audio
                        Composer | Producer | Software Developer

                        NatanN Y 2 Replies Last reply Reply Quote 1
                        • NatanN
                          Natan @Casey Kolb
                          last edited by

                          @Lunacy-Audio
                          This Is Strange, None Of This VU Meter Thing Works For Me.
                          No Matter Mac Or PC, Or What Commit :(

                          Casey KolbC 1 Reply Last reply Reply Quote 0
                          • Casey KolbC
                            Casey Kolb @Natan
                            last edited by

                            @Natanr Hmm, I tested it in three different HISE versions and it works in all of them.

                            Does Engine.getMasterPeakLevel(0) return the proper values when you print it? Everything else is really standard. Just updating a slider value in a timer via the script.

                            Casey Kolb
                            Founder & CEO of Lunacy Audio
                            Composer | Producer | Software Developer

                            1 Reply Last reply Reply Quote 0
                            • NatanN
                              Natan
                              last edited by

                              I Exported Your Snippet , And In The End Plugin It Does Not Work.

                              But In Hise Works Fine.
                              Note: Additional Flag Are Already There In Preference But No Luck Here With Image Files. 🤔

                              Y 1 Reply Last reply Reply Quote 0
                              • Casey KolbC
                                Casey Kolb
                                last edited by

                                @Natanr said in vuuuu meter.... vu meter? vu meter master?:

                                Note: Additional Flag Are Already There In Preference But No Luck Here With Image Files.

                                Ah I see. So you added ENABLE_ALL_PEAK_METERS=1?

                                Casey Kolb
                                Founder & CEO of Lunacy Audio
                                Composer | Producer | Software Developer

                                NatanN 1 Reply Last reply Reply Quote 1
                                • NatanN
                                  Natan @Casey Kolb
                                  last edited by

                                  @Lunacy-Audio Yeah I Did That :(
                                  At The Moment I Use The @orange Snippet, For In/Out Out Meters,
                                  Work Smoothly But They Don't Go Very Well With Analog Style UI Designs :(

                                  1 Reply Last reply Reply Quote 0
                                  • Y
                                    yall @Casey Kolb
                                    last edited by

                                    @Lunacy-Audio for me it works. so many months of research for such a small code. I would almost be disappointed ^^ thanks for your help. little extra thing. i have compiled your version of hise with the maximized window. the plugin compiles but does not open

                                    NatanN 1 Reply Last reply Reply Quote 0
                                    • Y
                                      yall @Natan
                                      last edited by

                                      @NatanrI am using @d-healey 's branch and it is working fine. tests can be

                                      1 Reply Last reply Reply Quote 0
                                      • NatanN
                                        Natan @yall
                                        last edited by

                                        @yall
                                        Mate

                                        You Used That Enable Peak Meter = 1 Flag During The Build?
                                        Or In You Project Preferences?

                                        Y 1 Reply Last reply Reply Quote 0
                                        • Y
                                          yall @Natan
                                          last edited by

                                          @Natanr I just copy the snippet from @Lunacy-Audio and add images for the views. I didn’t touch anything else. and it works on hise and the compiled plugin. (vst and fx plugin)

                                          NatanN 1 Reply Last reply Reply Quote 1
                                          • NatanN
                                            Natan @yall
                                            last edited by

                                            @yall No Luck Here
                                            Very Strange 🤔
                                            It's Around One Year Since I Tried The Very First Scripts For VU Meters, and None Of Them Work For Me, Expect One Which Doesn't Translate To PNG And Is Vector Meter Based.

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

                                            11

                                            Online

                                            1.7k

                                            Users

                                            11.8k

                                            Topics

                                            103.2k

                                            Posts