[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] NRT crashing
Here's a stripped-down version of my code. I've been sprinkling wait
statements throughout so they've been accumulating.
Thanks,
David
-----------------------------------------------------------------
Task{
gridN.do {
| n_x |
var x = xMin + ( (n_x/(gridN-1)) * (xMax - xMin) ); // in meters
gridN.do {
| n_y |
var yFrom = minFrom + ( (n_y/(gridN-1)) * (maxFrom - minFrom) );
score = Score.new( baseOSC.score );
params = params
++ ( \xPos: x, \yFrom: yFrom );
score.add( [ t, [ \s_new, gridSynth, -1, 1, 40,
params.asArgsArray ].flatten ] );
score.sort;
( "\nStarting rendering: [" ++ x ++ ", " ++ y ++ "]" ).postln;
tmpFile = n_x + n_y ++ ".tmp";
outFile = n_x + n_y ++ ".wav";
renderFn.( score, tmpFile, outFile );
1.2.wait;
}; //gridN y-vals
1.5.wait; //extra waiting help crashes??
}; //gridN x-vals
{ //clean up tmp files once all rendering is done
( "rm *.tmp" )
.unixCmd({
"\nRun complete!\n".postln;
} );
}.defer( dur );
}.play;
renderFn = {
| score, tmpFile, outFile |
var cmd;
//can't use score.recordNRT since we need both escaped and unescaped osc
file path
//edit: possibly putting escaped quotes, "\"" around file names could
alleviate
// the need to escape chars, but I've already done it this way.
score.writeOSCFile( tmpFile, 0, nil );
0.2.wait;
cmd = ( Score.program + "-N" + tmpFile.escapeChar($ )
+ "_" //blank input file
+ "\"" ++ outFile ++ "\"" + 44100 + "WAV" + "int24"
+ o.asOptionsString
);
p = Pipe( cmd, "r" );
l = p.getLine;
while( { l.notNil }, {
//process each line based on its text
l = p.getLine;
} );
0.1.wait;
( "/Applications/SoX/sox " ++ "\"" ++ outFile ++ "\""
+ "\"" ++ outFile.removeExtension ++ ".dat\" trim "
++ (t*44100) ++ "s 6000s" ).unixCmd;
//let this render finish before starting a new one
( dur * 2.5 ).wait;
};
--
View this message in context: http://n2.nabble.com/NRT-crashing-tp2790382p2808680.html
Sent from the SuperCollider Users New (Use this!!!!) mailing list archive at Nabble.com.
_______________________________________________
sc-users mailing list
info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/