I'm trying to dynamically load patches.
I have this:
I have my patches in the relative dir synths/
named synth1.pd
, synth2.pd
, etc. When I click the radio I get this error:
synth1.pd: read failed; Device not configured
pd open
I'm trying to dynamically load patches.
I have this:
I have my patches in the relative dir synths/
named synth1.pd
, synth2.pd
, etc. When I click the radio I get this error:
synth1.pd: read failed; Device not configured
I'm on OSX with Pd 0.46-7
@konsumer Hello,
Declare the whole path (from the root) in the message and it will work.......
Or use [declare -path /synths] or [declare -path synths/] (Sorry I can't remember which might work)......
Or try "pd open synths/synth$1.pd"....... for a relative path... (I am not sure that will work though in a message to Pd. It would work in a message to an object that is already in your patch)...
Otherwise if you have [moonlib/relativepath] that would help.
Paths are just about the most difficult thing in Pd, as if you want to share your patch with other people you have to be careful with them. [moonlib/absolutepath] and [moonlib/relativepath] don't work in windows (for example) and you would have to use [getdir] instead.
David.
Hi David, I am also David.
m0oonlib doesn't come with Pd-vanilla, but I am willing to get Pd-extended working (I'm actually prototyping for a patch that will run on a raspberry pi.) I definitely want to share these patches when I'm done, so I am using relative paths because I want it to run on different environments, with different file structures, with everything relative to the main patch.
If I declare /synths
wouldn't that be an absolute location (at the root of my filesystem?)
open
messages require 2 params, the second of which is the path. If you leave it off you will get this error:
Bad arguments for message 'open' to object 'pd'
(I get the Bad Argument
error)
Device not configured
:I'd prefer not hardcoding an absolute path.
moonlib/absolutepath
doesn't seem to work with a directory name, only a file. That means this works:
But not this (the format I actually need for path):
This works, but really I'd just prefer a solution that works in Pd-vanilla:
I ended up using dynamic messages to load patches as objects. Seems to work really well. Here is my framework,
@konsumer Hello there......
I hope this doesn't depress you too much...... but it should work and it is simpler...... as you can send the $1 through the [workspace] object to load the correct modules.
But there is absolutely nothing wrong with your patch as you have made it...... it is very impressive work!
simplified.zip
David
Oops! Looks like something went wrong!