Forum

    • Register
    • Login
    • Search
    • Categories

    VU meter issue

    General Questions
    4
    7
    241
    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 Korneff
        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
        • ustk
          ustk last edited by

          Shouldn't be png file?

          I cannot help pressing F5 in the forum...
          Studio427 Audio - Audio Instruments & FX Plugins for music production. Website - Facebook

          Dan Korneff 1 Reply Last reply Reply Quote 1
          • Dan Korneff
            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

              orange 1 Reply Last reply Reply Quote 0
              • orange
                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

                  16
                  Online

                  982
                  Users

                  6.6k
                  Topics

                  60.8k
                  Posts