Sorry to be following along a little late. I was also playing with ftsamplebank and have encountered the same error. A few things I’d like to toss out and ask:
-
If there could be an alternate example for ftsamplebank that compensates for the speed of some systems, so that the first sample loads before playback, that would be great. Yes, I know I should suggest one myself.
-
The example has "iFileCount init 1”
which should be corrected to init to 0 as pointed out here. -
I proved to myself that ftsamplebank does in fact load the files by adding direct calls to loscil3 after i1 like this:
i1000 20 1 60
i1000 21 1 61
i1000 22 1 62
i1000 23 1 63
etc.
- ftsamplebank only works with .wav files?
Best,
Grant.
Date: Mon, 3 Jun 2024 18:17:37 -0400
From: ST Music <stunes6556@GMAIL.COM>
Subject: Re: ftsamplebankHi Marcelo, although I didn’t get the error every time, I did get it
sporadically. However, it never played all 3 samples.The issue appears to be you are not allowing adequate time for the first
sample to load before attempting playback. This becomes even more important
when using larger sample directories. In this case, even a .1 second delay
resolves the issue (see score below).If you don’t want to initialize the samples outside of an instr, you can
always use a seperate instr to load them.It is also necessary to init iFileCount at 0, not 1, or else the first file
played will be 60 + 1.//////////
; Select audio/midi flags here according to platform
-odac -d ;;RT audio out
;-iadc ;;;uncomment -iadc if RT audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o diskin.wav -W ;;; for file output any platform
sr = 48000
ksmps = 32
nchnls=2
0dbfs = 1;load all samples in a given directory into function tables and play them
using instrument 1000giFirstTableNumber = 60;
giNumberOfFiles ftsamplebank “/sdcard/download/wav”, giFirstTableNumber, 0,
4, 0instr 1
iFileCount init 0print giNumberOfFiles
until iFileCount>=giNumberOfFiles do
event_i “i”, 1000, iFileCount * 4, 5, giFirstTableNumber+iFileCount
print iFileCount
iFileCount += 1
od
endin
instr 1000
iTable = p4
print iTable
aOut,aOut loscil3 1, 1, iTable, 1, 0;
outs aOut, aOut
endin
i1 .1 15//////////
I also changed the event start times just to make it more obvious all 3
samples are played.Best,
ScottHi.
I am studying ftsamplebank opcode. I am running the example from the
Reference Manual with experimenting with my own sounds (just 3 small WAV
files). Most of the time, I get just two of them (tables 61 and 62). Table
60 is considered invalid. Why?
The WAV files are ok for *diskin2 *opcode, but one of them never plays
back with the ftsamplebank example.
I pasted the Console message and the code below. Sounds are attached to
this email message.
What am I doing wrong here?
Thank you.
Best wishes,
MarceloInvalid ftable no. 60.000000ftable 60:
deferred alloc for
/Users/marcelocarneiro/Dropbox/MacMini_Back/Csound/porcos_teste_player/mictorio_1_trecho1.wavaudio sr = 48000, stereo, reading both channels
opening WAV infile
/Users/marcelocarneiro/Dropbox/MacMini_Back/Csound/porcos_teste_player/mictorio_1_trecho1.wavdefer length 241115
ftable 61:
deferred alloc for
/Users/marcelocarneiro/Dropbox/MacMini_Back/Csound/porcos_teste_player/mictorio_1_trecho2.wavaudio sr = 48000, stereo, reading both channels
opening WAV infile
/Users/marcelocarneiro/Dropbox/MacMini_Back/Csound/porcos_teste_player/mictorio_1_trecho2.wavdefer length 105902
ftable 62:
deferred alloc for
/Users/marcelocarneiro/Dropbox/MacMini_Back/Csound/porcos_teste_player/porcos_mamando_01_gaintrecho.wavaudio sr = 48000, stereo, reading both channels
opening WAV infile
/Users/marcelocarneiro/Dropbox/MacMini_Back/Csound/porcos_teste_player/porcos_mamando_01_gaintrecho.wavdefer length 236524
; Select audio/midi flags here according to platform
-odac ;;RT audio out
;-iadc ;;;uncomment -iadc if RT audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o diskin.wav -W ;;; for file output any platform
sr = 48000
nchnls=2
0dbfs = 1
;load all samples in a given directory into function tables and play them
using instrument 1000instr 1
iFirstTableNumber = 60;
iNumberOfFiles ftsamplebank
“/Users/marcelocarneiro/Dropbox/MacMini_Back/Csound/porcos_teste_player”,
iFirstTableNumber, 0, 4, 0iFileCount init 1
print iNumberOfFiles
until iFileCount>=iNumberOfFiles do
event_i “i”, 1000, iFileCount, 5, iFirstTableNumber+iFileCount
iFileCount = iFileCount+1
enduntil
endin
instr 1000
iTable = p4
aOut,aOut loscil3 1, 1, iTable, 1, 0;
outs aOut, aOut
endin
i1 0 15
–
Marcelo Carneiro
Prof. of Composition
Instituto Villa-Lobos- Rio de Janeiro State Federal University, UNIRIO
https://marcelocarneiro.bandcamp.com
<https://marcelocarneiro.bandcamp.com/?from=search&search_item_id=3188694390&search_item_type=b&search_match_part=%3F&search_page_id=2693239491&search_page_no=1&search_rank=1&search_sig=984807e6cea0e7a97f8c48d2444d604d>
http://marceloarcos2.wixsite.com/marcelocarneiro
Csound mailing list Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to
https://github.com/csound/csound/issues Discussions of bugs and features
can be posted hereCsound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
Csound mailing list Csound@listserv.heanet.ie https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND Send bugs reports to https://github.com/csound/csound/issues Discussions of bugs and features can be posted here