hi all

i had encountered some issues with the object class [writesf~] in the
modes -batch and -nogui.

i was told by dmotd in #dataflow this might be related to setting the
samplerate for certain samplerate dependent object is not happening at
the correct time in -nogui mode. i found two work workarounds to
overcome this (basically they do the same):
 * sending a message to the patch using the -send flag: -send "pd dsp 1"
 * using [loadbang]-[delay 1]-[dsp 1(-[s pd] instead of using a plain
[loadbang] for turning dsp on.

now it seems, that this doesn't work in -batch mode, since the [delay]
triggers the 'dsp on' only logically delayed, but not effectively (this
is at least my interpretation of what is going on). it also seems, that
[writesf~] wants the 'dsp 1' message to come not only logically later,
but _really_ later. otherwise it creates just an empty file with 0 byte
size (the resulting soundfile doesn't even contain the heaser).
i figured out, that using -send "pd dsp 1" helps, and finally enables
[writesf~] to write correct soundfiles in -batch mode. 

also i noticed, that messages to [writesf~] need to be sent _after_
turning dsp on. which means, that you have to use a [delay 0] when
wanting to start [writesf~] on loadbang. 

Before writing a bug report, i would like to discuss the issue here in
order to not write some bogus bug report:
 * is my interpretation of things correct?
 * what other object classes might be affected as well, if any? 

is there some easier way to make a patch work in -batch mode than having
to edit it and put a [delay 0] after every [loadbang]?

for testing purposes i attached a test patch.

cheerio
roman




#N canvas 0 120 594 377 10;
#X obj 76 33 loadbang;
#X obj 117 307 writesf~ 1;
#X obj 76 85 t b b b b;
#X obj 76 170 delay 5000;
#X obj 76 195 t b b;
#X msg 170 229 stop;
#X obj 76 255 s pd;
#X msg 76 233 quit;
#X obj 170 268 t a a;
#N canvas 523 78 162 273 make 0;
#X obj 27 174 osc~;
#X obj 27 54 metro 300;
#X obj 27 83 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 0 1
;
#X obj 27 109 sel 0 1;
#X msg 27 143 300;
#X msg 61 143 500;
#X obj 27 25 inlet;
#X obj 28 212 outlet~;
#X connect 0 0 7 0;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 1 5 0;
#X connect 4 0 0 0;
#X connect 5 0 0 0;
#X connect 6 0 1 0;
#X restore 116 140 pd make some sound;
#X msg 221 230 open -bytes 2 -wave sound.wav \, start;
#X text 219 294 print what is being done;
#X text 182 71 Use -noloadbang in order to edit it.;
#X text 181 26 This patch writes a 5s sounfile and then automatically
quits pd.;
#X obj 228 314 print [writesf~];
#X obj 76 59 delay 0;
#X connect 0 0 15 0;
#X connect 2 0 3 0;
#X connect 2 2 9 0;
#X connect 2 3 10 0;
#X connect 3 0 4 0;
#X connect 4 0 7 0;
#X connect 4 1 5 0;
#X connect 5 0 8 0;
#X connect 7 0 6 0;
#X connect 8 0 1 0;
#X connect 8 1 14 0;
#X connect 9 0 1 0;
#X connect 10 0 8 0;
#X connect 15 0 2 0;
_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to