the netpd global variables

this page is a list of all global variables provided and used by netpd. please help me complete this list, since i probably forgot to mention some of them.


variables provided by chat

s netpd-broadcast
every message that is sent to netpd-broadcast is broadcasted to every netpd client, thus every client will receive that messeage (including the sender of the message).

s netpd-send
netpd-send is used to send a message to a specific client. the first element of a message sent to netpd-send must be a number, which is the socket-number of the receiver. if a message 4 one two three is sent to netpd-send, the client with the socket number 4 will receive the message one two three (the first element, the socket number, will be stripped off).

r netpd-receive
through netpd-receive every message will be received, that was either sent by netpd-broadcast or netpd-send. note: a possible list selector of an incoming message will be stripped off, e.g. when list one two was sent, only one two will be received. use the object [list] to re-add the list selector. usually incoming messages get parsed by a [route] object, that is why it was decided to do so.

s netpd-getstatus / r netpd-status 1
gives you the connection status of chat. 1 when connected and 0 when disconnected.

s netpd-getsocket / r netpd-socket 1
gives you your socket number (float).

s netpd-getdsp / r netpd-dsp 1
gives you the actual dsp status of your pd. 1 for dsp on and 0 for dsp off.

s netpd-getname / r netpd-name 1
gives you the nick name, that is actually used (symbol).

s netpd-getwelcome / r netpd-welcome 1
gives you the welcome message, that is actually used (symbol).

s netpd-getdomain / r netpd-domain 1
gives you the domain name of the currently used netpd-server (symbol).

s netpd-getport / r netpd-port 1
gives you the tcp port number of the port, that is actually used to connect to the netpd-server (float).

r chat-message
can be used to receive the talk from chat. it gives you message of the format nickname chatmessage socketnumber (without list selector).
this naming of this variable is incostistent and subject to be changed in the future. also the message format will probably change.


1 in order to get a value through r netpd-something, you need to send a bang to s netpd-getsomething. you may want to buffer the response in order to avoid unwanted triggering. probably a picture explains better, what is meant here:

though in other cases, when values are actualized, retriggering might be desired.

  



variables provided by creator

s cr.open / r cr.open.done
these are used to netload [netpd-patches]? by message. s cr.open accepts messages with one symbol atom (with or without the symbol selector), whereas the symbol atom represents the name of the patch (without the extension .pd), that should be loaded. if the requested patch is not existent, an error message is printed to the console.
since creator does not open patches immediately, but with a minimal period in between, it might be important for state restoring tool to know, when it is save to send state data for a certain patch, so that the state data is not sent before the patch is open. therefore r cr.open.done was introduced. it outputs the name of a patch, that was opened through s cr.open, in the format symbol patchname, as soon as it is save to send the state data.

s pd-cr.singletons
creator has a subpatch called pd cr.singletons. its goal is to provide a place where singletons can be created. send a message obj 10 10 nameofyoursingleton to s pd-cr.singletons, whereas nameofyoursingleton is an abstraction that should be only instantiated once. note: creator doesn't check, if a singleton abstraction is already created or not. this means, it is the duty of the customer patch to make sure, that a certain singleton abstraction doesn't get instantiated twice or more.