Hi this is my first post.
I followed the following tutorial on Youtube on how to control sliders with TouchOSC from my iPhone to my PC.
Getting the phone set up was easy, but the sliders on the phone does not control the sliders on the PC like it is suppose to do. The code looks like it is 100% correct, I did follow the video as good as I could.
If I were using the wrong IP address I would not have been able to create and send the TouchOSC interface to my phone, so I do not think it is that. At the bottom of the code it shows my IP address and that is in deed the same as on my PC.
Help I’m not making headway…in communicating from my phone (TouchOSC app) to my PC.
<html><body><pre>
<span style="color: #33997E;">import</span> netP5.*;
<span style="color: #33997E;">import</span> oscP5.*;
OscP5 oscP5;
<span style="color: #E2661A;">float</span> redAmount = 0.0f;
<span style="color: #E2661A;">float</span> greenAmount = 0.0f;
<span style="color: #E2661A;">float</span> blueAmount = 0.0f;
<span style="color: #33997E;">void</span> <span style="color: #006699;"><b>setup</b></span>() {
<span style="color: #006699;">size</span>(320, 480);
<span style="color: #006699;">background</span>(0);
oscP5 = <span style="color: #33997E;">new</span> OscP5(<span style="color: #33997E;">this</span>, 8000);
}
<span style="color: #33997E;">void</span> <span style="color: #006699;"><b>draw</b></span>() {
<span style="color: #006699;">background</span>(redAmount, greenAmount, blueAmount);
<span style="color: #006699;">fill</span>(0);
<span style="color: #666666;">//red rect</span>
<span style="color: #006699;">stroke</span>(255, 0, 0);
<span style="color: #006699;">rect</span>(34, 39, 67, 255);
<span style="color: #006699;">fill</span>(50, 40, 40);
<span style="color: #006699;">rect</span>(34, 39+255, 67, -redAmount);
<span style="color: #666666;">//green rect</span>
<span style="color: #006699;">fill</span>(0);
<span style="color: #006699;">stroke</span>(0, 255, 0);
<span style="color: #006699;">rect</span>(124, 39, 67, 255);
<span style="color: #006699;">fill</span>(40, 50, 40);
<span style="color: #006699;">rect</span>(124, 39+255, 67, -greenAmount);
<span style="color: #666666;">//blue rect</span>
<span style="color: #006699;">fill</span>(0);
<span style="color: #006699;">stroke</span>(0, 0, 255);
<span style="color: #006699;">rect</span>(216, 39, 67, 255);
<span style="color: #006699;">fill</span>(40, 40, 50);
<span style="color: #006699;">rect</span>(216, 39+255, 67, -blueAmount);
}
<span style="color: #33997E;">void</span> oscEvent(OscMessage theOscMessage) {
<span style="color: #E2661A;">String</span> addr = theOscMessage.addrPattern();
<span style="color: #E2661A;">float</span> val = theOscMessage.<span style="color: #006699;">get</span>(0).floatValue();
<span style="color: #669900;">if</span> (addr.<span style="color: #006699;">equals</span>(<span style="color: #7D4793;">"/1/red"</span>)) {
redAmount = val;
}
<span style="color: #669900;">if</span> (addr.<span style="color: #006699;">equals</span>(<span style="color: #7D4793;">"/1/green"</span>)) {
greenAmount = val;
}
<span style="color: #669900;">if</span> (addr.<span style="color: #006699;">equals</span>(<span style="color: #7D4793;">"/1/blue"</span>)) {
blueAmount = val;
}
}
</pre></body></html>