k-rate to i

how to change the k rate to i init variables

for example:

kfn midic7 1,1,127

ifn = i(kfn)

a1 oscil kamp,kfreq,ifn

i want to change the wavetable by midi modwheel "use k-rate as a input signal"(not init variables) but if i run the score there post

INIT ERROR in instr 2: Invalid ftable no. 0.000000

if i added "ifn init 1" append ifn = i(kfn) then i can't change the wavetable number anyway

Use oscilikt

One feature of Csound that always seems to catch people is the reason that there are both 'i' and 'k' variables. You have to remember that an instrument is driven in two passes: an 'init' pass that only happens once in an invocation -- at the very beginning, before anything else. After that 'performance' passes occur at k-rate while the instrument is active. An i-variable's value is determined in the init pass, and never changes further during the performance. So even though you're using the k-to-i conversion, the only value seen is the initial one -- '0' in this case. midic7 opcodes only execute during performance passes, so the i-variable never sees the changes.

Fortunately there seems to be a very simple fix: replace 'oscil' with 'oscilikt', and use your kfn directly. (I've never actually used this, so I'm trusting the manual! It doesn't say what happens if the table-number references a non-existent table, so be careful...)

thanks for your answer I

thanks for your answer

I replaced oscil with oscilikt then everything goes well

and i have a new question if i used grain . the igfn and iwfn will be not change when performance I mean that if i just given one note .during the this

note I can't change the iwfn igfn

it's differ from oscil to oscilikt

if i used max/msp . i can draw the envelope wavetable for the grains on realtime But in csound How to change it .

Use tablecopy?

I've never played much with granular synthesis, so my suggestions will be purely theoretical...

I suspect that 'tablecopy', giving it a source and destination table number at k-rate, would do what you want. Keep the iwfn number fixed in the grain statement, and feed that with the values you want using tablecopy.

Alternatively you might be able to have several grain statements in your instrument, containing appropriate table numbers, and choose between them with if-statements at k-rate.

Good luck.

anther question by the way

anther question

by the way tablecopy is a great choice .

Some questions fasten on table read .The new question is that could i change the skiptime at a wave file on realtime . or table file size .(size skiptime)

f# time size 1 filcod skiptime format channel

tablera?

Your goal doesn't look simple! (:-/) You may want to take a look at 'tablera' which can read parts of a table at a-rate. Lots of "cautions" and "beware"s there, though, so good luck!

still hard

What 's "beware " and "cautions" ?

tablera outs a-rate type ,so it's hard to replace i type slot . Any ideas?

ed pills staxyn ed drugs zpack generic cialis Canadian pharmacy avanafil z pack z-pak Canadian pharmacy viagra viagra uk viagra online generic viagra buy viagra uk pharmacy uk cialis online kamagra uk buy zithromax z-pack cialis uk z pak cheap generic viagra zpak