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


Python OSC.OSCClient方法代码示例

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


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

示例1: freeze_playfile

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import OSCClient [as 别名]
def freeze_playfile(self, new_file, dry_value=1., loop_status=True):
        """
            default synth (freeze)
        """

        # OSC Client (i.e. send OSC to SuperCollider)
        osc_client = OSC.OSCClient()

        osc_client.connect( ( self.sc_IP, self.sc_Port ) )

        #TODO: write to $DATE_performance.log
        print("\n\n***\n\t (sending OSC) Playing %s/%s\n\n"%(os.environ["PWD"],new_file))
        msg = OSC.OSCMessage()
        msg.setAddress("/playfreeze") # (file,voice_number)
        msg.append( "%s/%s"%(os.environ["PWD"],new_file) )
        msg.append( self.enabled_voice-1) #convert to [0..7] range

        try:
            osc_client.send(msg)
        except Exception,e:
            print(e)
        #TODO: get duration from msg (via API)
        # time.sleep(duration)
        #()
#class 
开发者ID:sonidosmutantes,项目名称:apicultor,代码行数:27,代码来源:SuperColliderServer.py

示例2: activate

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import OSCClient [as 别名]
def activate(self):
        if len(self.args) > 0:
            self.ip = self.args[0]
        if len(self.args) > 1:
            self.port = int(self.args[1])
        if len(self.args) > 2:
            self.address = self.args[2]
        # init network
        print "Selecting OSC streaming. IP: ", self.ip, ", port: ", self.port, ", address: ", self.address
        self.client = OSCClient()
        self.client.connect((self.ip, self.port))

    # From IPlugin: close connections, send message to client 
开发者ID:neurotechuoft,项目名称:Wall-EEG,代码行数:15,代码来源:streamer_osc.py

示例3: __init__

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import OSCClient [as 别名]
def __init__(self):
        super(FakeClient, self).__init__()
        self.listen_address = (OSC_default_address, OSC_default_port)
        self.c = OSC.OSCClient() 
开发者ID:PedroLopes,项目名称:muscle-plotter,代码行数:6,代码来源:anoto_mouse_emulator.py

示例4: get_osc_client

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import OSCClient [as 别名]
def get_osc_client(host='localhost', port=defaults['port'], say_hello=False):
    # String, int -> OSCClient

    client = OSCClient()
    client.connect((host, port))

    # TODO Make this work
    if say_hello:
        send_simple_message(client, "/hello", timeout=None)

    return client 
开发者ID:house-of-enlightenment,项目名称:house-of-enlightenment,代码行数:13,代码来源:osc_utils.py

示例5: send_simple_message

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import OSCClient [as 别名]
def send_simple_message(client, path, data=[], timeout=None):
    # OSCClient, String, String, int -> None
    msg = OSCMessage(path)
    for d in data:
        msg.append(d)
    client.send(msg, timeout) 
开发者ID:house-of-enlightenment,项目名称:house-of-enlightenment,代码行数:8,代码来源:osc_utils.py

示例6: update_state_fallback

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import OSCClient [as 别名]
def update_state_fallback(path, args, types, src):
    global state
    global osc_desc_state
    # print("got unknown message '%s' from '%s'" % (path, src.url))
    # for a, t in zip(args, types):
    #     print("argument of type '%s': %s" % (t, a))
    msg = path[1:]
    value = args[0]
    print("Received %s %s"%(path,args))

    if msg[-3:]=="/on":
        # print("ON/OFF: %s", value)
        desc = msg[:-3]
        osc_desc_state[desc] = True if value==1 else False
        print( "%s state %i"%(desc,osc_desc_state[desc]) )
        return
    if msg in osc_descriptors:
        desc = msg
        state[ desc ] = value
        print( "MIR state updated! %s: %f"%(desc,value) )
    print("Value %s"%value)


# OSC Client (i.e. send OSC to SuperCollider)
# osc_client = OSC.OSCClient()
# sc_Port = 57120
# sc_IP = '127.0.0.1' #Local SC server
#sc_IP = '10.142.39.109' #Remote server
# Virtual Box: Network device config not in bridge or NAT mode
# Select 'Network host-only adapter' (Name=vboxnet0)
# sc_IP = '192.168.56.1' # Remote server is the host of the VM
# osc_client.connect( ( sc_IP, sc_Port ) )


### Signal handler (ctrl+c) 
开发者ID:sonidosmutantes,项目名称:apicultor,代码行数:37,代码来源:PlayCtrlState.py

示例7: setup_OSC_client

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import OSCClient [as 别名]
def setup_OSC_client(self, address):
        """Setup a new OSC client"""
        self.OSC_client = OSC.OSCClient()
        self.OSC_client.connect(address)
        self.do_we_have_a_client = True 
开发者ID:adamrgodfrey,项目名称:RoadKingsApocalypse,代码行数:7,代码来源:osc.py

示例8: __init__

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import OSCClient [as 别名]
def __init__(self, maxVoices, ip, port):
        self.playing = []
        self.ip = ip
        self.port = port
        self.osc = OSC.OSCClient()
        self.osc.connect((ip, port)) 
开发者ID:computerstaat,项目名称:PDModular,代码行数:8,代码来源:conductor.py

示例9: __init__

# 需要导入模块: import OSC [as 别名]
# 或者: from OSC import OSCClient [as 别名]
def __init__ (self, master):
    self.master =master
    self.PureData = PureData()
    self.loc =self.dragged =0
    tk.Frame.__init__ (self, master)

    self.AllModules = list()
    self.Cables = list()
    self.osc = OSC.OSCClient()
    self.osc.connect((IP, PORT))

    self.menubar = Menu(self)

    menu = Menu(self.menubar, tearoff=0)
    self.menubar.add_cascade(label="File", menu=menu)
    menu.add_command(label="Save", command=self.Save)
    menu.add_command(label="Load", command=self.Load)
    menu.add_command(label="New")
    menu.add_command(label="Exit", command=self.killEmAll)

    menu = Menu(self.menubar, tearoff=0)
    self.menubar.add_cascade(label="Choose Module", menu=menu)
    for module in sorted(modules.keys()):
      menu.add_command(label=module, command=(lambda module :lambda :self.AllModules.append(Module(self.canvas, module, CanvasWidth/2, CanvasHeight/2, self, self.osc)))(module))
    
    menu = Menu(self.menubar, tearoff=0)
    self.menubar.add_cascade(label="Cable Color", menu=menu)
    for color in chooseCableColor.getAllColors():
      menu.add_command(label=color, command=(lambda color :lambda :chooseCableColor.setCurrentColor(color))(color))

    self.canvas =tk.Canvas (self, width =CanvasWidth, height =CanvasHeight,
      relief =tk.RIDGE, background ="white", borderwidth =1)

    menubar = Menu(root)

    try:
        self.master.config(menu=self.menubar)
    except AttributeError:
        # master is a toplevel window (Python 1.4/Tkinter 1.63)
        self.master.tk.call(master, "config", "-menu", self.menubar)

    # chooseModules(self.canvas, 10, 10, self)
    self.buildCase()
    self.canvas.pack (expand =1, fill =tk.BOTH)

    #mp = self.midiParameter(self.master, self.canvas) 
开发者ID:computerstaat,项目名称:PDModular,代码行数:48,代码来源:SynthBuilder.py


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