Skip to content

Commit f0965a4

Browse files
committed
Add complex osc receive puredata patch
1 parent b06e933 commit f0965a4

2 files changed

Lines changed: 44 additions & 2 deletions

File tree

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
#N canvas -1158 177 945 588 12;
2+
#X obj 179 241 netreceive -u -b;
3+
#X msg 179 179 listen 0;
4+
#X obj 179 270 oscparse;
5+
#X obj 262 148 bng 19 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000;
6+
#X obj 179 149 bng 19 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000;
7+
#X msg 262 179 listen 12345;
8+
#X obj 179 343 route openbci;
9+
#X obj 179 302 list trim;
10+
#X obj 354 250 bng 19 250 50 0 empty empty empty 0 -10 0 12 #fcfcfc #000000 #000000;
11+
#X obj 354 311 list prepend symbol;
12+
#X obj 354 340 list trim;
13+
#X text 423 126 Enter the address you'd like to receive here. This is the same as the Address textfield in the GUI. Example: accelerometer, f 23;
14+
#X text 437 213 Clicking the bang would change the routing address to the new value., f 21;
15+
#X text 437 339 After data is routed \, we are left with a list of floats that can be unpacked., f 21;
16+
#X text 149 508 Happy Hacking! We're excited to see what our global Community can continue to create using OpenBCI hardware and software! -RW, f 62;
17+
#X text 48 256 PureData adds the "list" selector after our binary data is parsed., f 16;
18+
#X text 152 107 Turn off netreceive, f 10;
19+
#X text 249 107 Start recieving on named port, f 16;
20+
#X text 647 22 Example Incoming OSC Packet;
21+
#X obj 179 376 route time-series-raw;
22+
#X msg 354 283 time-series-raw;
23+
#X obj 52 427 print rawmsg;
24+
#X obj 179 419 route ch0 ch1 ch2 ch3;
25+
#X obj 179 461 print channel0;
26+
#X text 40 61 openbci time-series-raw ch0 -3.92592 -3.88553 -3.26396 -3.62399 -2.70645 -1.6476 -0.789745 0.749153 1.55314 3.081, f 114;
27+
#X text 32 18 OpenBCI OSC Reciever Example June 21 \, 2023 Richard Waltman, f 31;
28+
#X connect 0 0 2 0;
29+
#X connect 1 0 0 0;
30+
#X connect 2 0 7 0;
31+
#X connect 3 0 5 0;
32+
#X connect 4 0 1 0;
33+
#X connect 5 0 0 0;
34+
#X connect 6 0 19 0;
35+
#X connect 7 0 6 0;
36+
#X connect 7 0 21 0;
37+
#X connect 8 0 20 0;
38+
#X connect 9 0 10 0;
39+
#X connect 10 0 19 1;
40+
#X connect 19 0 22 0;
41+
#X connect 20 0 9 0;
42+
#X connect 22 0 23 0;

OpenBCI_GUI/W_Networking.pde

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1371,8 +1371,8 @@ class Stream extends Thread {
13711371

13721372
for (int i = 0; i < newDataFromBuffer.length; i++) {
13731373
msg.clearArguments();
1374-
msg.setAddrPattern(baseOscAddress + "/" + oscDataTypeName + "/" + i);
1375-
for (int j = 0; j < numExgChannels; j++) {
1374+
msg.setAddrPattern(baseOscAddress + "/" + oscDataTypeName + "/ch" + i);
1375+
for (int j = 0; j < newDataFromBuffer[i].length; j++) {
13761376
msg.add(newDataFromBuffer[i][j]);
13771377
}
13781378
try {

0 commit comments

Comments
 (0)