Csound Csound-dev Csound-tekno Search About

Re: [Csnd] Question(s) re ftables, guard points, wavetables etc.

Date2023-03-29 02:34
FromScott Daughtrey
SubjectRe: [Csnd] Question(s) re ftables, guard points, wavetables etc.
Ok, problem solved. Typical newb mistakes. This works:

seed 0

    instr preload
giFirstTableNumber = 0;
giFileCount init 1
giNumFiles  ftsamplebank "/sdcard/Samples/Wt1",\
            giFirstTableNumber, 0, 0, 1        
    endin

    instr 2
aamp      = linseg(0, 1, .7, p3 - 2, .7, 1, 0)
; phasor speed controls frequency
aindex    = phasor(cpsmidinn(p4))
; using the weightpoint to morph between two\
; tables exponentially
kweightpoint = rspline(0.05, .995, .3, 2) 
ktabnum1  = rspline(0.05, 3.95, .1, 1)
ktabnum2  = 4 - ktabnum1 ; the second wave
asig 	    tabmorphak aindex, kweightpoint,\
            ktabnum1,ktabnum2, 3, 4, 5, 6
                 
outs asig*aamp, asig*aamp
    endin

    instr 3
print giNumFiles    
    endin



i"preload" 0 1
i2  1  20  48
;i3 0  1
e

Of course this only uses the first 4 samples but can be easily modified to use as many as are in the directory.

Scott

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