[chuck-users] ChuK control via OSC

altern altern2 at gmail.com
Tue Jan 16 15:41:04 EST 2007


Tom Lieber wrote:
> On 1/16/07, altern <altern2 at gmail.com> wrote:
>> the easiest way to send/receive OSC i know is using python. It gets as
>> simple as this:
>> import osc
>> osc.init()
>> osc.sendMsg('/blah', [6.9999])
>>
>> For this you need to install python
>> www.python.org
>> and SimpleOSC library for python
>> http://www.ixi-software.net/content/download/simpleosc0.2.3.zip
>> To install simpleosc you can use the setup.py from command line or just
>> uncompress the zip and copy the osc folder into
>> c:\Python2.x\Lib\site-packages
>> check readme.txt file and app.py example for detailes on how to use.
> 
> When I try
> 
> import osc
> osc.init()
> 
> from the Python console in Windows, it works. When I put it in a file
> then run "python mine.py" it fails with the message that "init" is not
> defined. What could the difference be?

thats weird, did you put the osc module (the osc folder) in the right 
place? (c:\Python2.X\Lib\site-packages)

do you trigger "python mine.py" from command line in the windows 
terminal? and the python console you mean the interactive python 
shortcut from the python menu? It could be that you have two different 
versions on python installed but this should not be a problem on windows 
as far as i remember.

otherwise try doing
print dir(osc)
in both the python console and the mine.py, just after importing osc 
module before the osc.init(). The init function should be listed in the 
dictionary you get printed into the output window.

beware that there is an OSC.py file inside the osc module. you might 
have copied only the OSC.py file and not the osc folder with all the 
files included?

another option is that you have another module called osc and there is a 
naming conflict. Or maybe there is a folder called osc inside the folder 
where the mine.py is located? try to move the mine.py file somewhere else.

let me know if you get it working

enrike


More information about the chuck-users mailing list