<div dir="ltr">Hey y'all,<div><br></div><div>Thanks for tracking this down -- awesome sleuthing job. Im surprised that that is the result of <span style="font-family:arial,sans-serif;font-size:13px">m_inMsgBuffer being too small because that is a buffer for incoming messages, not created receivers. Nonetheless, that buffer should definitely be bigger, even on the order of 1024 items isn't large enough to cause any memory concerns. </span></div>
<div><br></div><div>spencer</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 22, 2014 at 2:12 PM, Ben Steinberg <span dir="ltr"><<a href="mailto:ben@potswift.org" target="_blank">ben@potswift.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">And finally (?), in case anyone finds this thread and not the<br>
electro-music forum postings, I found the listenAll() method of OscIn in<br>
Appendix D of Ajay Kapur, Perry Cook, Spencer Salazar & Ge Wang,<br>
_Programming for Musicians and Digital Artists_. It seems to solve the<br>
problem:<br>
<br>
OscIn oin;<br>
OscMsg msg;<br>
12001 => oin.port;<br>
oin.listenAll();<br>
<div class=""> while (true) {<br>
oin => now;<br>
</div> while ( oin.recv(msg) )<br>
{<br>
<<< "got message:", msg.address, msg.typetag >>>;<br>
for(int n; n < msg.numArgs(); n++) {<br>
if(msg.typetag.charAt(n) == 'i') // integer<br>
<<< "arg", n, ":", msg.getInt(n) >>>;<br>
else if(msg.typetag.charAt(n) == 'f') // float<br>
<<< "arg", n, ":", msg.getFloat(n) >>>;<br>
else if(msg.typetag.charAt(n) == 's') // string<br>
<<< "arg", n, ":", msg.getString(n) >>>;<br>
}<br>
}<br>
1::ms => now;<br>
<div class="HOEnZb"><div class="h5"> }<br>
<br>
Ben<br>
<br>
On 8/22/14, 3:43 PM, Ben Steinberg wrote:<br>
> (Never mind, I take back the last bit about recompiling with lower<br>
> numbers -- I was testing from the command line with miniAudicle still<br>
> open and bound to the port.)<br>
><br>
> Ben<br>
><br>
> On 8/22/14, 3:21 PM, Ben Steinberg wrote:<br>
>> At Joel's and antimon's suggestion at electro-music, I tried OscRecv<br>
>> instead of OscIn -- all 16 listeners worked. Recompiling with 256 makes<br>
>> the original code work, as Joel said; my attempts to recompile with<br>
>> lower numbers (24, 32, 72) did not -- no listeners worked.<br>
>><br>
>> Ben<br>
>><br>
>> On 8/22/14, 2:43 PM, Ben Steinberg wrote:<br>
>>> Wow, thanks! I'll see about getting a dev environment together and<br>
>>> recompiling with something like 32 or 64 --<br>
>>><br>
>>> Ben<br>
>>><br>
>>> On 8/22/14, 2:38 PM, Joel Matthys wrote:<br>
>>>> It looks to me like the limit of 12 is hard-coded in src/ulib_opsc.cpp,<br>
>>>> line 201:<br>
>>>><br>
>>>> m_inMsgBuffer(CircularBuffer<OscInMsg>(12)),<br>
>>>><br>
>>>> I raised it to 256 and recompiled and your example worked correctly.<br>
>>>><br>
>>>> I can definitely see the value of allowing more than 12 addresses on the<br>
>>>> same port. I'm not sure the memory impact though.<br>
>>>><br>
>>>> Joel<br>
>>>> --<br>
>>>><br>
>>>> On 08/22/2014 12:25 PM, Ben Steinberg wrote:<br>
>>>>> I've posted about this to the electro-music forum:<br>
>>>>> <a href="http://electro-music.com/forum/viewtopic.php?p=402793" target="_blank">http://electro-music.com/forum/viewtopic.php?p=402793</a><br>
>>>>><br>
>>>>> In trying to write some code for the Illucia dtr, I found that adding<br>
>>>>> addresses to an OscIn object appeared not to work after twelve<br>
>>>>> addresses. I wrote a test program that wasn't illucia-specific; the<br>
>>>>> following code starts 16 OSC transmitters and 16 receivers. When you run<br>
>>>>> it, you can see that transmitters 0-15 all transmit, but only receivers<br>
>>>>> 0-11 receive.<br>
>>>>><br>
>>>>> for ( 0 => int i ; i < 16 ; i++ ) {<br>
>>>>> spork ~ output(i);<br>
>>>>> spork ~ input(i);<br>
>>>>> }<br>
>>>>><br>
>>>>> while ( true ) {<br>
>>>>> 1::second => now;<br>
>>>>> }<br>
>>>>><br>
>>>>> fun void output(int number) {<br>
>>>>> 12008 => int port;<br>
>>>>> "localhost" => string hostname;<br>
>>>>> OscOut xmit;<br>
>>>>> xmit.dest(hostname, port);<br>
>>>>> while (true) {<br>
>>>>> Math.random2f(5.5, 8.5) => float wait;<br>
>>>>> wait::second => now;<br>
>>>>> xmit.start("/tester/what/" + number);<br>
>>>>> Math.random2f(0.0, 1.0) => float temp => xmit.add;<br>
>>>>> xmit.send();<br>
>>>>> <<< "sent", number, temp >>>;<br>
>>>>> }<br>
>>>>> }<br>
>>>>><br>
>>>>> fun void input(int number) {<br>
>>>>> OscIn oin;<br>
>>>>> OscMsg msg;<br>
>>>>> 12008 => oin.port;<br>
>>>>> oin.addAddress("/tester/what/" + number + ", f");<br>
>>>>> float val;<br>
>>>>> while (true) {<br>
>>>>> oin => now;<br>
>>>>> while ( oin.recv(msg) != 0 )<br>
>>>>> {<br>
>>>>> msg.getFloat(0) => val;<br>
>>>>> <<< "received", number, val >>>;<br>
>>>>> }<br>
>>>>> 5::ms => now;<br>
>>>>> }<br>
>>>>> }<br>
>>>>><br>
>>>>> I'm running ChucK 1.3.4 on Mavericks, with and without miniAudicle.<br>
>>>>> _______________________________________________<br>
>>>>> chuck-users mailing list<br>
>>>>> <a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
>>>>> <a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
>>>><br>
>>>> _______________________________________________<br>
>>>> chuck-users mailing list<br>
>>>> <a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
>>>> <a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
>>> _______________________________________________<br>
>>> chuck-users mailing list<br>
>>> <a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
>>> <a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
>>><br>
>> _______________________________________________<br>
>> chuck-users mailing list<br>
>> <a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
>> <a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
>><br>
> _______________________________________________<br>
> chuck-users mailing list<br>
> <a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
> <a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
><br>
_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
<br>
<br>
</div></div></blockquote></div><br></div>