How do You Load an Audio File into a ScriptNode Convolution Reverb?
-
I've seen this thread - could somebody please break this down? As I understand…
1. Create an external audio slot in the uncompiled ScriptNode synth.
Screenshot 2025-01-02 at 4.10.14 pm
2. Compile the ScriptNode synth, and add it to a Silent Synth, inside a Hard-Coded Polyphonic module.
3. Create an AudioSample
const scriptNodeSynth = Synth.getAudioSampleProcessor("fx_MODEL_SynthesiserNode");
Here I break down…I don't seem to have the syntax correct.
4. Create a Reference to the Slot
var impulseResponse = scriptNodeSynth.getAudioFile(1);
5. Load an Audio File
Lost here. AudioSampleProcessor has a setFile method, but I'm not sure if that's applicable here (and if so, how to use it). As I understand it,
getAudioFile
returns aScriptAudioWaveform
. But I don't want to present a user interface to the ScriptNode—I just want to load a file.
6. Relax with Tasty Beverage of Choice
I'm actually good on this one.
Please help?
-
@clevername27 You're good up to 4.
You don't need this:
impulseResponse = scriptNodeSynth.getAudioFile(1);
simply do this:
// this is the reference to the audio slot const scriptNodeSynth = Synth.getAudioSampleProcessor("fx_MODEL_SynthesiserNode"); scriptNodeSynth.setFile(the_relative_path_to_your_reverb_file);
You can call this function in a CB obviously.
- A glass of red wine for me please :)
-
@Matt_SF Thanks for look at my question - I'm really stumped here.
This line produces an error (see the screenshots in my original question).
~~const scriptNodeSynth = Synth.getAudioSampleProcessor("fx_MODEL_SynthesiserNode");~~
Got it. Thanks again.
-
-
-
@clevername27 Aaaah I overlooked #2.
You have to use the
filters.convolution
node, not thecore.file_player
. -
@Matt_SF Cheers mate!