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
- 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).
- 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 threeis 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).
- 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 twowas sent, only
one twowill 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.
- gives you the connection status of chat.
1when connected and
- gives you your socket number (float).
- gives you the actual dsp status of your pd.
1for dsp on and
0for dsp off.
- gives you the nick name, that is actually used (symbol).
- gives you the welcome message, that is actually used (symbol).
- gives you the domain name of the currently used netpd-server (symbol).
- gives you the tcp port number of the port, that is actually used to connect to the netpd-server (float).
- 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
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
- these are used to netload netpd-patches by message.
s cr.openaccepts 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.donewas 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.
- 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 nameofyoursingletonto
s pd-cr.singletons, whereas
nameofyoursingletonis 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.