Quantcast

[Csnd] Filling array at i-time, based on array-index

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] Filling array at i-time, based on array-index

Jeanette C.
Hi list,
I tried to initialise an array, using the loop_lt. It runs its course, but all
elements are filling with 0.
kioct = 4
kParray init 10
index = 0
Loop_init:
   kParray[index] = index/i(kioct)
loop_lt index, 1, kioct, Loop_init

an inserted prints statement shows that the index is counted up correctly and
the kioct value is set correctly, but the expression index/i(kioct) obviously
evaluates to 0.

Where am I going wrong, please?

Best wishes,

Jeanette

--------
When you need someone, you just turn around and I will be there <3

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] [SOLVED - sort of] [Csnd] Filling array at i-time, based on array-index

Jeanette C.
Hi again,
I circumvented the problem by switching from osciliktp to table3 and modifying
the index control directly.

Best wishes,

Jeanette

--------
When you need someone, you just turn around and I will be there <3

Csound mailing list
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] Filling array at i-time, based on array-index

Tarmo Johannes-3
In reply to this post by Jeanette C.
Hi,
You are using itime loop, = works at k time for k-values. Use init instead of =.
Tarmo

16.04.2017 10:08 kirjutas kuupäeval "Jeanette C." <[hidden email]>:
Hi list,
I tried to initialise an array, using the loop_lt. It runs its course, but all elements are filling with 0.
kioct = 4
kParray init 10
index = 0
Loop_init:
  kParray[index] = index/i(kioct)
loop_lt index, 1, kioct, Loop_init

an inserted prints statement shows that the index is counted up correctly and the kioct value is set correctly, but the expression index/i(kioct) obviously evaluates to 0.

Where am I going wrong, please?

Best wishes,

Jeanette

--------
When you need someone, you just turn around and I will be there <3

Csound mailing list
[hidden email]
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
Csound mailing list [hidden email] 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
Loading...