On Mar 11, 2009, at 6:54 AM, Andre Castro wrote: unh... I've been breaking my head, but can't seem to to get around it. The buffers added to the ~buffers Array are all empty (no sound).
A completion message has to be sent as part of (i.e., at the same time as) the main message. So the workflow is: 1. Get a buffer number from the server's available pool. 2. Pass the new buffer object as the argument to completionMessage. 3. Build and send the /b_alloc message, appending the results of step 2 (if not empty). The server doesn't allocate buffer memory until step 3. The way it's currently written here, the flow is instead: 1. Get a buffer number from the server's available pool. 2. The completionMessage function tells the server to copy the data (but, buffer memory is not allocated yet). 3. Build and send the /b_alloc message. Instead of b.copyData, try b.copyMsg. This is a really common mistake for me -- I can't count how many times I've written: b = Buffer.alloc(s, 2048, 1, completionMessage: { |buf| buf.sine1([1]) }); ... only to have it fail for the same reason (executing sine1 before b_alloc). hjh : H. James Harkins .::!:.:.......:.::........:..!.::.::...:..:...:.:.:.:..: "Come said the Muse, Sing me a song no poet has yet chanted, Sing me the universal." -- Whitman |