hi
I am passing to PD few strings via OSC like /blah mystring
How can I check the value of the string? I was using the select object like this select mystring myotherstring
but PD doesnt like it . It says that select is not a method for the argument i pass. I tried to pass the string as a symbol by sending "symbol mystring" with same negative result.
i am sending the OSC messages from macromedia director via Python (thanks to xPython xtra for director).
I have also problems with negative numbers. If I pass -1 for example PD gets some ridiculous number like 4.29497e+009. i am not sure if this is the representation of a negative number and then i need to translate it or if this is an error. I am not sure if the problem is from PD, Python or director.
suggestions?
thanks!
enrike ::
enrike wrote: ...
I have also problems with negative numbers. If I pass -1 for example PD gets some ridiculous number like 4.29497e+009. i am not sure if this is the representation of a negative number and then i need to translate it or if this is an error. I am not sure if the problem is from PD, Python or director.
I have already pointed this one out:
In OSCx/OSC/dumpOSC.c line 743, in the function dumpOSC_PrintTypeTaggedArgs():
change SETFLOAT(mya+myargc,ntohl(*((int *) p))); to SETFLOAT(mya+myargc,(signed)ntohl(*((int *) p)));
...since ntohl returns an unsigned integer, you get 0xFFFFFFFF for -1, which equals 4294967295 decimal...
Martin
Hi
It would be nice if someone could correct this and compile the OSC external again. Not all window's users can afford buying a copy of Visual C to compile externals.
I have already pointed this one out:
In OSCx/OSC/dumpOSC.c line 743, in the function dumpOSC_PrintTypeTaggedArgs():
change SETFLOAT(mya+myargc,ntohl(*((int *) p))); to SETFLOAT(mya+myargc,(signed)ntohl(*((int *) p)));
...since ntohl returns an unsigned integer, you get 0xFFFFFFFF for -1, which equals 4294967295 decimal...
enrike wrote:
hi
I am passing to PD few strings via OSC like /blah mystring
How can I check the value of the string? I was using the select object like this select mystring myotherstring
but PD doesnt like it . It says that select is not a method for the argument i pass. I tried to pass the string as a symbol by sending "symbol mystring" with same negative result.
try casting your string to symbol with the [symbol] object before the [select]
mfg.a.sdr IOhannes
try casting your string to symbol with the [symbol] object before the [select]
I see. but the problem is that I am sending several types of messages under the same address like /spin 111 0 12 /spin xxx /spin zzz
maybe i should specify another address? like: /spin/xxx 1
This way I might not need the select object but the OSCroute. Still trying to format my way of thinking into OSC ;-)
Hi again,
this wouldnt work of course, my problem is a bit different than i thought.
in my path I will have many similar objects, far more that 20 possibly. And the OSCroute object is limited to 20 addresses. So I use a normal route object to route the info to the objects. I need to send several types of messages to that object. Lets think its a sample playr. When i play the sample i need to pass numbers like freq, voluume, etc... but at some other point i also need to pass the object the path to load the sample from the harddrive.
i am using the following structure for the OSC messages /spin 1 100 100 meaning this /adress identifier volume frequency
But at some other point i need to pass /spin 1 "C:\mysound.wav" or /spin 1 "someothertag"
I attach an example of what i am doing.
suggestions are welcome. thanks!
try casting your string to symbol with the [symbol] object before the [select]
I see. but the problem is that I am sending several types of messages under the same address like /spin 111 0 12 /spin xxx /spin zzz
maybe i should specify another address? like: /spin/xxx 1
This way I might not need the select object but the OSCroute. Still trying to format my way of thinking into OSC ;-)
Hallo, enrike hat gesagt: // enrike wrote:
this wouldnt work of course, my problem is a bit different than i thought.
in my path I will have many similar objects, far more that 20 possibly. And the OSCroute object is limited to 20 addresses. So I use a normal route object to route the info to the objects.
First: You can of course use more than one OSCroute object in a patch. The last outlet of OSCroute passes on messages, that don't match. Just connect another OSCroute there:
[OSCroute /spin /vol ...] | [OSCroute /file /help]
I need to send several types of messages to that object. Lets think its a sample playr. When i play the sample i need to pass numbers like freq, voluume, etc... but at some other point i also need to pass the object the path to load the sample from the harddrive.
I would say, that a filename and a frequency value are very different things, and thus you should not use the same OSC selector for both. It feels wrong. A better approach IMO would be, to use the hierarchies possible in OSC like "/spin/freq 60" and "/spin/filename theFile.wav".
See attached patch for example implenetations of both ideas.
Frank Barknecht _ ______footils.org__
Hallo, Frank Barknecht hat gesagt: // Frank Barknecht wrote:
See attached patch for example implenetations of both ideas.
I forgot to say, that all patches in my RRADical collection use OSC to remote control *everything*:
http://footils.org/cms/pydiddy/wiki/RradicalPd
Frank Barknecht _ ______footils.org__
oh! not in my version of OSC external this is weird I checked yesterday and the version on the website is the same as mine as far as i can see. My osc external is version 0.01-w32, compiled Apr 18 2002 and PD is 0.37.0
First: You can of course use more than one OSCroute object in a patch. The last outlet of OSCroute passes on messages, that don't match. Just connect another OSCroute there:
[OSCroute /spin /vol ...] | [OSCroute /file /help]
I would say, that a filename and a frequency value are very different things, and thus you should not use the same OSC selector for both. It feels wrong. A better approach IMO would be, to use the hierarchies possible in OSC like "/spin/freq 60" and "/spin/filename theFile.wav".
See attached patch for example implenetations of both ideas.
Sure. I just sent the whole thing in one go because I didnt notice this possibility to extend the OSCroute object. I am going to try to get a new version thanks!!
Hallo, enrike hat gesagt: // enrike wrote:
oh! not in my version of OSC external this is weird I checked yesterday and the version on the website is the same as mine as far as i can see. My osc external is version 0.01-w32, compiled Apr 18 2002
Uh, this is *very* old. The current CVS source code on pure-data.sf.net already includes the negative numbers patch, but this is source only. I only have this as binary for Linux (which is much cheaper than Visual C++ btw. <hint> ;) Still, there might be a newer version in the last w32-pd-externals zip.
Frank Barknecht _ ______footils.org__