本文整理汇总了Python中OSC.OSCMessage.extend方法的典型用法代码示例。如果您正苦于以下问题:Python OSCMessage.extend方法的具体用法?Python OSCMessage.extend怎么用?Python OSCMessage.extend使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OSC.OSCMessage
的用法示例。
在下文中一共展示了OSCMessage.extend方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: sendOscMessage
# 需要导入模块: from OSC import OSCMessage [as 别名]
# 或者: from OSC.OSCMessage import extend [as 别名]
def sendOscMessage(_x, _y, _w, _h):
if x > 1 and y > 1:
global client
connectOsc()
msg = OSCMessage("/shast/coordinates")
msg.extend([_x, _y, _w, _h])
client.send( msg )
示例2: relayMessageCallback
# 需要导入模块: from OSC import OSCMessage [as 别名]
# 或者: from OSC.OSCMessage import extend [as 别名]
def relayMessageCallback(path, tags, args, source):
global faderLightFeedback
# print "--- received:"
# print "path="+str(path)
# print "tags="+str(tags)
# print "args="+str(args)
# print "source="+str(source)
for client in clients:
msg = OSCMessage(path)
msg.extend(args)
client[0].send(msg)
print "relaying to " + str(client[1]) + " : " + str(msg)
示例3: transect_handler
# 需要导入模块: from OSC import OSCMessage [as 别名]
# 或者: from OSC.OSCMessage import extend [as 别名]
def transect_handler(osc_path=None, osc_tags=None, osc_args=None, osc_source=None):
node = osc_args[0]
idx = osc_args[1]
curr_amp = float(osc_args[2])
lookup = osc_args[3:] #ignores the amplitude
dists, indices = tree.query(lookup, k=n_results, return_distance=True)
dists = dists.flatten()
indices = indices.flatten()
print "hunting", lookup
times = sample_times[indices]
makeup_gains = (curr_amp/amps[indices])
# send scsynth bus messages
print "dispatching", bus_num, n_results*3, times, makeup_gains, dists
msg = OSCMessage("/c_setn", [bus_num, n_results*3])
#msg.extend()
msg.extend(times)
msg.extend(makeup_gains)
msg.extend(dists)
sc_synth_client.sendto(msg, ("127.0.0.1", sc_synth_port))