Loading an IR in a scriptnode convolution module via script
-
Hello all....
A project I'm working on has multiple convolution modules in a scriptnode network. I am attempting to load the IRs into the modules via scripting. It seems to be working, the convolution module is showing the name of the IR, but it's not actually loaded. If I manually load the IR in, it works.To illustrate....the module on the left is loaded via script, but the module on the right in manually loaded. Although they both have the IR file name in the "label", only the one on the right actually loaded the IR.
So, here is the code in the function I'm using to "load" the IR. I know it can be simplified, but I figured it might be easier to follow this way
//create obj reference to cab 1 convolution modules and audio file slot
local CabIR1_1 = Synth.getAudioSampleProcessor("Cabinet1").getAudioFile(0);//create variable to hold IR file name
// translates to something like: "PV 5150 412 Sheffield - SM57 - Cap.wav"
local CabIR1_1_wav = theCab1 + " - " + theMic1 + " - Cap.wav";//load an iR into each of the convolution modules
CabIR1_1.loadFile(CabIR1_1_wav);I hope that all makes sense? Thanks in advance!
-
@scottmire Are you using an external slot for the convo Node? If so, trying scripting a much simpler file name - one that you're not building via. If that doesn't work, try using the same script to load it into a module tree convo reverb—it would use the same path. Are loading the files into your audio file pool?
-
@clevername27 I am using an external slot, but I am not loading the files into the audio file pool. Does that need to be done?
I agree that the file name is a bit complex, but it represents the 3 parameters the user chooses to select the IR (the specific speaker/cab, the mic, the mic position). Ultimately, there will be hundred of IRs, each representing a combination of the selectable parameters. -
@scottmire
This is my workflow for IR and Scriptnode:- Add the .wav files to the
AudioFiles
folder in your project. - Click on the icon at the bottom left and add an External AudioFile Slot.
- Add an AudioWaveform and link it to Scriptnode in the Property Panel.
2.1. If the user doesn't need it, make it invisible. - From the documentation:
"Calling this makes sure that all audio files are loaded into the pool and will be available in the compiled plugin. Returns a list of all references. Edit on GitHub"
Engine.loadAudioFilesIntoPool()
- Load the files using:
ScriptFX/HardcordedFX.setFile
If you skip step 2, once the network is compiled, it won't be available in the UI of your HardcodedFX. Therefore, I recommend including this step.
- Add the .wav files to the
-
@scottmire Sure - I just meant for testing purposes, use a full string for the file name, in case your were accidentally constructing the wrong file name and/or path.
-
@Mighty23 @scottmire This is exactly how I did it, as well.
-
I got it working!
Thanks to everyone for the help....it's greatly appreciated!