[chuck-users] ChuK control via OSC

karl petermichl audioworld at gmail.com
Tue Jan 16 18:10:19 EST 2007


Thanks to all who helped so far,
I fiddled around for 6 hours now, and I am "almost" giving up..---)))
After reading all the different tipps, I tried the following:

1) downloading WireShark to analyse which strings JAVAOSC is transmitting
Result: Zero, as after a lot of googling I found out that under WINDOWS,
Wireshark can not listen to localhost....-)))
So I gave up on JAVAOSC for the moment...

2) following this very interesting project in the Princeton WIKI: JucK (this
is just what we need....)
http://wiki.cs.princeton.edu/index.php/JucK_Doc
Result: Zero, as I could not find the Compilation: javac Juck.java online
anywhere

3) finding, installing and trying out the following very interesting links
(maybe this helps somebody):
http://www.grahamwakefield.net/MAT-F04/233/index.html
http://www.auditorium-project.org.uk/documentation/gettingstarted/
http://www2.realizedsound.net:8080/downloads/vst2osc/
http://www.sciss.de/swingOSC/
http://sourceforge.net/projects/meloncillo/
Result: Zero, as none of those wonderful applications gave me any insight
into which strings they are transmitting...

4) coming back to PYTHON, installing python_2.5 with TKINTER and SIMPLEOSC:
I pasted ALTERN´s basic code in a python script, debugged it with IDLE
(right click with mouse-->run module)
--> found out that it is important that the folder "osc" is in the path
c:\Python2.X\Lib\site-packages (thanks ALTERN!)
--> otherwise IDLE reports "module osc not found"
Result: Yppieeee!!! as a first success, python was running the simpleosc
script and showing me a nice little GUI fader!!!
>From the python script I got my first transmitted string name: "/slider1"
And I got the transmission port: 9000

5) back to ChucK, reading the EVENT section over and over, comparing with
the OSCEVENT example:
Result: not really a success. My ChucK shred still cannot read the fader
value from SIMPLEOSC. Somehow I feel lost in the relationship between an
OSCRECV and an OSCEVENT, and how to read out the OSC.event data...
here is my shred (and yes, I DID TURN OFF MY FIREWALL!!!):

OscRecv orec;
9000 => orec.port;
int data;
orec.listen();
function void get_osc_data()
{
orec.event("/slider1,int") @=> OscEvent oscdata;
while ( true )
{
oscdata => now;
while( oscdata.nextMsg() != 0 )
{oscdata.getInt()=> data;}
}
}
while (true)
{
get_osc_data;
<<<data>>>;
.1::second=>now;
}


Result: shred prints out "0" constantly, ignoring me moving the python fader
desperately....
Help? PLEASE!

Exhausted greetings,
Karl.







-----Ursprüngliche Nachricht-----
Von: chuck-users-bounces at lists.cs.princeton.edu
[mailto:chuck-users-bounces at lists.cs.princeton.edu] Im Auftrag von altern
Gesendet: Dienstag, 16. Januar 2007 21:41
An: ChucK Users Mailing List
Betreff: Re: [chuck-users] ChuK control via OSC

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
_______________________________________________
chuck-users mailing list
chuck-users at lists.cs.princeton.edu
https://lists.cs.princeton.edu/mailman/listinfo/chuck-users

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.12/630 - Release Date: 15.01.2007
20:28
 

-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.16.12/630 - Release Date: 15.01.2007
20:28
 



More information about the chuck-users mailing list