Apparent bug on GEN01 ftable

Hello everyone! I’m having trouble with GEN01 on an ftable. It seems I cannot populate the table but I still don’t know what am I missing. Does anyone see the problem in my code? Thank you in advance!

I have tried:

  • Checking typos
  • Absolute and relative paths
  • Global and local variables
  • With diskin2, it reads the audio
  • Checking permissions
  • Checking sample rates of the audio file and of the main file

The code:

  1 <CsoundSynthesizer>
  2 <CsOptions>
  3 -odac
  4 </CsOptions>
  5 <CsInstruments>
  6 sr = 96000
  7 ksmps = 32
  8 0dbfs = 1
  9 nchnls = 2
 10 
 11 
 12 gitab   ftgen   1, 0, 0, 1, "test.wav", 0, 0, 0
 13 gienv   ftgen   2, 0, 2^10, 5, 0.1, 50, 1, (1024-50), 0.01
 14 instr 1
 15         kpitch  =       p4
 16         kdens   =       p5
 17         kdur    =       p6
 18         ares    grain   .6, kpitch, kdens, 0, 0, kdur, 1, 2, 2
 19 endin
 20 
 21 </CsInstruments>
 22 <CsScore>
 23 
 24 </CsScore>
 25 </CsoundSynthesizer>
~                          

The error:
–Csound version 6.18 (double samples) Nov 23 2022
[commit: a1580f9cdf331c35dceb486f4231871ce0b00266]
libsndfile-1.2.2
graphics suppressed, ascii substituted
sr = 96000.0, kr = 3000.000, ksmps = 32
0dBFS level = 1.0, A4 tuning = 440.0
ftable 1:
deferred alloc for soundin.0
soundin cannot open soundin.0: No Error.ftable 1: Failed to open file soundin.0
f 1 0.00 0.00 1.00 nan …
INIT ERROR in instr 0 (opcode ftgen.iS) line 12: ftgen error
from file tst.csd (1),gitab ftgen.iS 1 0 0 1 "test.wav0

Can you try an absolute path to the sound file?

I did. I think it has something to do with the ftable in itself, since opcodes like diskin2 read the file with no problem at all (relative and absolute).

Well… it was a bug. In case someone encounters this problem in the future, what worked for me was to run the following command from the terminal:

csdebugger file.csd

It displayed the text-based wave as usual. I closed the terminal an ran the file normally:

csound file.csd

I’m glad you sorted it out, but what bug do you think you’ve found? I tried your code with a local sound file and it ran without any errors.

In fact, I asked an AI, and what it said seems plausible: Csound was searching for a file "test.wav0, despite it being written correctly in the orchestra section. Don’t really know why that zero appeared, though…