I have written this solution only to avoid a crash, I believed that it was the problem On Tue, Feb 14, 2012 at 10:45:33PM +0100, joachim heintz wrote: > hi tito - > i think this does not work without an error; see below. > or am i missing something? > joachim > > > > sr = 44100 > ksmps = 64 > nchnls = 1 > > ;; filevalid for csound < 5.13 (tested with 5.07) > opcode filevalid2, i, S > Sfile xin > ires ftgen 2012, 0, 2, 1, Sfile, 0, 0, 0 > xout ires - 2011 > endop > > instr 1 > Sfile = "dindondan.wav" > ires filevalid2 Sfile > if (ires != 1) igoto end > aout soundin Sfile > out aout > end: > if (ires != 1) then > turnoff > endif > endin > > > i1 0 1 > e > > > > > > orch now loaded > audio buffered in 256 sample-frame blocks > ALSA input: total buffer size: 1024, period size: 256 > reading 512-byte blks of shorts from adc (RAW) > ALSA output: total buffer size: 1024, period size: 256 > writing 256 sample blks of 64-bit floats to dac > SECTION 1: > new alloc for instr 1: > ftable 2012: > soundin cannot open dindondan.wav > ftable 2012: Failed to open file > f2012 0.00 2.00 1.00 "dindondan.wav" ... > INIT ERROR in instr 1 (opcode filevalid2): ftgen error > ires ftgen 2012 0 2 1 Sfile 0 0 0 > B 0.000 - note deleted. i1 had 1 init errors > Score finished in csoundPerformKsmps(). > inactive allocs returned to freespace > end of score. overall amps: 0.0 > overall samples out of range: 0 > 1 errors in performance > Elapsed time at end of performance: real: 0.014s, CPU: 0.010s > 0 256 sample blks of 64-bit floats written to dac > > > Am 14.02.2012 10:22, schrieb Tito Latini: > >> Unfortunately, I cannot count on python always being available. > >> > >> Can anyone suggest a simple solution using the system opcode - one that perhaps parallels "os.path.exists"? > > > > The hidden filevalid > > > > > > > > sr = 44100 > > ksmps = 64 > > nchnls = 1 > > > > ;; filevalid for csound < 5.13 (tested with 5.07) > > opcode filevalid, i, S > > Sfile xin > > ires ftgen 2012, 0, 2, 1, Sfile, 0, 0, 0 > > xout ires - 2011 > > endop > > > > instr 1 > > Sfile = "dindondan.wav" > > ires filevalid Sfile > > if (ires != 1) igoto end > > aout soundin Sfile > > out aout > > end: > > if (ires != 1) then > > turnoff > > endif > > endin > > > > > > i1 0 1 > > e > > > > > > > > tito > > > > > > Send bugs reports to the Sourceforge bug tracker > > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > > Discussions of bugs and features can be posted here > > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound" > > > > > > > Send bugs reports to the Sourceforge bug tracker > https://sourceforge.net/tracker/?group_id=81968&atid=564599 > Discussions of bugs and features can be posted here > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"