The following code won’t work if the mxj is loaded at the same time the patch file is opened:
//gets the path of the mxj’s parent patcher
private void patchPath()
_patcher = this.getParentPatcher();
_patchPath = _patcher.getFilePath().substring(0, _patcher.getFilePath().lastIndexOf(‘/’) + 1);
You get "" as the path. If you reinitialize the mxj once the patch is loaded, then it works. Are there any plans to fix this? I’m tempted to file a bug report about this.
This is not necessarily specific to mxj.
Could you fix the problem by putting that code in
a loadbang method? This is called after the patch is loaded.
public void loadbang()
Ah, Yes I could. Right now I’ve got it hidden in an if statement when
I receive the first input, which is super ugly. I always forget that
mxj has a loadbang method.
Log in to reply
Let us tell you about notable Max projects, obscure facts, and creative media artists of all kinds.