electro-music.com   Dedicated to experimental electro-acoustic
and electronic music
 
    Front Page  |  Articles  |  Radio
 |  Media  |  Forum  |  Wiki  |  Links  |  Store
Forum with support of Syndicator RSS
 FAQFAQ   CalendarCalendar   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   LinksLinks
 RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in  Chat RoomChat Room 
 Forum index » DIY Hardware and Software » ChucK programming language
Trouble sending OSC messages between python-osc and ChucK
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [1 Post]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
Author Message
Chiel



Joined: Apr 22, 2016
Posts: 1
Location: Utrecht

PostPosted: Fri Apr 22, 2016 12:35 am    Post subject: Trouble sending OSC messages between python-osc and ChucK
Subject description: OSC messages from a python-osc client are not picked up by ChucK server
Reply with quote  Mark this post and the followings unread

I'm trying to set up communication between chuck and python via the OSC (Open Sound Control) protocol. On the python side we're using the python-osc library and chuck natively supports the OSC protocol. It appears that the messages we send from the python side do not arrive at the chuck side. All other combinations, i.e. python to python, chuck to chuck and chuck to python are working fine though.
I'm running python 3.4.4 on windows 7.
What could be going wrong here?

Here are the four files with the client/server implementations I'm using for testing.


chuck_client.py:

Code:
    OscSend xmit;
    xmit.setHost("localhost", 5005);
    <<<"Sending">>>;
    xmit.startMsg("/debug");


chuck_server.py:

Code:
    OscRecv orec;
    5005 => orec.port;
    orec.listen();
    orec.event("/debug") @=> OscEvent e;
   
    <<<"Waiting">>>;
    e => now;
    <<<"Received">>>;


python_client.py:

Code:
    from pythonosc import osc_message_builder
    from pythonosc import udp_client
   
    client = udp_client.UDPClient('localhost', 5005)
    msg = osc_message_builder.OscMessageBuilder(address="/debug")
    msg = msg.build()
    print('Sending')
    client.send(msg)

python_server.py:

Code:
    from pythonosc import dispatcher
    from pythonosc import osc_server
   
    dispatcher = dispatcher.Dispatcher()
    dispatcher.map("/debug", lambda _: print('Received'))
   
    print('Waiting')
    server = osc_server.ThreadingOSCUDPServer(
        ('localhost', 5005), dispatcher)
    print("Serving on {}".format(server.server_address))
    server.serve_forever()
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic Moderators: Kassen
Page 1 of 1 [1 Post]
View unread posts
View new posts in the last week
Mark the topic unread :: View previous topic :: View next topic
 Forum index » DIY Hardware and Software » ChucK programming language
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum
e-m mkii

Please support our site. If you click through and buy from
our affiliate partners, we earn a small commission.


Forum with support of Syndicator RSS
Powered by phpBB © 2001, 2005 phpBB Group
Copyright © 2003 through 2009 by electro-music.com - Conditions Of Use