[chuck-users] a little debugging help for frozen VM!

chriswicks crwicks at yahoo.com
Sat May 26 12:22:47 EDT 2012

Kassen -

Thanks!  This helped me get out of the frozen VM situation, but now for some reason my loop doesn't seem to be executing after the first runthrough.  I've modified the code as follows, chucking the event to now at the end of the loop.  This works, and b3base gets added twice to the VM as it should in the first runthrough.  I have it printing out the value for pedCount at the beginning, and it only does so once...so, it prints out the value 25 for pedCount and then I never see it printing again after that, just the OSC values ticking by (I currently have my OSC sender set to send values from 25 down to 6, then resetting back to 25, every 2 seconds, and it prints to the VM every time it sends a value so I can see that that part, at least, is working).   Interestingly, I also don't get any response from the VM when I send it a 'chuck ^' command...the OSC values keep on ticking by, and the audio keeps playing as it should, it just doesn't send out a
 response.  It does, however, respond to --kill and --removeall commands.

Something's not working as it should, and pedCount never seems to get updated with the OSC value, which is strange, because I have VERY similar code (almost identical) sending and receiving float values in OSC (in other parts of this piece) and they work just fine.  I think that perhaps somewhere the loop is getting tripped up and running infinitely without doing anything, but I can't pinpoint where or why this is happening.

Basically, what this code should do is take an OSC value, and if it's greater than 20 and the shreds aren't already present, add them to the VM.  If it's less than 20 and the shreds are present, it should remove them from the VM.  I thought I had it nailed but something's wonky.

Thanks again for any help as I trudge through this stuff!



OscRecv receiver;
6449 => receiver.port;
receiver.event("weather/pedestrian, int") @=> OscEvent pedEvent;

-1 => int b3base1;
-1 => int b3base2;

25 => int pedCount;

while (true) {

  <<<"Pedestrian ct: ", pedCount>>>;

  if (pedCount > 20 && b3base1 == -1) {
    Machine.add("b3base.ck") => b3base1;
    Machine.add("b3base.ck") => b3base2;
  else {
    if (pedCount < 20 && b3base1 != -1) {
      -1 => b3base1;
      -1 => b3base2;

  while( pedEvent.nextMsg() != 0) {
    pedEvent.getInt() => pedCount;
  pedEvent => now;


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20120526/ebe44bd0/attachment.html>

More information about the chuck-users mailing list