Commit b0da0f1e authored by Larkin Heintzman's avatar Larkin Heintzman

init commit

parent bfc2d249
Pipeline #61 failed with stages
#N canvas 1063 215 821 381 10;
#X msg 426 -312 disconnect;
#X obj 407 -286 netsend -u -b;
#X obj 408 -387 list prepend send;
#X obj 408 -362 list trim;
#X msg 286 -484 connect localhost 3721;
#X msg 85 -529 1;
#X msg 117 -529 0;
#X obj 103 -490 oscformat sound one;
#X obj 298 -584 loadbang;
#X obj 298 -558 delay 100;
#X obj 298 -532 t b b;
#X obj 475 -464 oscformat position;
#X obj 477 -495 pack f f f f;
#X obj 481 -530 t b f;
#X obj 520 -529 t b f;
#X obj 561 -529 t b f;
#X floatatom 435 -577 5 0 0 0 - - -;
#X floatatom 481 -577 5 0 0 0 - - -;
#X floatatom 522 -577 5 0 0 0 - - -;
#X floatatom 570 -577 5 0 0 0 - - -;
#X obj 380 -248 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1
1 1;
#X msg 396 -551 1;
#X connect 0 0 1 0;
#X connect 1 0 20 0;
#X connect 2 0 3 0;
#X connect 3 0 1 0;
#X connect 4 0 1 0;
#X connect 5 0 7 0;
#X connect 6 0 7 0;
#X connect 7 0 2 0;
#X connect 8 0 9 0;
#X connect 9 0 10 0;
#X connect 10 1 4 0;
#X connect 11 0 2 0;
#X connect 12 0 11 0;
#X connect 13 0 12 0;
#X connect 13 1 12 1;
#X connect 14 0 12 0;
#X connect 14 1 12 2;
#X connect 15 0 12 0;
#X connect 15 1 12 3;
#X connect 16 0 12 0;
#X connect 17 0 13 0;
#X connect 18 0 14 0;
#X connect 19 0 15 0;
#X connect 21 0 12 0;
#X coords 0 1905 5 1900 0 0 0;
#N canvas 162 185 810 748 10;
#X obj 41 149 netreceive -u -b;
#X msg 53 122 listen 0;
#X obj 41 171 oscparse;
#X obj 72 14 loadbang;
#X obj 73 36 del 100;
#X msg 41 94 listen 3721;
#X obj 42 199 route list;
#X obj 42 235 route sound;
#X msg 29 411 open ./sound.wav;
#X obj 41 655 dac~ 1 2;
#X obj 29 455 readsf~ 2;
#X msg 175 416 start;
#X obj 37 299 select 1 0;
#X obj 26 349 t b b;
#X obj 84 486 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X msg 223 414 stop;
#X obj 191 317 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X obj 135 269 print oscin;
#X obj 39 269 route one;
#X obj 60 600 *~;
#X obj 109 599 *~;
#X obj 408 235 route master;
#X obj 225 532 line~;
#X msg 224 500 \$1 100;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 2 0 6 0;
#X connect 3 0 4 0;
#X connect 5 0 0 0;
#X connect 6 0 7 0;
#X connect 6 0 21 0;
#X connect 7 0 18 0;
#X connect 8 0 10 0;
#X connect 10 0 19 0;
#X connect 10 1 20 0;
#X connect 10 2 14 0;
#X connect 11 0 10 0;
#X connect 12 0 13 0;
#X connect 12 1 15 0;
#X connect 13 0 11 0;
#X connect 13 1 8 0;
#X connect 14 0 13 0;
#X connect 15 0 10 0;
#X connect 16 0 13 0;
#X connect 18 0 12 0;
#X connect 18 0 17 0;
#X connect 19 0 9 0;
#X connect 20 0 9 1;
#X connect 21 0 23 0;
#X connect 22 0 19 1;
#X connect 22 0 20 1;
#X connect 23 0 22 0;
osc setup:
sending sounds to drones:
- sending to jetson running pd receiver patch
- select sound and loop it
- 16 bit wave file can be 2 channels
/sound/[index of sound]/[0-1 start stop]
sending positions to drones:
- receive positions from OSC message (so that host pc can be running pb)
- get positions from grid, scaled to room
-
/position/
volume control:
- sets master volume control on all sounds
/master/[amplitude 0-1]
helper notes:
pd -h -> find headless option nogui
index of sound might need to be spelled out, name of sound file
loadbang, put delay after initial load bang to start things
host patch should be able to send through modem without issue, we'll see if magic routing tables need to happen
# Import needed modules from osc4py3
# from osc4py3.as_eventloop import *
from osc4py3.as_allthreads import *
from osc4py3 import oscmethod as osm
def handlerfunction1(s, x, y):
# Will receive message data unpacked in s, x, y
print("{}, {}, {}".format(s,x,y))
pass
def handlerfunctionflex(address, *args):
# Will receive message data unpacked in s, x, y
print("from: " + address + ": " + str(args))
pass
def handlerfunction2(address, num):
# Will receive message address, and message data flattened in s, x, y
print("from: " + address)
print(num)
pass
# Start the system.
osc_startup()
# Make server channels to receive packets.
# osc_udp_server("192.168.0.0", 3721, "aservername")
osc_udp_server("127.0.0.1", 3721, "aservername")
# osc_udp_server("0.0.0.0", 3724, "anotherserver")
# osc_udp_server("127.0.0.1", 3724, "anotherserver")
# osc_method("/test/first", handlerfunction1)
osc_method("/position", handlerfunctionflex, argscheme=osm.OSCARG_ADDRESS + osm.OSCARG_DATAUNPACK)
osc_method("/sound/one", handlerfunctionflex, argscheme=osm.OSCARG_ADDRESS + osm.OSCARG_DATAUNPACK)
# # Too, but request the message address pattern before in argscheme
# osc_method("/test/second", handlerfunction2, argscheme=osm.OSCARG_ADDRESS + osm.OSCARG_DATAUNPACK)
while True:
try:
# wait for messages to come in...
pass
except KeyboardInterrupt:
break
# Properly close the system.
osc_terminate()
from osc4py3.as_eventloop import *
from osc4py3 import oscbuildparse
# Start the system.
osc_startup()
# Make client channels to send packets.
osc_udp_client("127.0.0.1", 3721, "tester") # why tf do these people like strings so much
msg1 = oscbuildparse.OSCMessage("/test/first", ",sif", ["text1", 111, 1.1111])
msg2 = oscbuildparse.OSCMessage("/test/second", ",sif", ["text2", 222, 2.222])
osc_send(msg1, "tester")
osc_send(msg2, "tester")
osc_process()
osc_process()
osc_terminate()
#N canvas 319 90 960 990 10;
#X obj 524 24 loadbang;
#X obj 525 46 del 100;
#X msg 447 93 \; pd dsp 1;
#X msg 521 154 read -resize ImperialMarch60.wav soundData;
#X obj 526 206 soundfiler;
#X floatatom 516 253 20 0 0 0 - - -;
#X obj 525 371 phasor~;
#X obj 529 407 *~;
#N canvas 0 50 450 250 (subpatch) 0;
#X array soundData 1.323e+06 float 4;
#X coords 0 1 1.323e+06 -1 200 140 1;
#X restore 611 547 graph;
#X msg 453 281 0;
#X obj 530 464 tabread4~ soundData;
#X obj 531 520 dac~;
#X obj 662 215 hsl 128 25 -0.01 0.01 0 0 empty empty empty -2 -8 0
10 -262144 -1 -1 0 1;
#X floatatom 670 265 5 0 0 0 - - -;
#X obj 523 317 expr $f2/$f1;
#X obj 557 280 samplerate~;
#X msg 676 305 0.015;
#X connect 0 0 1 0;
#X connect 1 0 3 0;
#X connect 1 0 2 0;
#X connect 1 0 16 0;
#X connect 3 0 4 0;
#X connect 4 0 5 0;
#X connect 5 0 7 1;
#X connect 5 0 14 0;
#X connect 6 0 7 0;
#X connect 7 0 10 0;
#X connect 9 0 6 0;
#X connect 10 0 11 0;
#X connect 10 0 11 1;
#X connect 12 0 13 0;
#X connect 13 0 6 0;
#X connect 14 0 6 0;
#X connect 15 0 14 1;
#X connect 16 0 6 0;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment