1

I'm working on a python script to send OSC messages to MOTU's Cuemix software. After much hackery, I was finally able to set a high value, and a low value with two different scripts.

These scripts are SND_UP and SND_DOWN : https://github.com/derjur/KnobOSC

This is great and all, but the point of this project was to get a rotary knob to turn up and down with a configurable granularity. But I need to know the current value of the Cuemix knob in order to change it by a relative amount in my scripts.

tl;dr - I need to query the state of a device through OSC to get its current value...

Additionally, when I run pyosc in server mode, I receive this error for all sorts of OSC addresses... (posting the one line of several thousand that's relevant to the control I want to modify).

OSCServer: NoCallbackError on request from NYNAEVE:50106: No callback registered to handle OSC-address '/dev/0/0/mon'

derjur
  • 123
  • 3

1 Answers1

1

I know it's been a long time, but this could be good for someone sometime.

When implementing a receiver using pyOSC you need to create a function to handle a value when it's received. The error messages says you didn't specify a callback handler, but as you can see here on the example, you should do something like this:

def default_handler(addr, tags, stuff, source):
    print "SERVER: No handler registered for ", addr
    return None

def user_callback(path, tags, args, source):
    # which user will be determined by path:
    # we just throw away all slashes and join together what's left
    user = ''.join(path.split("/"))
    # tags will contain 'fff'
    # args is a OSCMessage with data
    # source is where the message came from (in case you need to reply)
    print ("Now do something with", user,args[2],args[0],1-args[1]) 

server.addMsgHandler("default", default_handler)
server.addMsgHandler( "/user/1", user_callback )
server.addMsgHandler( "/user/2", user_callback )

The library example is a great way to learn this stuff.

George
  • 6,886
  • 3
  • 44
  • 56
  • Much appreciated! I ended up buying an outboard mixer with a big volume knob, but I will certainly get around to trying this sometime soon! – derjur Mar 19 '16 at 13:47