Skip to content
Snippets Groups Projects
Commit 2fac5aee authored by Ivica Bukvic's avatar Ivica Bukvic
Browse files

added ability to change udpreceive's port after creation and improved help file.

parent c82fe645
No related branches found
No related tags found
No related merge requests found
#N canvas 221 129 767 415 10; #N canvas 221 129 832 415 10;
#N canvas 874 257 494 344 META 0; #N canvas 872 257 494 344 META 0;
#X text 12 155 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan #X text 12 188 HELP_PATCH_AUTHORS "pd meta" information added by Jonathan
Wilkes for Pd version 0.42.; Wilkes for Pd version 0.42.;
#X text 12 25 LICENSE GPL v2 or later; #X text 12 25 LICENSE GPL v2 or later;
#X text 12 135 AUTHOR Martin Peach;
#X text 12 5 KEYWORDS control network; #X text 12 5 KEYWORDS control network;
#X text 12 45 DESCRIPTION receive datagrams over a udp connection and #X text 12 45 DESCRIPTION receive datagrams over a udp connection and
outputs them as a signal; outputs them as a signal;
#X restore 695 379 pd META; #X text 12 161 AUTHOR Martin Peach with additional features by Ivica
#X obj 522 267 print udpreceive~; Ico Bukvic;
#X symbolatom 177 354 10 0 0 0 - - -; #X text 11 76 INLET_0 signal port reset info buffer;
#X floatatom 211 288 5 0 0 0 - - -; #X text 11 99 OUTLET_N incoming signal over network (variable);
#X floatatom 246 267 7 0 0 0 - - -; #X text 11 124 OUTLET_R last three outlets are for signal level \,
#X floatatom 280 332 9 0 0 0 - - -; object status \, and incoming data packet address info;
#X obj 177 313 prepend set; #X restore 753 382 pd META;
#X text 147 287 channels:; #X obj 580 270 print udpreceive~;
#X text 131 353 format:; #X symbolatom 235 357 10 0 0 0 - - -;
#X text 231 331 bitrate:; #X floatatom 269 291 5 0 0 0 - - -;
#X text 182 266 framesize:; #X floatatom 304 270 7 0 0 0 - - -;
#X floatatom 315 289 9 0 0 0 - - -; #X floatatom 338 335 9 0 0 0 - - -;
#X floatatom 349 267 9 0 0 0 - - -; #X obj 235 316 prepend set;
#X floatatom 384 310 5 0 0 0 - - -; #X text 205 290 channels:;
#X floatatom 418 289 5 0 0 0 - - -; #X text 189 356 format:;
#X text 258 288 overflow:; #X text 289 334 bitrate:;
#X text 289 266 underflow:; #X text 240 269 framesize:;
#X text 323 309 queuesize:; #X floatatom 373 292 9 0 0 0 - - -;
#X text 370 288 average:; #X floatatom 407 270 9 0 0 0 - - -;
#X msg 35 58 info; #X floatatom 442 313 5 0 0 0 - - -;
#X msg 15 38 reset; #X floatatom 476 292 5 0 0 0 - - -;
#X text 68 57 status info to rightmost outlet; #X text 316 291 overflow:;
#X text 53 37 reset underflow & overflow counters; #X text 347 269 underflow:;
#X floatatom 210 169 3 0 0 0 - - -; #X text 381 312 queuesize:;
#X floatatom 233 169 3 0 0 0 - - -; #X text 428 291 average:;
#X floatatom 256 169 3 0 0 0 - - -; #X msg 93 61 info;
#X floatatom 279 169 3 0 0 0 - - -; #X msg 73 41 reset;
#X floatatom 303 169 5 0 0 0 - - -; #X text 126 60 status info to rightmost outlet;
#X obj 210 143 unpack 0 0 0 0 0; #X text 111 40 reset underflow & overflow counters;
#X text 173 168 from:; #X floatatom 268 172 3 0 0 0 - - -;
#X obj 82 152 dac~ 1 2; #X floatatom 291 172 3 0 0 0 - - -;
#X floatatom 453 332 9 0 0 0 - - -; #X floatatom 314 172 3 0 0 0 - - -;
#X text 401 331 packets:; #X floatatom 337 172 3 0 0 0 - - -;
#X text 348 142 To communicate \, a [udpreceive~] and [udpsend~] pair #X floatatom 361 172 5 0 0 0 - - -;
#X obj 268 146 unpack 0 0 0 0 0;
#X text 231 171 from:;
#X obj 140 155 dac~ 1 2;
#X floatatom 511 335 9 0 0 0 - - -;
#X text 459 334 packets:;
#X text 406 145 To communicate \, a [udpreceive~] and [udpsend~] pair
must have the same number of channels and the same blocksize. Also must have the same number of channels and the same blocksize. Also
[udpsend~] must [connect( to the port on which [udpreceive~] is listening. [udpsend~] must [connect( to the port on which [udpreceive~] is listening.
; ;
#X msg 56 79 buffer 2; #X msg 113 81 buffer 2;
#X text 118 78 set number of frames to buffer before playback; #X text 176 81 set number of frames to buffer before playback;
#X obj 177 230 route format channels framesize bitrate overflow underflow #X obj 235 233 route format channels framesize bitrate overflow underflow
queuesize average packets tag_errors; queuesize average packets tag_errors;
#X floatatom 487 310 9 0 0 0 - - -; #X floatatom 545 313 9 0 0 0 - - -;
#X text 421 309 tag errors:; #X text 479 312 tag errors:;
#X obj 144 181 env~; #X obj 202 184 env~;
#X floatatom 144 204 9 0 0 0 - - -; #X floatatom 202 207 9 0 0 0 - - -;
#X text 204 193 The rightmost signal outlet outputs 1 if the stream #X text 262 196 The rightmost signal outlet outputs 1 if the stream
is valid \, else 0; is valid \, else 0;
#X text 420 77 Arguments: port \, channels \, blocksize \, multicast_address. #X text 478 80 Arguments: port \, channels \, blocksize \, multicast_address.
Blocksize should match [udpsend~]. multicast_address is optional. Arguments Blocksize should match [udpsend~]. multicast_address is optional. Arguments
must be in that order.; must be in that order.;
#X obj 81 121 udpreceive~ 9999 2 512; #X obj 139 124 udpreceive~ 9999 2 512;
#X text 221 120 receives 2 channels on port 9999 Same blocksize as #X text 279 123 receives 2 channels on port 9999 Same blocksize as
udpsend~; udpsend~;
#X msg 53 21 port 9000;
#X text 114 20 change port after creation;
#X connect 6 0 2 0; #X connect 6 0 2 0;
#X connect 19 0 43 0; #X connect 19 0 43 0;
#X connect 20 0 43 0; #X connect 20 0 43 0;
...@@ -86,3 +93,4 @@ udpsend~; ...@@ -86,3 +93,4 @@ udpsend~;
#X connect 43 2 39 0; #X connect 43 2 39 0;
#X connect 43 3 36 0; #X connect 43 3 36 0;
#X connect 43 4 28 0; #X connect 43 4 28 0;
#X connect 45 0 43 0;
...@@ -389,6 +389,11 @@ static int udpreceive_tilde_createsocket(t_udpreceive_tilde* x, char *address, i ...@@ -389,6 +389,11 @@ static int udpreceive_tilde_createsocket(t_udpreceive_tilde* x, char *address, i
return 1; return 1;
} }
static int udpreceive_tilde_setsocket(t_udpreceive_tilde* x, t_float portno)
{
udpreceive_tilde_createsocket(x, x->x_addr_name, (int)portno);
}
/* Queue is 1 to 16 frames long */ /* Queue is 1 to 16 frames long */
#define QUEUESIZE (int)((x->x_framein + DEFAULT_AUDIO_BUFFER_FRAMES - x->x_frameout) % DEFAULT_AUDIO_BUFFER_FRAMES) #define QUEUESIZE (int)((x->x_framein + DEFAULT_AUDIO_BUFFER_FRAMES - x->x_frameout) % DEFAULT_AUDIO_BUFFER_FRAMES)
/* Block is a set of sample vectors inside a frame, one vector per channel */ /* Block is a set of sample vectors inside a frame, one vector per channel */
...@@ -795,6 +800,7 @@ void udpreceive_tilde_setup(void) ...@@ -795,6 +800,7 @@ void udpreceive_tilde_setup(void)
class_addmethod(udpreceive_tilde_class, (t_method)udpreceive_tilde_dsp, gensym("dsp"), 0); class_addmethod(udpreceive_tilde_class, (t_method)udpreceive_tilde_dsp, gensym("dsp"), 0);
class_addmethod(udpreceive_tilde_class, (t_method)udpreceive_tilde_reset, gensym("reset"), A_DEFFLOAT, 0); class_addmethod(udpreceive_tilde_class, (t_method)udpreceive_tilde_reset, gensym("reset"), A_DEFFLOAT, 0);
class_addmethod(udpreceive_tilde_class, (t_method)udpreceive_tilde_reset, gensym("buffer"), A_DEFFLOAT, 0); class_addmethod(udpreceive_tilde_class, (t_method)udpreceive_tilde_reset, gensym("buffer"), A_DEFFLOAT, 0);
class_addmethod(udpreceive_tilde_class, (t_method)udpreceive_tilde_setsocket, gensym("port"), A_DEFFLOAT, 0);
post("udpreceive~ v%s, (c) 2004 Olaf Matthes, 2010 Martin Peach", VERSION); post("udpreceive~ v%s, (c) 2004 Olaf Matthes, 2010 Martin Peach", VERSION);
ps_format = gensym("format"); ps_format = gensym("format");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment