当前位置: 首页>>代码示例>>Python>>正文


Python OSC.getUrlStr方法代码示例

本文整理汇总了Python中OSC.getUrlStr方法的典型用法代码示例。如果您正苦于以下问题:Python OSC.getUrlStr方法的具体用法?Python OSC.getUrlStr怎么用?Python OSC.getUrlStr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OSC的用法示例。


在下文中一共展示了OSC.getUrlStr方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: all_handler

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
def all_handler(addr, tags, stuff, source):
    print "received new osc msg from %s" % OSC.getUrlStr(source)
    f_out.write(OSC.getUrlStr(source)+'; ')
    print "with addr : %s" % addr
    f_out.write(addr+'; ')
    print "typetags %s" % tags
    print "data %s" % stuff
    f_out.write(addr+'; ')
    f_out.write(str(stuff[0])+'; ')
    f_out.write(str(time.time())+'; ')
    f_out.write('humanreadable: '+datetime.fromtimestamp(int(time.time())).strftime('%Y-%m-%d %H:%M:%S'))
    f_out.write('\n')
开发者ID:jazoza,项目名称:connect-or-not-at-k4,代码行数:14,代码来源:log-osc-traffic-49999.py

示例2: all_handler

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
def all_handler(addr, tags, stuff, source):
    print "received new osc msg from %s" % OSC.getUrlStr(source)
    f_out.write(OSC.getUrlStr(source)+'; ')
    print "with addr : %s" % addr
    f_out.write(addr+'; ')
    print "typetags %s" % tags
    print "data %s" % stuff
    for smth in stuff:
        print smth
        f_out.write(str(smth))
        f_out.write('; ')
    f_out.write(str(time.time())+'; ')
    f_out.write('\n')
开发者ID:jazoza,项目名称:milicone,代码行数:15,代码来源:log-osc-traffic-49999.py

示例3: osc_printing_handler

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
 def osc_printing_handler(self, addr, tags, stuff, source):
     msg_string = "%s [%s] %s" % (addr, tags, str(stuff))
     sys.stdout.write("OSCServer Got: '%s' from %s\n" % (msg_string, OSC.getUrlStr(source)))
     # send a reply to the client.
     msg = OSC.OSCMessage("/printed")
     msg.append(msg_string)
     return msg
开发者ID:Vadiza,项目名称:sage-3.5b,代码行数:9,代码来源:soundUI.py

示例4: handle_root

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
def handle_root(addr, tags, data, source):
	print "---"
	print "received new osc msg from %s" % OSC.getUrlStr(source)
	print "with addr : %s" % addr
	print "typetags %s" % tags
	print "data %s" % data
	print "---"
开发者ID:benhinchley,项目名称:fiberlamp-hid,代码行数:9,代码来源:illuminator.py

示例5: printer

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
def printer(addr, tags, stuff, source):
   	print "---"
    	print "received new osc msg from %s" % OSC.getUrlStr(source)
    	print "with addr : %s" % addr
    	print "typetags %s" % tags
    	print "data %s" % stuff
    	print "---"
开发者ID:mattbrailsford,项目名称:LuxOSC,代码行数:9,代码来源:luxosc.py

示例6: countsHandler

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
def countsHandler(addr,tags,stuff,source):
    print '---'
    print 'new msg from %s' % OSC.getUrlStr(source)
    print 'with addr: %s' % addr
    print 'typetags %s' % tags
    print 'data %s' %stuff
    print '---'
开发者ID:compcore,项目名称:LaserVoting,代码行数:9,代码来源:server.py

示例7: forward_handler

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
def forward_handler(addr, tags, data, source):
    global prefix
    global scake
    global offset

    if debug > 1:
        print("---")
        print("source %s" % OSC.getUrlStr(source))
        print("addr   %s" % addr)
        print("tags   %s" % tags)
        print("data   %s" % data)

    if addr[0] != '/':
        # ensure it starts with a slash
        addr = '/' + addr

    if tags == 'f' or tags == 'i':
        # it is a single value
        key = prefix + addr.replace('/', '.')
        val = EEGsynth.rescale(data[0], slope=scale, offset=offset)
        patch.setvalue(key, val)

    else:
        for i in range(len(data)):
            # it is a list, send it as multiple scalar control values
            # append the index to the key, this starts with 0
            key = prefix + addr.replace('/', '.') + '.%i' % i
            val = EEGsynth.rescale(data[i], slope=scale, offset=offset)
            patch.setvalue(key, val)
开发者ID:nicofarr,项目名称:eegsynth,代码行数:31,代码来源:inputosc.py

示例8: _drop

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
 def _drop(self, message, addr, tags, packet, source, route=None):
     logging.debug("DROPPED (%s) from %s" % (message, OSC.getUrlStr(source)))
     logging.debug("\taddr: %s" % addr)
     logging.debug("\ttypetags: %s" % tags)
     logging.debug("\tdata: %s" % packet)
     if route:
         logging.debug("\troute: %s" % route)
开发者ID:baymax84,项目名称:SyncJams,代码行数:9,代码来源:syncjams.py

示例9: transport_handler

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
def transport_handler(addr, tags, args, source):
    print "---"
    print "received new osc msg from %s" % OSC.getUrlStr(source)
    print "with addr : %s" % addr
    print "typetags %s" % tags
    print "args %s" % args
    print "---"
开发者ID:jesseengel,项目名称:PlayableDelaySetup,代码行数:9,代码来源:Python_OSC.py

示例10: printing_handler

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
def printing_handler(addr, tags, stuff, source):
    print "---"
    print "received from :  %s" % OSC.getUrlStr(source)
    print "with addr : %s" % addr
    print "typetags : %s" % tags
    print "data : %s" % stuff
    print "---"
开发者ID:alx-s,项目名称:ABCDerres,代码行数:9,代码来源:receive_OSC.py

示例11: no_match_handler

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
 def no_match_handler(self,addr, tags, stuff, source):
     text=''
     text+= "no match for new osc msg from %s" % OSC.getUrlStr(source)+'\n'
     text+= "with addr : %s" % addr+'\n'
     text+= "typetags %s" % tags+'\n'
     text+= "data %s" % stuff+'\n'
     self.add_status(text+'\n')
开发者ID:athope,项目名称:pipresents-gapless,代码行数:9,代码来源:pp_oscremote.py

示例12: trata

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
def trata(addr, tags, dados, origem):
    m = "%s [%s] %s" % (addr, tags, str(dados))
    #t="%s enviou: %s\n" % (osc.getUrlStr(origem), m)
    t=str((osc.getUrlStr(origem), m))
    print t
    with open("log-golly.txt", "a") as f:
        f.write(t)
开发者ID:automata,项目名称:AutomatosGeradores,代码行数:9,代码来源:GollyServer.py

示例13: fader_handler

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
def fader_handler(addr, tags, data, source):
    print "---"
    print "received FADER new osc msg from %s" % OSC.getUrlStr(source)
    print "with addr : %s" % addr
    print "typetags %s" % tags
    print "data %s" % data
    split = addr.split("/")
    print "split", split
    # split[2] is nu faderx, we want the id
    fadernr = int(split[2][-1:])
    print "fadernr = ", fadernr
    # Add one and loop aftre we are at 5
    next_fader = (fadernr % 5) + 1
    return_addr = "/1/fader%s" % next_fader
    print "Return addres", return_addr
    msg = OSC.OSCMessage()
    msg.setAddress(return_addr)
    msg.append(data)
    c.send(msg)
    print "return message %s" % msg
    print "---"
    if 1 <= fadernr <= 4 and data[0] >= 0.5:
        msg = OSC.OSCMessage()
        toggle_addr = "/1/toggle%s" % fadernr
        msg.setAddress(toggle_addr)
        msg.append(1.0)
        c.send(msg)
        print "return message %s" % msg
    else:
        msg = OSC.OSCMessage()
        toggle_addr = "/1/toggle%s" % fadernr
        msg.setAddress(toggle_addr)
        msg.append(0.0)
        c.send(msg)
        print "return message %s" % msg
开发者ID:RoelAdriaans,项目名称:PyTouchOSC,代码行数:37,代码来源:pyosc1.py

示例14: printing_handler

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
def printing_handler(addr, tags, stuff, source):
    print "---"
    print "received new osc msg from %s" % OSC.getUrlStr(source)
    print "with addr : %s" % addr
    print "typetags %s" % tags
    print "data %s" % stuff
    print "---"

    url="http://www.musicalturk.com/loops/add"
 

    shutil.move('/Users/Kleeb2/Documents/MaxPatches/MusicalTurk/'+ str(stuff[0]), "/Users/Kleeb2/Documents/Web/Python/Thesis/"+str(stuff[0])) 
    filename = str(stuff[0])
    #filename =  '/Users/Kleeb2/Documents/Web/Python/LocalThesis/max.py'
    title = 'test'#str(count).zfill(3)
    date = str(datetime.date.today()) 
    values = [('title', title), ('postedby',date)]
    try:
    	files = {'loop': open(filename, 'rb')}
    except:
    	print 'no file'
    try:
    	r = requests.post(url, files=files, data=values)
    	print r.text
    except:
    	print 'Fail'
开发者ID:markkleeb,项目名称:MusicalTurk,代码行数:28,代码来源:max.py

示例15: bgblue_handler

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import getUrlStr [as 别名]
def bgblue_handler(addr, tags, stuff, source):
    if layer.PRINT_BLUE:
        print "---"
        print "received new osc bgrgb msg from %s" % OSC.getUrlStr(source)
        print "with addr : %s" % addr
        print "typetags %s" % tags
        print "data %s" % stuff
        print "---"
开发者ID:SIGMusic,项目名称:LeapMusic,代码行数:10,代码来源:AudioLayer.py


注:本文中的OSC.getUrlStr方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。