I have been wrestling with tracking down why my Swirler program won't record audio. Most of the time, when I try to use [writesf~] to record, it does not work at all. It creates the file when I send the open message, and I get a file of 44 bytes, then when I click start, and then stop, the file does not change.
Occasionally, it will record about 1-2 seconds of material, no matter when I hit stop. Very occasionally, it will work fine on its own.
I tried also with the writesf~ help patch, as well as others. It seems that my program Swirler stops writesf~ from working anywhere. writesf~ works fine until I run Swirler and click the "start" button, which turns on the DSP and starts the audio processing part.
This is currently happening on Mac Book Pro/Intel running 10.4.10 with Pd-0.40-2, Pd-0.39.3-extended, and Pd-0.40.3-extended-20071026. This happened previously with Pd-0.39.3-extended-rc? on a PowerMac G5/PowerPC running Mac OS X 10.4.8(ish).
I compiled Pd with DEBUG_SOUNDFILE on to see if I could see what's happening. You can plainly see it's not writing data to the file. I found a strange workaround sequence that makes it record, but then the write cycle is strange, it goes in bursts every few seconds rather than a chunk every second.
I attached the swirler program and some transcripts from teh DEBUG_SOUNDFILE stuff.
Anonymous
transcript of a recording session that only saved one second
Logged In: YES
user_id=27104
Originator: YES
File Added: writesf~-bug_working.txt
transcript of a session that worked fine, with a test patch and no swirler running
Logged In: YES
user_id=27104
Originator: YES
I forgot to include the strange workaround sequence:
1) turn on DSP
2) turn on record switch (start recording)
3) turn off record switch (stop recording)
4) turn on record switch (start recording again)
5) turn on START switch in swirler
6) make recording
7) turn off record switch (stop recording)
8) turn off START switch in swirler
The turn off order seems important too.
swirler program (set of Pd patches)
Logged In: YES
user_id=27104
Originator: YES
File Added: swirler-2007-10-28.tar.bz2
this is a transcript of the writesf~bug patch when swirler is running
Logged In: YES
user_id=27104
Originator: YES
File Added: writesf~-bug_after_swirlrer-1.txt
Logged In: YES
user_id=27104
Originator: YES
File Added: writesf~-bug.pd
patch used for "writesf~-bug" tests
Logged In: YES
user_id=564396
Originator: NO
could you provide a patch that triggers the problem without external dependencies?
Logged In: YES
user_id=769033
Originator: NO
Here's a patch that creates rubbish wav files here in pd-0.40-3 vanilla:
#N canvas 0 0 450 300 10;
#X obj 146 203 writesf~;
#X obj 66 40 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144 -1
-1;
#X msg 146 176 open bug.wav \, start;
#X obj 66 67 t b b;
#X msg 184 125 \; pd dsp 0;
#X obj 66 115 delay 1000;
#X obj 66 141 t b b;
#X msg 66 187 \; pd dsp 1;
#X msg 181 78 stop;
#X connect 1 0 3 0;
#X connect 2 0 0 0;
#X connect 3 0 5 0;
#X connect 3 1 4 0;
#X connect 5 0 6 0;
#X connect 6 0 7 0;
#X connect 6 1 2 0;
#X connect 8 0 0 0;
Before stop is hit, the bug.wav is 44 bytes, when stop is hit the size increases to a small number (up to a few 100kB).
here's another patch from Joshua Clayton that also triggers this bug
it seems to me that the issue is triggered by sending [open( and [start( to [writesf~] while DSP is off.
believed fixed for 0.45
Diff: