I've gotta start documenting some of my experiments, tests, failures, and successes, when it comes to ScriptNode's and SNEX, and interfacing with the Hisescript interface side of things.
So I thought I'd start a thread on it, so hopefully people can learn from my idiocy, and I can have something to reflect back on when I'm stuck.
So.... lesson 1: Synth.getAudioSampleProcessor.
This is a useful method for accessing the sample slot of a module, and generally if you're using the built in sampler or audio player modules, you won't run into this issue. But I just did, and it stumped me for ages, because of a misleading error message.
So here it is - if you are trying to do this with a Scriptnode Synthesiser, you need to be sure that your Scriptnode Synthesiser meets these conditions:
- It must have a node in it that contains some form of AudioFile: file_player, stretch_player, granulator, or the snex_node nodes.
- Your node from this list must be set to use an External AudioFile Slot.
If these conditions aren't met, then when you try to make a call to Synth.getAudioSampleProcessor, the console will return the following error:
Interface:! Line 3, column 42: Scriptnode Synthesiser1 was not found. {SW50ZXJmYWNlfG9uSW5pdCgpfDgwfDN8NDI=}
Master Chain:! Line 3, column 42: Scriptnode Synthesiser1 was not found. {SW50ZXJmYWNlfG9uSW5pdCgpfDgwfDN8NDI=}
This error actually is not that useful. It really should say that the AudioSampleProcessor was not found in my opinion.
Here is a screenshot of a scenario where you could get this:
You'll notice that I have a Scriptnode Synthesiser in my module list, and it has a DspNetwork assigned to it. However the network is completely empty.
Now if I add a file_player node:
We still get the same error, because the file_player node does not have an external file slot added to it.
If we load a file to the embedded slot (bad practice imho) this also makes no difference:
We still cannot resolve the AudioSampleProcessor.
Finally... if we add an external slot, even when it is empty, we get the AudioSampleProcessor reference that we were looking for:
Something to watch out for.