VU meter to simple gain?



  • I'm just having a look at a VU meter and trying to connect it to a simple gain as the master output doesn't work on my exported plugins either.

    The name of my simple gain module is 'MasterGain'. I tried replacing the line below with 'getMasterGainLevel' but it just threw me a code error.

    What would I need to replace the line below with to make it work? Does it work with this method?

    var newValue = Engine.getMasterPeakLevel(this.data.isLeft ? 0 : 1);
    


  • Just noticed your post. Have you seen this thread - https://forum.hise.audio/topic/1170/vu-meter-s-not-working-in-exported-plugin/23

    @Christoph-Hart Is it possible to have a VU meter that shows the sum of all channels and not just channels 0/1?



  • @d-healey What if you route all channels to one channel in the routing matrix and get its level?
    Or getMasterPeakLevel on both channels then make some sort of max peak calculation?



  • @ustk said in VU meter to simple gain?:

    @d-healey What if you route all channels to one channel in the routing matrix and get its level?
    Or getMasterPeakLevel on both channels then make some sort of max peak calculation?

    If I route them all to the same channel then the user won't be able to send the mics to different outputs in their DAW will they? The second method might work, I shall test it.



  • @d-healey For the first, I'm not sure honestly... But if maybe each channel can still be routed to its normal output, but send a copy to a dedicated "measuring" bus, which is not sent to any output, so it stays internally for measuring purpose only... I'm just trying to imagine...

    Untitled.jpeg



  • @ustk That's a good idea!



  • @d-healey Thanks mate. I did indeed. It got solved on that very thread in the end around the same time as I put this one up. Thanks though 🙂



  • @ustk @d-healey how do you set up multiple outputs, do you have to use the HISE plugin for making it happen?



  • It will only work in HISE plugin or when you export a plugin. But you can put the script together in the standalone version. The code I'm using is floating about somewhere on the forum, I just adapted it for my needs.

        const var MasterChain = Synth.getChildSynth("master");
        const var matrix = MasterChain.getRoutingMatrix();
        
        inline function changeOutput(component, value)
        {
            // This variable checks if the output channel exists.
            local success = true;
            local idx = cmbOutput.indexOf(control); //Mic index
    
            switch(value)
            {
                case 1:
                    matrix.addConnection(0 + (idx * 2), 0);
                    matrix.addConnection(1 + (idx * 2), 1);
                    break;
                case 2:
                    matrix.addConnection(0 + (idx * 2), 2);
                    success = matrix.addConnection(1 + (idx * 2), 3);
                    break;
                case 3:
                    matrix.addConnection(0 + (idx * 2), 4);
                    success = matrix.addConnection(1 + (idx * 2), 5);
                    break;
            }
    
            //Reset to Channel 1+2 in case of an error
            if(!success)
            {
                matrix.addConnection(0 + (idx * 2), 0);
                matrix.addConnection(1 + (idx * 2), 1);
            }
        }
    


  • @d-healey thank you David! 🙂



  • @ustk said in VU meter to simple gain?:

    @d-healey For the first, I'm not sure honestly... But if maybe each channel can still be routed to its normal output, but send a copy to a dedicated "measuring" bus, which is not sent to any output, so it stays internally for measuring purpose only... I'm just trying to imagine...

    Untitled.jpeg

    Think you could make a working example of this? 🙂


Log in to reply
 

9
Online

552
Users

2.1k
Topics

16.1k
Posts