Show name of Convolution Reverb IR in a label?



  • Wondering if this is possible to do in a similar way as with preset names from the preset browser? 🤔

    The part I'm thinking would need changing from the code at the bottom is:

    if (Engine.getCurrentUserPresetName() == "")
    

    ...but to what? (Engine.getAudioFileList) or (getCurrentlyLoadedFile) ... or similar? Or is it even possible at all? I'm just spitballing here as it could be anything 😂

    This is the code to show a preset name from the preset browser in a label so I'm thinking it would be a similar process, if its possible?

    const var Label4 = Content.getComponent("Label4");
    
    inline function onKnob1Control(component, value)
    {
        if (Engine.getCurrentUserPresetName() == "")
            Content.getComponent("Label4").set("text", "-------");
        else
            Content.getComponent("Label4").set("text", Engine.getCurrentUserPresetName());
    };
    
    Content.getComponent("Knob1").setControlCallback(onKnob1Control);
    


  • If you're allowing the user to drop in there own IRs then the getCurrentlyLoadedFile() function is probably the one you want. If the user is selecting the IR from a list, then you can grab the name from the list.



  • @d-healey Thanks David. Still struggling to get it working and getting error messages saying function not found for the 'getCurrentlyLoadedFile' line.

    I've tried 2 ways, as I wasn't sure if it was meant to start with 'Engine' or 'Reverb1'

    I'll put the 2 lots of code below. Can you spot the mistake at all? Confused!

    (I already have a reference to Reverb1 further up in the code)

    // Reverb1 IR Name in Label
    
    const var Label1 = Content.getComponent("Label1");
    
    inline function onKnob4Control(component, value)
    {
        if (Reverb1.getCurrentlyLoadedFile() == "")
            Content.getComponent("Label1").set("text", "Right Click To Load IR");
        else
            Content.getComponent("Label1").set("text", Reverb1.getCurrentlyLoadedFile());
    };
    
    Content.getComponent("Knob4").setControlCallback(onKnob4Control);
    
    // Reverb1 IR Name in Label
    
    const var Label1 = Content.getComponent("Label1");
    
    inline function onKnob4Control(component, value)
    {
        if (Engine.getCurrentlyLoadedFile() == "")
            Content.getComponent("Label1").set("text", "Right Click To Load IR");
        else
            Content.getComponent("Label1").set("text", Engine.getCurrentlyLoadedFile());
    };
    
    Content.getComponent("Knob4").setControlCallback(onKnob4Control);
    


  • Did you get the reverb as an audio processor or an effect?



  • @d-healey

    It's referenced as an effect at the moment like this:

    const var Reverb1 = Synth.getEffect("Reverb1");
    


  • @d-healey

    I just tried adding this:

    const var Reverb1 = Synth.getAudioSampleProcessor("Reverb1"); 
    

    ...but now I get a duplicate const var declaration



  • @SteveRiggs do you have two variables with the same name?



  • @d-healey

    It's probably because there is:

    const var Reverb1 = Synth.getAudioSampleProcessor("Reverb1");
    

    and

    const var Reverb1 = Synth.getEffect("Reverb1");
    

    but not sure which one I need now so it will work for both things. The other reference to it is for a button that bypasses and enables Reverb 1



  • @SteveRiggs Why not have both but with different names?



  • @d-healey

    Good point! I just changed one to

    const var Verb1 = Synth.getAudioSampleProcessor("Reverb1");
    

    and left the other as

    const var Reverb1 = Synth.getEffect("Reverb1");
    

    but I'm still getting 'function not found' in the console 🤔



  • @SteveRiggs I'll look at it in the morning when I'm at my PC



  • @d-healey Ok thanks. Could be a bug. Seems weird its not working. I'll leave it for now until tomorrow then and come back to it. Cheers for your help



  • Ok it turns out the getCurrentlyLoadedFile function is part of the AudioFile class, not the AudioSampleProcessor class.

    How are users selecting the IR they want to use in your plugin?



  • @d-healey Got ya. Thats why it doesn't work then. Cheers for checking.

    At the moment the IR's are being loaded just by right clicking on the audio waveform on the GUI and choosing from the AudioFiles folder



  • Does that provide any kind of callback function?



  • @d-healey Not that I know of. I just have the AudioWaveform linked to Reverb1 in the property editor/processorId


Log in to reply
 

15
Online

1.2k
Users

3.9k
Topics

34.4k
Posts