[Csnd] fout

Hi!

In a csd I would like:

1. make sure that every time fout exports an audio file (eg .wav), it does not overwrite the last file generated with fout, but is saved as a new file;

2. that the new files generated with fout are renamed progressively, for example:
• Out_REC_01.wav
• Out_REC_02.wav
• Out_REC_03.wav
• Out_REC_04.wav
• Out_REC_05.wav
etc.

Some idea?
Thanks…
Enrico

Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
        Issues · csound/csound · GitHub
Discussions of bugs and features can be posted here

if you start the record instrument several times, you could do somthing like (not tested):

giNum init 1
instr Record
  S_filename sprintf ""Out_REC_%02d.wav", giNum
  giNum += 1
  fout S_filename, ....
endin

best -
  joachim

Hi Joachim!

What a pleasure to hear from you…!

Your patch works, thanks!

Now I wonder if it was also possible to make sure that, after generating some audio files with fout, after closing the frontend (in my case CsoundQt), in a subsequent work session the audio files - always generated with fout - can be saved starting from the numbering immediately following the last file previously generated.
This will avoid overwriting the new files generated in new work sessions, on the previous audio files created.
Enrico