test with sc-im

master
grgr 2 years ago
parent b59fa81c09
commit d50801fe98

@ -4,11 +4,11 @@ from pythonosc.udp_client import SimpleUDPClient
# OSC client connection # OSC client connection
ip= "192.168.43.216" #"127.0.0.1" ip= "192.168.1.128" # "192.168.43.216" "127.0.0.1"
port= 9000 port= 9000
client = SimpleUDPClient(ip, port) #create client client = SimpleUDPClient(ip, port) #create client
# client.send_message("/sc", "hello")
@ -31,13 +31,13 @@ def update_bpm(bpm, tempo):
def play_sheet(): def play_sheet():
with open('tracker.csv', newline='') as f: with open('inputscim.csv', newline='') as f:
tracker = csv.DictReader(f) tracker = csv.DictReader(f)
for row in tracker: for row in tracker:
row = row['tum'], row['ts'], row['cha'] row = row['tum'], row['ts'], row['cha']
client.send_message("/vvvv", row) client.send_message("/sc", row)
print(' '.join(row)) # print(' '.join(row)) #it gives problems
time.sleep(update_bpm(bpm, tempo)) time.sleep(update_bpm(bpm, tempo))
@ -45,8 +45,9 @@ def play_sheet():
while True: while True:
play_sheet() play_sheet()
client.send_message("/sc", " ")
# connect to pd osc # connect to pd osc

@ -0,0 +1,17 @@
tum,ts,cha
440.00
,410.00
,1420.00,610.0
720.00,,240.0
,620.00
880.00,,380.0
,1500.00
240.00
440.00
,360.00,620.0
880.00,440.00
1 tum,ts,cha
2 440.00
3 ,410.00
4 ,1420.00,610.0
5 720.00,,240.0
6 ,620.00
7 880.00,,380.0
8 ,1500.00
9 240.00
10 440.00
11 ,360.00,620.0
12 880.00,440.00

@ -0,0 +1,30 @@
# This data file was generated by the Spreadsheet Calculator Improvised (sc-im)
# You almost certainly shouldn't edit it.
newsheet "Sheet1"
movetosheet "Sheet1"
offscr_sc_cols 0
offscr_sc_rows 0
nb_frozen_rows 0
nb_frozen_cols 0
nb_frozen_screenrows 0
nb_frozen_screencols 0
format C 10 1 0
leftstring A0 = "tum"
leftstring B0 = "ts"
leftstring C0 = "cha"
let A1 = 440
let B2 = 410
let B3 = 400
let C3 = 610
let A5 = 720
let B7 = 620
let A9 = 880
let C9 = 380
let B11 = 1500
let A13 = 440
let C14 = 620
let A16 = 880
let B16 = 440
goto B2
movetosheet "Sheet1"

@ -42,7 +42,7 @@
<Pin Id="FAQ5jZlJ8VeObam7uqUpUU" Name="Data Preview" Kind="OutputPin" /> <Pin Id="FAQ5jZlJ8VeObam7uqUpUU" Name="Data Preview" Kind="OutputPin" />
<Pin Id="Uwyfc8ZkbKAO7TJ4M05bh6" Name="Is Open" Kind="OutputPin" /> <Pin Id="Uwyfc8ZkbKAO7TJ4M05bh6" Name="Is Open" Kind="OutputPin" />
</Node> </Node>
<Pad Id="UrHKUWmZHmkNDOefoEpzfC" Comment="Listening IP" Bounds="130,106,41,15" ShowValueBox="true" isIOBox="true" Value="192.168.43.216"> <Pad Id="UrHKUWmZHmkNDOefoEpzfC" Comment="Listening IP" Bounds="130,106,41,15" ShowValueBox="true" isIOBox="true" Value="192.168.1.128">
<p:TypeAnnotation LastCategoryFullName="Primitive" LastSymbolSource="CoreLibBasics.vl"> <p:TypeAnnotation LastCategoryFullName="Primitive" LastSymbolSource="CoreLibBasics.vl">
<Choice Kind="TypeFlag" Name="String" /> <Choice Kind="TypeFlag" Name="String" />
</p:TypeAnnotation> </p:TypeAnnotation>
@ -251,7 +251,7 @@
<Choice Kind="ProcessAppFlag" Name="OSCReceiver" /> <Choice Kind="ProcessAppFlag" Name="OSCReceiver" />
</p:NodeReference> </p:NodeReference>
<Pin Id="O1R6G823pYlLLRi3atSwCF" Name="Input" Kind="InputPin" /> <Pin Id="O1R6G823pYlLLRi3atSwCF" Name="Input" Kind="InputPin" />
<Pin Id="JEfu2x5FYAZLJjfOCblBgt" Name="Address" Kind="InputPin" DefaultValue="/vvvv" /> <Pin Id="JEfu2x5FYAZLJjfOCblBgt" Name="Address" Kind="InputPin" DefaultValue="/sc" />
<Pin Id="SaIPRsiKNINPWNxzsv5LqD" Name="Learn" Kind="InputPin" /> <Pin Id="SaIPRsiKNINPWNxzsv5LqD" Name="Learn" Kind="InputPin" />
<Pin Id="CyDc6ZsBlOyNA8s0VHxB0D" Name="Output" Kind="OutputPin" /> <Pin Id="CyDc6ZsBlOyNA8s0VHxB0D" Name="Output" Kind="OutputPin" />
<Pin Id="Aw9VybAZx8dLp4RB2HX1hs" Name="Is Learning" Kind="OutputPin" /> <Pin Id="Aw9VybAZx8dLp4RB2HX1hs" Name="Is Learning" Kind="OutputPin" />

@ -1,6 +1,14 @@
n = NetAddr.localAddr; NetAddr.localAddr;
thisProcess.openUDPPort(7771); // attempt to open 1121
thisProcess.openPorts; // list all open ports
o = OSCFunc({arg msg, time, addr, recvPort; [msg, time, addr, recvPort].postln;}, '/goodbye', n);
o.free; n = NetAddr.new("127.0.0.1", 7771); // create the NetAddr
OSCFunc.trace(true); // Turn posting on
OSCFunc.trace(false); // Turn posting off
o = OSCFunc({ arg msg, time, addr, recvPort; [msg].postln; }, '/sc', n);
o.free; // remove the osc function when you're done
Loading…
Cancel
Save