Get console messages into a message box

痞子三分冷 提交于 2019-12-10 22:34:34

问题


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:

  1. send all post/error messages to the stderr (with the -stderr startup flag)
  2. redirect the stderr to stdout
  3. capture the stdout with a script, reformat it and send it back to Pd via the network (preferrably UDP)
  4. 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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!