| hi juan -
you can copy the part of the deferred table you need to another table,
for instance with vcopy_i. below is an example, which is a slightly
modified version of
http://www.csounds.com/udo/displayOpcode.php?opcode_id=138
hope this helps. best -
joachim
sr = 44100
ksmps = 32
nchnls = 1
0dbfs = 1
opcode FilToBuf, ii, Soopoo
;creates a non deferred function table from a soundfile and returns its
length
Sfilenam, iskip, ifilsel, ichn, iftnum, inorm xin ;filename, skiptime
(default = 0), length of selection to be copied (default 0 = all),
channel (default=1), number of ftable (0=automatic(=default)),
normalization (1=yes, 0=no(=default))
igen = (inorm == 0 ? -1 : 1)
ifttmp ftgen 0, 0, 0, igen, Sfilenam, iskip, 0, ichn
ilen tableng ifttmp
ilen = (ifilsel == 0 ? ilen : ifilsel * sr)
ift ftgen iftnum, 0, -ilen, -2, 0
vcopy_i ift, ifttmp, ilen
ftfree ifttmp, 0
xout ift, ilen
endop
instr load_and_play
iFilTab, ilen FilToBuf "fox.wav", .5, 1 ;from 0.5 to 1.5 in the file
print ilen ;length of the copied table
p3 = (ilen/sr) * 2 ;play the table twice
aSnd poscil3 1, 1/(ilen/sr), iFilTab
out aSnd
endin
i "load_and_play" 0 1
Am 23.05.2012 22:21, schrieb Juan Bordon:
>> The "end" would be the size of the table.
>
> Thanks for the quick answer.
> I try to set explicity p3, but it only allows power of 2 values for
> the size ("ftable 1: illegal table length"). So I set it to zero
> (deferred). Is there a way to crop the table during execution?
> Thanks.
>
>
> 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"
>
>
|