I have a faint memory that I have run into problems when not reading all parameters that are included in an event, or mismatching the actual event with the parameter list in the OscRecv constructor, or something. Say that whatever sends the OSC event that you are receiving in your code, Dimitris, adds two float parameters. You only read one, so the other remains somewhere.<div>
<br></div><div>I can&#39;t reproduce this now locally, so I may just be rambling. A thought anyway.</div><div><br></div><div>/Stefan<br><br><div class="gmail_quote">On Mon, Mar 30, 2009 at 7:12 PM, Stephen Sinclair <span dir="ltr">&lt;<a href="mailto:radarsat1@gmail.com">radarsat1@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div></div><div class="h5">On Mon, Mar 30, 2009 at 1:09 PM, Stephen Sinclair &lt;<a href="mailto:radarsat1@gmail.com">radarsat1@gmail.com</a>&gt; wrote:<br>

&gt; 2009/3/30 Bozelos Dimitris &lt;<a href="mailto:dbozelos@yahoo.gr">dbozelos@yahoo.gr</a>&gt;:<br>
&gt;&gt; Hi Kassen,<br>
&gt;&gt;<br>
&gt;&gt; thanks a lot and sorry for the late reply I had trouble last days with the<br>
&gt;&gt; latest fedora updates and wouldn&#39;t ChucK that much!<br>
&gt;&gt;<br>
&gt;&gt; FROM: Kassen<br>
&gt;&gt;<br>
&gt;&gt; Hey, Dimitris!<br>
&gt;&gt;<br>
&gt;&gt;&gt;  For some reason I constantly get a &quot;segmentation fault&quot; fatal error<br>
&gt;&gt;&gt; sometimes just after some seconds I run my shreds. What does this mean?<br>
&gt;&gt;<br>
&gt;&gt; Typically it means you tried to address something that doesn&#39;t exist/ isn&#39;t<br>
&gt;&gt; instantiated. It can also mean there is some bug in ChucK that affects you.<br>
&gt;&gt;<br>
&gt;&gt; Well, I found out that an accumulator that I had was causing the trouble. I<br>
&gt;&gt; was receiving a variable through osc and doing (inside an infinite<br>
&gt;&gt; time-loop) something like<br>
&gt;&gt;<br>
&gt;&gt; while( event.nextMsg() )<br>
&gt;&gt; {<br>
&gt;&gt;     event.getFloat() +=&gt; a;<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; I don&#39;t really know why it was crushing, it shouldn&#39;t. when I removed this<br>
&gt;&gt; part everything was ok.<br>
&gt;&gt;<br>
&gt;&gt;&gt; Once or twice I had an &quot;OSC packet ...: buffer (or stack) overflow&quot; error.<br>
&gt;&gt;&gt; Is there a buffer or a limit on the messages you send / receive?<br>
&gt;&gt;<br>
&gt;&gt; I don&#39;t know :¬)<br>
&gt;&gt; I&#39;m certain there must be some limit somewhere but I&#39;m not sure what or<br>
&gt;&gt; where it is.<br>
&gt;&gt;<br>
&gt;&gt; What probably happened here is that I was being sent the messages faster<br>
&gt;&gt; than receiving them, so if I had an osc message coming every 100 ms and I<br>
&gt;&gt; had<br>
&gt;&gt;<br>
&gt;&gt; while( true )<br>
&gt;&gt; {<br>
&gt;&gt;     while( event.nextMsg() ) { ... }<br>
&gt;&gt;     1000::ms =&gt; now;<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; the messages might have been accumulating so there was the buffer overflow.<br>
&gt;&gt; Although it shouldn&#39;t be, I think.<br>
&gt;&gt;<br>
&gt;&gt; But I actually have a question here about the OSC events: is there any smart<br>
&gt;&gt; way to have some code executed on an event independently of the time of the<br>
&gt;&gt; infinite time-loop? To be more clear, let&#39;s say I have an BiQuad filter and<br>
&gt;&gt; I want to control its frequency over the network through OSC. So,<br>
&gt;&gt;<br>
&gt;&gt; while( true )<br>
&gt;&gt; {<br>
&gt;&gt;     while( event.nextMsg() )<br>
&gt;&gt;     {<br>
&gt;&gt;         event.getFloat() =&gt; f.pfreq;<br>
&gt;&gt;     }<br>
&gt;&gt;<br>
&gt;&gt;     // do other stuff<br>
&gt;&gt;<br>
&gt;&gt;     1::second =&gt; now;<br>
&gt;&gt; }<br>
&gt;&gt;<br>
&gt;&gt; This have the consequence, if I&#39;m not mistaken, that every 1 second chuck<br>
&gt;&gt; will check for new messages and if messages are sent every 300 ms and for<br>
&gt;&gt; some reason we need the loop to run every one second the frequency is<br>
&gt;&gt; actually updated once a second with the last of the 3 received values<br>
&gt;&gt; instead of 3 times a second.<br>
&gt;&gt;<br>
&gt;&gt; The only way around I can think now is to declare the filter in a public<br>
&gt;&gt; class as a static object and have a separate shred that runs with a faster<br>
&gt;&gt; time-loop and update the filter this way. But this might lead to<br>
&gt;&gt; unreasonable many shreds like one for gain, one for frequency etc. Moreover<br>
&gt;&gt; this will mean that I will be able to have only one BiQuad filter working<br>
&gt;&gt; this way. So I see this solution highly problematic. Any ideas?<br>
&gt;<br>
&gt; Yo,<br>
&gt;<br>
&gt; You can wait on the event itself, so that your loop will wake up every<br>
&gt; time a message comes in.<br>
&gt;<br>
&gt; while( true )<br>
&gt; {<br>
&gt;    while( event.nextMsg() )<br>
&gt;    {<br>
&gt;        event.getFloat() =&gt; f.pfreq;<br>
&gt;    }<br>
&gt;    1::second =&gt; now;<br>
&gt; }<br>
&gt;<br>
&gt; If you need to &quot;do other stuff&quot;, I suggest doing this event loop in a<br>
&gt; shred by sporking it.<br>
<br>
</div></div>Sorry, I intended to change the code after copying it:<br>
<br>
fun void msg_freq() {<br>
  while( true )<br>
  {<br>
     event =&gt; now;<br>
<div class="im">     while( event.nextMsg() )<br>
     {<br>
         event.getFloat() =&gt; f.pfreq;<br>
     }<br>
  }<br>
}<br>
<br>
</div>spork ~ msg_freq();<br>
<div><div></div><div class="h5">_______________________________________________<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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Release me, insect, or I will destroy the Cosmos!<br>
</div>