VU Meter's not working in exported plugin



  • I've made an FX plugin, when testing in HISE (via a sampler which is removed before exporting as a VST) the VU meters work. Once exported and loaded in Reaper the VU meters aren't responding to input or output. Any ideas?

    This is my FX chain
    Screenshot from 2019-01-25 01-45-36.png



  • Have you "ENABLE_ALL_PEAK_METERS=1" within your settings before export?Screen Shot 2019-01-24 at 9.49.07 PM.png



  • @d-healey You have to "ENABLE_ALL_PEAK_METERS=1" in the Preferences section.



  • Thanks guys. I'm compiling on GNU/Linux so those settings don't directly affect my project, but it did apply the settings to the .jucer file. Once I opened the .jucer file I could see the settings there for Windows and Mac so I just copied them to the Linux section. I also had to add HISE_NUM_PLUGIN_CHANNELS=2 as well.

    One thing I noticed is that the output meter wasn't working when connected to the master output so I had to connect it to a simple gain effect.



  • @d-healey said in VU Meter's not working in exported plugin:

    I had to connect it to a simple gain effect.

    You can do that? Connect a meter to the output of simple gain?



  • @dustbro yes you can do that



  • @dustbro If you look at the Music Box Tutorial, there is a Simple Gain unit at the end of the fx chain. The VU meter in the GUI is connected to this module and VU meter gets the level of this unit.

    const var MasterGain = Synth.getEffect("Master Gain");
    const var outputMeter = VuMeter.createVuMeter("outputMeter", 328, 72, MasterGain);
    // 328 an 72 values are x & y cordinates of the VU meter
    
    

    In order to use this method, you need to define a "createVuMeter" function:

    
    namespace VuMeter
    {
    	/** Creates a peak meter.
    	*
    	*	Usage: Give it a reference to a module (either synth or effect).
    	*
    	*	It looks best using a width and height with multiple of 4.
    	*	Customize the colours using the scriptPanel colour Ids
    	*/
    	inline function createVuMeter(name, x, y, module)
    	{
    		local widget = Content.addPanel(name, x, y);
        
    		Content.setPropertiesFromJSON(name, {
    		"width": 32,
    		"height": 100,
    		"itemColour": 0x88FFFFFF,
    		"itemColour2": 4279505940,
    		"bgColour": 4279505940,
    		"textColour": 4283782485,
    		"saveInPreset": false,
    		"opaque": 1
    		});
        
    		widget.data.module = module;
    		
    		Console.assertIsObjectOrArray(module);
    		
    		widget.setPaintRoutine(function(g)
    		{
    			g.fillAll(this.get("bgColour"));
    			
    			g.setColour(this.get("itemColour"));
        	
    			var lsize = parseInt(this.data.lvalue * (this.getHeight()-4));
    			var rsize = parseInt(this.data.rvalue * (this.getHeight()-4));
        	
    			g.fillRect([2, this.getHeight() - lsize - 2, (this.getWidth()-4)/2-1, lsize]);
    			g.fillRect([2 + this.getWidth() / 2 - 1, this.getHeight() - rsize - 2, (this.getWidth()-4)/2-1, rsize]);
        	
    			g.setColour(this.get("itemColour2"));
        	
    			for(i = 1; i < this.getHeight()-1; i = i + 3)
    			{
    				g.fillRect([1, i, this.getWidth()-2, 1]);
    			}
    		});
        
    		widget.setTimerCallback(function()
    		{
    			var lvalue = getNormalizedPeakValue(Engine.getMasterPeakLevel(false));
    			var rvalue = getNormalizedPeakValue(Engine.getMasterPeakLevel(true));
        	
    			this.data.lvalue = Math.max(lvalue, this.data.lvalue - 0.04);
    			this.data.rvalue = Math.max(rvalue, this.data.rvalue - 0.04);
        	
    			this.repaintImmediately();
    		});
        
    		widget.startTimer(30);
    		return widget;
    	};
    
    	inline function getNormalizedPeakValue(gain)
    	{
    		return 0.01 * (100.0 + Engine.getDecibelsForGainFactor(gain));
    	}
    }
    


  • @d-healey Have you tried this method? (in the example; "vu_meter_128_frames" is the image strip animation with 128 frames)

    /** 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);
    


  • @orange I haven't used an image strip, I used Christoph's panel vu meter


 

2
Online

384
Users

1.2k
Topics

8.8k
Posts