问题
Is there any way to get the Pure Data Pd windows console messages into a message box within the patch? I'm trying to get error messages back into the patch so that the patch can react to them.
回答1:
the only way to do this (in Pd-vanilla even) is to:
- send all post/error messages to the stderr (with the
-stderr
startup flag) - redirect the stderr to stdout
- capture the stdout with a script, reformat it and send it back to Pd via the network (preferrably UDP)
- add a
[netreceive]
to get the messages.
something like the following:
$ pd -stderr 2>&1 | while true; do pdsend 9999 localhost udp; done
and in Pd add the following to your patch:
[netreceive 9999 1]
|
[route error:]
|
[list prepend set]
|
[list trim]
|
[ (
now whenever Pd prints a line starting with "error:" this line will appear in the msgbox.
caveats: this effectively suppresses all messages on the Pd-console.
来源:https://stackoverflow.com/questions/33714494/get-console-messages-into-a-message-box