As with most things that you learn the curve in the beginning is a little overwhelming and the simplest things can be missed. After much ado (2 days of internet searches) I must humbly ask for assistance. I am building a processing sketch that uses position to determine frequencies to send to pd. These are passed along as the (float freq) variable in the function. Everything is good going leaving processing and into pd but I can't seem to parse the pdOscMessage correctly once it gets to pd. What am I missing?
NetAddress puredata;
oscP5 = new OscP5(this, 9000);
puredata = new NetAddress("127.0.0.1",9000);
Processing Osc Function
void pdMessage(float freq) {
//Osc Bundle creation
OscBundle myBundle = new OscBundle();
//New OSC Message creation
OscMessage pdOscMessage = new OscMessage("/ " + freq);
//Filter freq and Add an integer (midi) to the message to Pure Data NetAddress
if (freq == 417) {
oscP5.send(pdOscMessage.add(freq), puredata);
}
if (freq == 528) {
oscP5.send(pdOscMessage.add(freq), puredata);
}
if (freq == 639) {
oscP5.send(pdOscMessage.add(freq), puredata);
}
if (freq == 741) {
oscP5.send(pdOscMessage.add(freq), puredata);
}
println("pdMessage: ", pdOscMessage);
//Add message to the bundle
myBundle.add(pdOscMessage);
//Clearing message
pdOscMessage.clear();
}
}
Pd Canvas
import mrpeach
[udpreceive 9000]
|
|
[upackOSC]
|
|
[routeOSC /s /f ]
\
\
[t b]
|
|
[0\
|
|
[osc~]
|
|
[*~.1]
|
|
[dac~]
Thanks.