HISE Logo Forum
    • Categories
    • Register
    • Login

    VU meter issue

    Scheduled Pinned Locked Moved General Questions
    7 Posts 4 Posters 419 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.
    • A
      arminh
      last edited by

      Hi, im trying to add VU meter but I have some problem.
      I created strip with 128 images but when I changed size and filename in code I've got something like this

      I used this code

      /** 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": 71, // this uses the exact dimensions of one filmstrip
            "height": 559,
            "opaque": true // opaque is important in order to increase the drawing performance
          });
          
          // Put the image in your image folder
          widget.loadImage("{PROJECT_FOLDER}elo.bmp", "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;
      };
      1 Reply Last reply Reply Quote 0
      • Dan KorneffD
        Dan Korneff
        last edited by Dan Korneff

        On:
        Content.setPropertiesFromJSON(name,

        I think you have to replace name with the name of your item.
        "widget"
        I could be wrong though

        Dan Korneff - Producer / Mixer / Audio Nerd

        1 Reply Last reply Reply Quote 0
        • ustkU
          ustk
          last edited by

          Shouldn't be png file?

          Can't help pressing F5 in the forum...

          Dan KorneffD 1 Reply Last reply Reply Quote 1
          • Dan KorneffD
            Dan Korneff @ustk
            last edited by

            @ustk I just saw that too. All the images need to be .png files

            Dan Korneff - Producer / Mixer / Audio Nerd

            A 1 Reply Last reply Reply Quote 0
            • A
              arminh @Dan Korneff
              last edited by

              @dustbro @ustk are you sure guys? Because I see "animation" but it's very glitchy

              orangeO 1 Reply Last reply Reply Quote 0
              • orangeO
                orange @arminh
                last edited by orange

                Yeah I saw that issue too. Latest Hise has a bug about image strip vu meter stuff.

                I resized my image strip to smaller size and it solved.

                develop Branch / XCode 13.1
                macOS Monterey / M1 Max

                A 1 Reply Last reply Reply Quote 0
                • A
                  arminh @orange
                  last edited by

                  @orange ok, so I need tweak my GUI :) Thx :)

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

                  31

                  Online

                  1.7k

                  Users

                  11.8k

                  Topics

                  102.9k

                  Posts