| yes you are right — this works.
thanks!
joachim
Am 22.06.2015 um 00:20 schrieb Victor Lazzarini:
> to acess a k-var at init time, use i(.). So
>
> iSnd = i(gkPlaySnds[iFt])
>
> should do what you want.
> ========================
> Dr Victor Lazzarini
> Dean of Arts, Celtic Studies and Philosophy,
> Maynooth University,
> Maynooth, Co Kildare, Ireland
> Tel: 00 353 7086936
> Fax: 00 353 1 7086952
>
>> On 21 Jun 2015, at 13:09, joachim heintz wrote:
>>
>> i get back now to this thread with an example of a problem in usage.
>>
>> i have a strset list of sounds, and an array which contains a selection
>> of these sounds:
>> gkPlaySnds[] fillarray 1, 2, 3, 4, 5, 6, 7, 8
>>
>> now i want to create a function table for each of these sound files, for
>> buffer playback.
>>
>> so i did:
>> iFt init 0
>> while iFt < lenarray(gkPlaySnds) do
>> iSnd = gkPlaySnds[iFt]
>> iNo ftgen iSnd, 0, 0, -1, iSnd, 0, 0, 1
>> iFt += 1
>> od
>>
>> but i get this error:
>> Unable to find opcode entry for '=' with matching argument types:
>> Found: i = k
>> (referring to the line: iSnd = gkPlaySnds[iFt])
>>
>> that's what i meant:
>> - the gkPlaySnds array must be k-rate because later on i am using it in
>> a k-rate context, and it would complain about "i = k" if i asked for
>> something like giPlaySnds[kIndx].
>> - but if it is a k-rate array, i cannot access it an init-time, what i
>> must do if i want to create a function table.
>>
>> anything i overlooked? thanks -
>> joachim
>>
>>
>> Am 03.06.2015 um 18:46 schrieb joachim heintz:
>>> well, i cannot recall a concrete case. i will get back to this thread
>>> when i come across one. but it is a helpful hint that the usual rate
>>> for arrays is k, whilst the rate for tables is i.
>>>
>>> joachim
>>>
>>>
>>> Am 03.06.2015 um 18:34 schrieb Victor Lazzarini:
>>>> what about using the i() operator?
>>>> i(gkarr[0])
>>>>
>>>> Victor Lazzarini
>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>> Maynooth University
>>>> Ireland
>>>>
>>>>> On 3 Jun 2015, at 17:30, joachim heintz wrote:
>>>>>
>>>>> yes i know, this works, and i tried to switch on this, but sometimes you
>>>>> need to ask a value from an array both, at i- and k-rate. and then the
>>>>> error is vice versa: an operation needs i-rate, but there is only a k-array.
>>>>>
>>>>> joachim
>>>>>
>>>>>
>>>>>> Am 03.06.2015 um 18:07 schrieb Victor Lazzarini:
>>>>>> I mean gkArr[]
>>>>>>
>>>>>> Victor Lazzarini
>>>>>> Dean of Arts, Celtic Studies, and Philosophy
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>>
>>>>>>> On 3 Jun 2015, at 16:59, joachim heintz wrote:
>>>>>>>
>>>>>>> hi all -
>>>>>>>
>>>>>>> while working with arrays (always nice =) i am struggling a bit with a
>>>>>>> very strict distinction between i-rate and k-rate arrays.
>>>>>>>
>>>>>>> when i work with function tables, which are i-rate, i can change them at
>>>>>>> k-time — very useful and needed.
>>>>>>>
>>>>>>> but for arrays, this does not work. this is a simple example:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> -n
>>>>>>>
>>>>>>>
>>>>>>> sr = 44100
>>>>>>> ksmps = 32
>>>>>>> nchnls = 2
>>>>>>> 0dbfs = 1
>>>>>>>
>>>>>>> giFt ftgen 0, 0, -5, -2, 1, 2, 3, 4, 5
>>>>>>> giArr[] fillarray 1, 2, 3, 4, 5
>>>>>>>
>>>>>>> ;for ftables, i-rate table can be changes at k-time
>>>>>>> instr 1
>>>>>>> tablew random:k(0, 10), 0, giFt
>>>>>>> printk 0, table:k(0, giFt)
>>>>>>> endin
>>>>>>>
>>>>>>> ;complains about i = k (works for random:i)
>>>>>>> instr 2
>>>>>>> giArr[0] = random:k(0, 10)
>>>>>>> printk 0, giArr[0]
>>>>>>> endin
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> i 1 0 .002
>>>>>>> i 2 .002 .002
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> the error message is:
>>>>>>>
>>>>>>> Unable to find opcode entry for '=' with matching argument types:
>>>>>>> Found: i = k
>>>>>>>
>>>>>>> i would love to see at arrays the same flexibility as at function
>>>>>>> tables, so that an i-rate array can be changed at k-rate. is that
>>>>>>> possible, or by any reason not desired?
>>>>>>>
>>>>>>> best -
>>>>>>> joachim
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> ------------------------------------------------------------------------------
>>>> _______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>
>>> ------------------------------------------------------------------------------
>>> _______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors
network devices and physical & virtual servers, alerts via email & sms
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/ |