Skip to content

Instantly share code, notes, and snippets.

@giuliomoro
Last active October 12, 2023 19:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save giuliomoro/23e3782d3609518b2067ccd38ba156ce to your computer and use it in GitHub Desktop.
Save giuliomoro/23e3782d3609518b2067ccd38ba156ce to your computer and use it in GitHub Desktop.
An example _main.pd to use on Bela . Make sure the branch of Bela you are using has support for BELA_LIBPD_SERIAL in Bela/core/default_libpd_render.cpp
#N canvas 368 72 801 510 12;
#X obj 104 216 s bela_setSerial;
#X obj 342 251 r bela_serial;
#X obj 104 21 loadbang;
#X obj 128 362 unpack f f f f f f;
#X obj 128 405 pack f f f f f f;
#X obj 127 444 print floats;
#X obj 346 372 unpack s s s s s s;
#X obj 346 408 pack s s s s s s;
#X obj 345 447 print symbols;
#X obj 545 440 print symbol;
#X obj 544 392 symbol;
#X obj 342 278 route myserial;
#X text 377 77 vv;
#X text 124 332 Connect this for "floats";
#X text 313 340 Connect this for "symbols";
#X text 521 348 Connect this for "symbol";
#X text 460 279 Incoming messages are prepended with the ID;
#X text 129 60 ID;
#X text 130 79 vv;
#X text 201 79 vv;
#X text 200 60 Device;
#X text 274 77 vv;
#X text 273 58 baudrate;
#X text 331 118 ^^;
#X text 277 164 - "none": send data as it comes in (may cause incomplete
messages);
#X text 277 148 - "newline": send data every time a newline is received
;
#X text 277 134 What to wait for before sending data to Pd:;
#X text 373 50 How to deliver data" "floats \, "symbols" \, or "symbol"
;
#X text 373 60 make sure you route the receiver below accordingly;
#X msg 104 98 new myserial /dev/ttyS4 115200 newline floats;
#X connect 1 0 11 0;
#X connect 2 0 29 0;
#X connect 3 0 4 0;
#X connect 3 1 4 1;
#X connect 3 2 4 2;
#X connect 3 3 4 3;
#X connect 3 4 4 4;
#X connect 3 5 4 5;
#X connect 4 0 5 0;
#X connect 6 0 7 0;
#X connect 6 1 7 1;
#X connect 6 2 7 2;
#X connect 6 3 7 3;
#X connect 6 4 7 4;
#X connect 6 5 7 5;
#X connect 7 0 8 0;
#X connect 10 0 9 0;
#X connect 11 0 3 0;
#X connect 29 0 0 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment