Csound Csound-dev Csound-tekno Search About

[Csnd] csound6: getting i-value of a kArray member

Date2013-11-14 14:27
FromTarmo Johannes
Subject[Csnd] csound6: getting i-value of a kArray member
Hi,

It seems, that using i(gkArr[member]) does not work and returns always 0. Or 
perhaps I have misunderstood something. Here a simple example:






sr = 44100 
ksmps = 32
nchnls = 2
0dbfs = 1

gkArr[] array 11,22,33
gkVal init 1000
giArr[] array 101,102,103

instr 1
	karr[] array -1,-2,-3
	print giArr[0]
	print i(gkArr[0])
	print i(gkVal)
	print i(karr[0])
endin



i1 0 0



My output is:

new alloc for instr 1:
instr 1:  #i3 = 101.000
instr 1:  #i4 = 0.000
instr 1:  #i5 = 1000.000
instr 1:  #i6 = 0.000


Csound6 built today from git, double samples, linux

thanks,
tarmo



Date2013-11-14 22:37
FromJim Aikin
Subject[Csnd] Re: csound6: getting i-value of a kArray member
print runs at i-time. I think you're trying to print data from an array that
has not yet been filled with data. (I'm not an expert. I could be wrong.)



--
View this message in context: http://csound.1045644.n5.nabble.com/csound6-getting-i-value-of-a-kArray-member-tp5729623p5729670.html
Sent from the Csound - General mailing list archive at Nabble.com.

Date2013-11-16 19:34
FromSteven Yi
SubjectRe: [Csnd] Re: csound6: getting i-value of a kArray member
I think the issue is that the code gets compiled into something like:

#k1 array_get gkArr, 0
#i1 i #k1

and that the version of the array_get opcode is only run at k-time. At
i-time, the value would be just 0 as the results have shown as the
k-var is uninitialized.

Tarmo: Could you file a bug with the CSD attached?  I think it
wouldn't be too much work to fix but just needs some thought to ensure
the fix won't break anything.

Thanks!
steven

On Thu, Nov 14, 2013 at 5:37 PM, Jim Aikin  wrote:
> print runs at i-time. I think you're trying to print data from an array that
> has not yet been filled with data. (I'm not an expert. I could be wrong.)
>
>
>
> --
> View this message in context: http://csound.1045644.n5.nabble.com/csound6-getting-i-value-of-a-kArray-member-tp5729623p5729670.html
> Sent from the Csound - General mailing list archive at Nabble.com.
>
>
> Send bugs reports to the Sourceforge bug trackers
> csound6:
>             https://sourceforge.net/p/csound/tickets/
> csound5:
>             https://sourceforge.net/p/csound/bugs/
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>
>

Date2014-01-16 14:11
FromTarmo Johannes
SubjectRe: [Csnd] Re: csound6: getting i-value of a kArray member
After very long time,

I filed now a ticket. Hopefully it is easy to fix.

tarmo

On Saturday 16 November 2013 14:34:28 Steven Yi wrote:
> I think the issue is that the code gets compiled into something like:
> 
> #k1 array_get gkArr, 0
> #i1 i #k1
> 
> and that the version of the array_get opcode is only run at k-time. At
> i-time, the value would be just 0 as the results have shown as the
> k-var is uninitialized.
> 
> Tarmo: Could you file a bug with the CSD attached?  I think it
> wouldn't be too much work to fix but just needs some thought to ensure
> the fix won't break anything.
> 
> Thanks!
> steven
> 
> On Thu, Nov 14, 2013 at 5:37 PM, Jim Aikin  wrote:
> > print runs at i-time. I think you're trying to print data from an array
> > that has not yet been filled with data. (I'm not an expert. I could be
> > wrong.)
> > 
> > 
> > 
> > --
> > View this message in context:
> > http://csound.1045644.n5.nabble.com/csound6-getting-i-value-of-a-kArray-m
> > ember-tp5729623p5729670.html Sent from the Csound - General mailing list
> > archive at Nabble.com.
> > 
> > 
> > Send bugs reports to the Sourceforge bug trackers
> > 
> > csound6:
> >             https://sourceforge.net/p/csound/tickets/
> > 
> > csound5:
> >             https://sourceforge.net/p/csound/bugs/
> > 
> > Discussions of bugs and features can be posted here
> > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> > csound"
> Send bugs reports to the Sourceforge bug trackers
> csound6:
>             https://sourceforge.net/p/csound/tickets/
> csound5:
>             https://sourceforge.net/p/csound/bugs/
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe
> csound"