Csound Csound-dev Csound-tekno Search About

[Csnd] array copy oddity

Date2018-03-13 17:37
FromOeyvind Brandtsegg
Subject[Csnd] array copy oddity
Hi,
I guess I must be doing something wrong here, but can\t figure out what.
It seems like my copya2ftab zeroes out both the table and the array.

The following code prints:
SECTION 1:
new alloc for instr 1:
 i1     0.00000
 i1     0.00000


But if I comment out the copya2ftab line, it prints
SECTION 1:
new alloc for instr 1:
 i1     0.00196
 i1     0.00196



<CsoundSynthesizer>
<CsOptions>
-n
</CsOptions>
<CsInstruments>

giLength = 1024
giTable ftgen 0, 0, giLength, 7, 0,1024,1025
instr 1
kArr[] init giLength
copyf2array kArr, giTable
kMags[] mags kArr
kPhs[] phs kArr
kOut[] pol2rect kMags, kPhs
copya2ftab kOut, giTable
printk2 table(2,giTable)
printk2 kOut[2]
endin
        
</CsInstruments>
<CsScore>
i1 0 1       
e

</CsScore>
</CsoundSynthesizer>


--
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

Date2018-03-13 18:32
Fromjoachim heintz
SubjectRe: [Csnd] array copy oddity
hi oeyvind -

but isn't kOut simply zero?  when i set instead
	kOut[] fillarray 1, 2, 3
i get 3.00000 as printout.

best -
	joachim



On 13/03/18 18:37, Oeyvind Brandtsegg wrote:
> Hi,
> I guess I must be doing something wrong here, but can\t figure out what.
> It seems like my copya2ftab zeroes out both the table and the array.
>
> The following code prints:
> SECTION 1:
> new alloc for instr 1:
>  i1     0.00000
>  i1     0.00000
>
>
> But if I comment out the copya2ftab line, it prints
> SECTION 1:
> new alloc for instr 1:
>  i1     0.00196
>  i1     0.00196
>
>
>
> 
> 
> -n
> 
> 
>
> giLength = 1024
> giTable ftgen 0, 0, giLength, 7, 0,1024,1025
> instr 1
> kArr[] init giLength
> copyf2array kArr, giTable
> kMags[] mags kArr
> kPhs[] phs kArr
> kOut[] pol2rect kMags, kPhs
> copya2ftab kOut, giTable
> printk2 table(2,giTable)
> printk2 kOut[2]
> endin
>
> 
> 
> i1 0 1
> e
>
> 
> 
>
>
> --
>
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
>
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
>
> 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

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

Date2018-03-13 18:43
FromOeyvind Brandtsegg
SubjectRe: [Csnd] array copy oddity
Thanks for the quick reply,
but kOut is not zero, as it prints a value if I comment out the line with  copya2ftab 
There seems to be some odd interaction between these opcodes,
as it works well to do  copyf2array and  copya2ftab,
and it also works well to use everything else but  copya2ftab,
but all together it zeroes the data.

2018-03-13 19:32 GMT+01:00 joachim heintz <jh@joachimheintz.de>:
hi oeyvind -

but isn't kOut simply zero?  when i set instead
        kOut[] fillarray 1, 2, 3
i get 3.00000 as printout.

best -
        joachim




On 13/03/18 18:37, Oeyvind Brandtsegg wrote:
Hi,
I guess I must be doing something wrong here, but can\t figure out what.
It seems like my copya2ftab zeroes out both the table and the array.

The following code prints:
SECTION 1:
new alloc for instr 1:
 i1     0.00000
 i1     0.00000


But if I comment out the copya2ftab line, it prints
SECTION 1:
new alloc for instr 1:
 i1     0.00196
 i1     0.00196



<CsoundSynthesizer>
<CsOptions>
-n
</CsOptions>
<CsInstruments>

giLength = 1024
giTable ftgen 0, 0, giLength, 7, 0,1024,1025
instr 1
kArr[] init giLength
copyf2array kArr, giTable
kMags[] mags kArr
kPhs[] phs kArr
kOut[] pol2rect kMags, kPhs
copya2ftab kOut, giTable
printk2 table(2,giTable)
printk2 kOut[2]
endin

</CsInstruments>
<CsScore>
i1 0 1
e

</CsScore>
</CsoundSynthesizer>


--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list Csound@listserv.heanet.ie
<mailto: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

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



--
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

Date2018-03-13 18:53
FromVictor Lazzarini
SubjectRe: [Csnd] array copy oddity
aren’t you overwriting the table? What happens if you use two different ones?

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

On 13 Mar 2018, at 18:44, Oeyvind Brandtsegg <oyvind.brandtsegg@NTNU.NO> wrote:

Thanks for the quick reply,
but kOut is not zero, as it prints a value if I comment out the line with  copya2ftab 
There seems to be some odd interaction between these opcodes,
as it works well to do  copyf2array and  copya2ftab,
and it also works well to use everything else but  copya2ftab,
but all together it zeroes the data.

2018-03-13 19:32 GMT+01:00 joachim heintz <jh@joachimheintz.de>:
hi oeyvind -

but isn't kOut simply zero?  when i set instead
        kOut[] fillarray 1, 2, 3
i get 3.00000 as printout.

best -
        joachim




On 13/03/18 18:37, Oeyvind Brandtsegg wrote:
Hi,
I guess I must be doing something wrong here, but can\t figure out what.
It seems like my copya2ftab zeroes out both the table and the array.

The following code prints:
SECTION 1:
new alloc for instr 1:
 i1     0.00000
 i1     0.00000


But if I comment out the copya2ftab line, it prints
SECTION 1:
new alloc for instr 1:
 i1     0.00196
 i1     0.00196



<CsoundSynthesizer>
<CsOptions>
-n
</CsOptions>
<CsInstruments>

giLength = 1024
giTable ftgen 0, 0, giLength, 7, 0,1024,1025
instr 1
kArr[] init giLength
copyf2array kArr, giTable
kMags[] mags kArr
kPhs[] phs kArr
kOut[] pol2rect kMags, kPhs
copya2ftab kOut, giTable
printk2 table(2,giTable)
printk2 kOut[2]
endin

</CsInstruments>
<CsScore>
i1 0 1
e

</CsScore>
</CsoundSynthesizer>


--

Oeyvind Brandtsegg
Professor of Music Technology
NTNU
7491 Trondheim
Norway
Cell: +47 92 203 205

http://www.partikkelaudio.com/
http://crossadaptive.hf.ntnu.no
http://gdsp.hf.ntnu.no/
http://soundcloud.com/brandtsegg
http://flyndresang.no/
http://soundcloud.com/t-emp

Csound mailing list Csound@listserv.heanet.ie
<mailto: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

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



--
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

Date2018-03-13 19:29
Fromjpff
SubjectRe: [Csnd] array copy oddity
varind is not happy....

==5365== Invalid read of size 8
==5365==    at 0x4F45BD0: perf_phs (arrays.c:2916)
==5365==    by 0x4E7BBB0: kperf_nodebug (csound.c:1711)
==5365==    by 0x4E7D3B1: csoundPerform (csound.c:2226)
==5365==    by 0x4014BE: main (csound_main.c:324)
==5365==  Address 0x1acd2fc8 is 8 bytes after a block of size 8,208 
alloc'd
==5365==    at 0x4C2C240: calloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==5365==    by 0x4E986D7: mcalloc (memalloc.c:113)
==5365==    by 0x4F45279: array_init (arrays.c:129)
==5365==    by 0x4E951DE: init_pass (insert.c:116)
==5365==    by 0x4E951DE: insert_event (insert.c:471)
==5365==    by 0x4E9A425: process_score_event (musmon.c:809)
==5365==    by 0x4E9CE28: sensevents (musmon.c:1017)
==5365==    by 0x4E7D432: csoundPerform (csound.c:2216)
==5365==    by 0x4014BE: main (csound_main.c:324)
==5365==
==5365== Invalid read of size 8
==5365==    at 0x4F45BDD: perf_phs (arrays.c:2916)
==5365==    by 0x4E7BBB0: kperf_nodebug (csound.c:1711)
==5365==    by 0x4E7D3B1: csoundPerform (csound.c:2226)
==5365==    by 0x4014BE: main (csound_main.c:324)
==5365==  Address 0x1acd2fc0 is 0 bytes after a block of size 8,208 
alloc'd
==5365==    at 0x4C2C240: calloc (in 
/usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
==5365==    by 0x4E986D7: mcalloc (memalloc.c:113)
==5365==    by 0x4F45279: array_init (arrays.c:129)
==5365==    by 0x4E951DE: init_pass (insert.c:116)
==5365==    by 0x4E951DE: insert_event (insert.c:471)
==5365==    by 0x4E9A425: process_score_event (musmon.c:809)
==5365==    by 0x4E9CE28: sensevents (musmon.c:1017)
==5365==    by 0x4E7D432: csoundPerform (csound.c:2216)
==5365==    by 0x4014BE: main (csound_main.c:324)


On Tue, 13 Mar 2018, Oeyvind Brandtsegg wrote:

> Hi,I guess I must be doing something wrong here, but can\t figure out what.
> It seems like my copya2ftab zeroes out both the table and the array.
> 
> The following code prints:
> SECTION 1:
> new alloc for instr 1:
>  i1     0.00000
>  i1     0.00000
> 
> 
> But if I comment out the copya2ftab line, it prints
> SECTION 1:
> new alloc for instr 1:
>  i1     0.00196
>  i1     0.00196
> 
> 
> 
> 
> 
> -n
> 
> 
> 
> giLength = 1024
> giTable ftgen 0, 0, giLength, 7, 0,1024,1025
> instr 1
> kArr[] init giLength
> copyf2array kArr, giTable
> kMags[] mags kArr
> kPhs[] phs kArr
> kOut[] pol2rect kMags, kPhs
> copya2ftab kOut, giTable
> printk2 table(2,giTable)
> printk2 kOut[2]
> endin
>         
> 
> 
> i1 0 1       
> e
> 
> 
> 
> 
> 
> --
> 
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
> 
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
>  
> 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
>

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

Date2018-03-13 19:36
FromVictor Lazzarini
SubjectRe: [Csnd] array copy oddity
Looks like something in phs 

Victor Lazzarini
Dean of Arts, Celtic Studies, and Philosophy
Maynooth University
Ireland

> On 13 Mar 2018, at 19:30, jpff  wrote:
> 
> varind is not happy....
> 
> ==5365== Invalid read of size 8
> ==5365==    at 0x4F45BD0: perf_phs (arrays.c:2916)
> ==5365==    by 0x4E7BBB0: kperf_nodebug (csound.c:1711)
> ==5365==    by 0x4E7D3B1: csoundPerform (csound.c:2226)
> ==5365==    by 0x4014BE: main (csound_main.c:324)
> ==5365==  Address 0x1acd2fc8 is 8 bytes after a block of size 8,208 alloc'd
> ==5365==    at 0x4C2C240: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==5365==    by 0x4E986D7: mcalloc (memalloc.c:113)
> ==5365==    by 0x4F45279: array_init (arrays.c:129)
> ==5365==    by 0x4E951DE: init_pass (insert.c:116)
> ==5365==    by 0x4E951DE: insert_event (insert.c:471)
> ==5365==    by 0x4E9A425: process_score_event (musmon.c:809)
> ==5365==    by 0x4E9CE28: sensevents (musmon.c:1017)
> ==5365==    by 0x4E7D432: csoundPerform (csound.c:2216)
> ==5365==    by 0x4014BE: main (csound_main.c:324)
> ==5365==
> ==5365== Invalid read of size 8
> ==5365==    at 0x4F45BDD: perf_phs (arrays.c:2916)
> ==5365==    by 0x4E7BBB0: kperf_nodebug (csound.c:1711)
> ==5365==    by 0x4E7D3B1: csoundPerform (csound.c:2226)
> ==5365==    by 0x4014BE: main (csound_main.c:324)
> ==5365==  Address 0x1acd2fc0 is 0 bytes after a block of size 8,208 alloc'd
> ==5365==    at 0x4C2C240: calloc (in /usr/lib64/valgrind/vgpreload_memcheck-amd64-linux.so)
> ==5365==    by 0x4E986D7: mcalloc (memalloc.c:113)
> ==5365==    by 0x4F45279: array_init (arrays.c:129)
> ==5365==    by 0x4E951DE: init_pass (insert.c:116)
> ==5365==    by 0x4E951DE: insert_event (insert.c:471)
> ==5365==    by 0x4E9A425: process_score_event (musmon.c:809)
> ==5365==    by 0x4E9CE28: sensevents (musmon.c:1017)
> ==5365==    by 0x4E7D432: csoundPerform (csound.c:2216)
> ==5365==    by 0x4014BE: main (csound_main.c:324)
> 
> 
>> On Tue, 13 Mar 2018, Oeyvind Brandtsegg wrote:
>> 
>> Hi,I guess I must be doing something wrong here, but can\t figure out what.
>> It seems like my copya2ftab zeroes out both the table and the array.
>> The following code prints:
>> SECTION 1:
>> new alloc for instr 1:
>>  i1     0.00000
>>  i1     0.00000
>> But if I comment out the copya2ftab line, it prints
>> SECTION 1:
>> new alloc for instr 1:
>>  i1     0.00196
>>  i1     0.00196
>> 
>> 
>> -n
>> 
>> 
>> giLength = 1024
>> giTable ftgen 0, 0, giLength, 7, 0,1024,1025
>> instr 1
>> kArr[] init giLength
>> copyf2array kArr, giTable
>> kMags[] mags kArr
>> kPhs[] phs kArr
>> kOut[] pol2rect kMags, kPhs
>> copya2ftab kOut, giTable
>> printk2 table(2,giTable)
>> printk2 kOut[2]
>> endin
>>         
>> 
>> 
>> i1 0 1       
>> e
>> 
>> 
>> --
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>  
>> 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
>> 
> 
> 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

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

Date2018-03-13 20:15
FromVictor Lazzarini
SubjectRe: [Csnd] array copy oddity
yep, the problem seems to be with you overwriting the table. This one works. Also note table:k() to
call the k-rate table opcode (hint is needed).

 

-n



giLength = 1024
giTable ftgen 0, 0, giLength, 7, 0,1024,1025
giTable2 ftgen 0, 0, giLength, 7, 0,1024,1025
		
instr 1
kArr[] init giLength
copyf2array kArr, giTable
kMags[] mags kArr
kPhs[] phs kArr
kOut[] pol2rect kMags, kPhs
copya2ftab kOut, giTable2
printk2 table:k(2,giTable2)
printk2 kOut[2]
endin
        


i1 0 1       
e





========================
Prof. 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 13 Mar 2018, at 18:43, Oeyvind Brandtsegg  wrote:
> 
> Thanks for the quick reply,
> but kOut is not zero, as it prints a value if I comment out the line with  copya2ftab 
> There seems to be some odd interaction between these opcodes,
> as it works well to do  copyf2array and  copya2ftab,
> and it also works well to use everything else but  copya2ftab,
> but all together it zeroes the data.
> 
> 2018-03-13 19:32 GMT+01:00 joachim heintz :
> hi oeyvind -
> 
> but isn't kOut simply zero?  when i set instead
>         kOut[] fillarray 1, 2, 3
> i get 3.00000 as printout.
> 
> best -
>         joachim
> 
> 
> 
> 
> On 13/03/18 18:37, Oeyvind Brandtsegg wrote:
> Hi,
> I guess I must be doing something wrong here, but can\t figure out what.
> It seems like my copya2ftab zeroes out both the table and the array.
> 
> The following code prints:
> SECTION 1:
> new alloc for instr 1:
>  i1     0.00000
>  i1     0.00000
> 
> 
> But if I comment out the copya2ftab line, it prints
> SECTION 1:
> new alloc for instr 1:
>  i1     0.00196
>  i1     0.00196
> 
> 
> 
> 
> 
> -n
> 
> 
> 
> giLength = 1024
> giTable ftgen 0, 0, giLength, 7, 0,1024,1025
> instr 1
> kArr[] init giLength
> copyf2array kArr, giTable
> kMags[] mags kArr
> kPhs[] phs kArr
> kOut[] pol2rect kMags, kPhs
> copya2ftab kOut, giTable
> printk2 table(2,giTable)
> printk2 kOut[2]
> endin
> 
> 
> 
> i1 0 1
> e
> 
> 
> 
> 
> 
> --
> 
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
> 
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
> 
> 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
> 
> 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
> 
> 
> 
> -- 
> 
> Oeyvind Brandtsegg
> Professor of Music Technology
> NTNU
> 7491 Trondheim
> Norway
> Cell: +47 92 203 205
> 
> http://www.partikkelaudio.com/
> http://crossadaptive.hf.ntnu.no
> http://gdsp.hf.ntnu.no/
> http://soundcloud.com/brandtsegg
> http://flyndresang.no/
> http://soundcloud.com/t-emp
>  
> 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

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

Date2018-03-13 20:32
Fromjpff
SubjectRe: [Csnd] array copy oddity
The opcodes copya2ftab and copyf2aray run at i-time and k-time, so the 
table is overwritten with szeros before the pol2rect gets a lok in



On Tue, 13 Mar 2018, Victor Lazzarini wrote:

> yep, the problem seems to be with you overwriting the table. This one works. Also note table:k() to
> call the k-rate table opcode (hint is needed).
>
> 
> 
> -n
> 
> 
>
> giLength = 1024
> giTable ftgen 0, 0, giLength, 7, 0,1024,1025
> giTable2 ftgen 0, 0, giLength, 7, 0,1024,1025
>
> instr 1
> kArr[] init giLength
> copyf2array kArr, giTable
> kMags[] mags kArr
> kPhs[] phs kArr
> kOut[] pol2rect kMags, kPhs
> copya2ftab kOut, giTable2
> printk2 table:k(2,giTable2)
> printk2 kOut[2]
> endin
>
> 
> 
> i1 0 1
> e
>
> 
> 
>
>
> ========================
> Prof. 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 13 Mar 2018, at 18:43, Oeyvind Brandtsegg  wrote:
>>
>> Thanks for the quick reply,
>> but kOut is not zero, as it prints a value if I comment out the line with  copya2ftab
>> There seems to be some odd interaction between these opcodes,
>> as it works well to do  copyf2array and  copya2ftab,
>> and it also works well to use everything else but  copya2ftab,
>> but all together it zeroes the data.
>>
>> 2018-03-13 19:32 GMT+01:00 joachim heintz :
>> hi oeyvind -
>>
>> but isn't kOut simply zero?  when i set instead
>>         kOut[] fillarray 1, 2, 3
>> i get 3.00000 as printout.
>>
>> best -
>>         joachim
>>
>>
>>
>>
>> On 13/03/18 18:37, Oeyvind Brandtsegg wrote:
>> Hi,
>> I guess I must be doing something wrong here, but can\t figure out what.
>> It seems like my copya2ftab zeroes out both the table and the array.
>>
>> The following code prints:
>> SECTION 1:
>> new alloc for instr 1:
>>  i1     0.00000
>>  i1     0.00000
>>
>>
>> But if I comment out the copya2ftab line, it prints
>> SECTION 1:
>> new alloc for instr 1:
>>  i1     0.00196
>>  i1     0.00196
>>
>>
>>
>> 
>> 
>> -n
>> 
>> 
>>
>> giLength = 1024
>> giTable ftgen 0, 0, giLength, 7, 0,1024,1025
>> instr 1
>> kArr[] init giLength
>> copyf2array kArr, giTable
>> kMags[] mags kArr
>> kPhs[] phs kArr
>> kOut[] pol2rect kMags, kPhs
>> copya2ftab kOut, giTable
>> printk2 table(2,giTable)
>> printk2 kOut[2]
>> endin
>>
>> 
>> 
>> i1 0 1
>> e
>>
>> 
>> 
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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
>>
>> 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
>>
>>
>>
>> --
>>
>> Oeyvind Brandtsegg
>> Professor of Music Technology
>> NTNU
>> 7491 Trondheim
>> Norway
>> Cell: +47 92 203 205
>>
>> http://www.partikkelaudio.com/
>> http://crossadaptive.hf.ntnu.no
>> http://gdsp.hf.ntnu.no/
>> http://soundcloud.com/brandtsegg
>> http://flyndresang.no/
>> http://soundcloud.com/t-emp
>>
>> 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
>
> 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
>

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

Date2018-03-13 20:45
FromVictor Lazzarini
SubjectRe: [Csnd] array copy oddity
Exactly, kOut is full of zeros at i-time and the table gets zeroed.
========================
Prof. 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 13 Mar 2018, at 20:32, jpff  wrote:
> 
> The opcodes copya2ftab and copyf2aray run at i-time and k-time, so the table is overwritten with szeros before the pol2rect gets a lok in
> 
> 
> 
> On Tue, 13 Mar 2018, Victor Lazzarini wrote:
> 
>> yep, the problem seems to be with you overwriting the table. This one works. Also note table:k() to
>> call the k-rate table opcode (hint is needed).
>> 
>> 
>> 
>> -n
>> 
>> 
>> 
>> giLength = 1024
>> giTable ftgen 0, 0, giLength, 7, 0,1024,1025
>> giTable2 ftgen 0, 0, giLength, 7, 0,1024,1025
>> 
>> instr 1
>> kArr[] init giLength
>> copyf2array kArr, giTable
>> kMags[] mags kArr
>> kPhs[] phs kArr
>> kOut[] pol2rect kMags, kPhs
>> copya2ftab kOut, giTable2
>> printk2 table:k(2,giTable2)
>> printk2 kOut[2]
>> endin
>> 
>> 
>> 
>> i1 0 1
>> e
>> 
>> 
>> 
>> 
>> 
>> ========================
>> Prof. 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 13 Mar 2018, at 18:43, Oeyvind Brandtsegg  wrote:
>>> 
>>> Thanks for the quick reply,
>>> but kOut is not zero, as it prints a value if I comment out the line with  copya2ftab
>>> There seems to be some odd interaction between these opcodes,
>>> as it works well to do  copyf2array and  copya2ftab,
>>> and it also works well to use everything else but  copya2ftab,
>>> but all together it zeroes the data.
>>> 
>>> 2018-03-13 19:32 GMT+01:00 joachim heintz :
>>> hi oeyvind -
>>> 
>>> but isn't kOut simply zero?  when i set instead
>>>        kOut[] fillarray 1, 2, 3
>>> i get 3.00000 as printout.
>>> 
>>> best -
>>>        joachim
>>> 
>>> 
>>> 
>>> 
>>> On 13/03/18 18:37, Oeyvind Brandtsegg wrote:
>>> Hi,
>>> I guess I must be doing something wrong here, but can\t figure out what.
>>> It seems like my copya2ftab zeroes out both the table and the array.
>>> 
>>> The following code prints:
>>> SECTION 1:
>>> new alloc for instr 1:
>>> i1     0.00000
>>> i1     0.00000
>>> 
>>> 
>>> But if I comment out the copya2ftab line, it prints
>>> SECTION 1:
>>> new alloc for instr 1:
>>> i1     0.00196
>>> i1     0.00196
>>> 
>>> 
>>> 
>>> 
>>> 
>>> -n
>>> 
>>> 
>>> 
>>> giLength = 1024
>>> giTable ftgen 0, 0, giLength, 7, 0,1024,1025
>>> instr 1
>>> kArr[] init giLength
>>> copyf2array kArr, giTable
>>> kMags[] mags kArr
>>> kPhs[] phs kArr
>>> kOut[] pol2rect kMags, kPhs
>>> copya2ftab kOut, giTable
>>> printk2 table(2,giTable)
>>> printk2 kOut[2]
>>> endin
>>> 
>>> 
>>> 
>>> i1 0 1
>>> e
>>> 
>>> 
>>> 
>>> 
>>> 
>>> --
>>> 
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>> 
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>> 
>>> 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
>>> 
>>> 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
>>> 
>>> 
>>> 
>>> --
>>> 
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>> 
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>> 
>>> 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
>> 
>> 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
>> 
> 
> 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

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

Date2018-03-13 22:25
FromOeyvind Brandtsegg
SubjectRe: [Csnd] array copy oddity
Ok. Thank you so much for the help. 

2018-03-13 21:45 GMT+01:00 Victor Lazzarini <Victor.Lazzarini@mu.ie>:
Exactly, kOut is full of zeros at i-time and the table gets zeroed.
========================
Prof. 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 13 Mar 2018, at 20:32, jpff <jpff@codemist.co.uk> wrote:
>
> The opcodes copya2ftab and copyf2aray run at i-time and k-time, so the table is overwritten with szeros before the pol2rect gets a lok in
>
>
>
> On Tue, 13 Mar 2018, Victor Lazzarini wrote:
>
>> yep, the problem seems to be with you overwriting the table. This one works. Also note table:k() to
>> call the k-rate table opcode (hint is needed).
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> -n
>> </CsOptions>
>> <CsInstruments>
>>
>> giLength = 1024
>> giTable ftgen 0, 0, giLength, 7, 0,1024,1025
>> giTable2 ftgen 0, 0, giLength, 7, 0,1024,1025
>>
>> instr 1
>> kArr[] init giLength
>> copyf2array kArr, giTable
>> kMags[] mags kArr
>> kPhs[] phs kArr
>> kOut[] pol2rect kMags, kPhs
>> copya2ftab kOut, giTable2
>> printk2 table:k(2,giTable2)
>> printk2 kOut[2]
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> i1 0 1
>> e
>>
>> </CsScore>
>> </CsoundSynthesizer>
>>
>>
>> ========================
>> Prof. 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 13 Mar 2018, at 18:43, Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
>>>
>>> Thanks for the quick reply,
>>> but kOut is not zero, as it prints a value if I comment out the line with  copya2ftab
>>> There seems to be some odd interaction between these opcodes,
>>> as it works well to do  copyf2array and  copya2ftab,
>>> and it also works well to use everything else but  copya2ftab,
>>> but all together it zeroes the data.
>>>
>>> 2018-03-13 19:32 GMT+01:00 joachim heintz <jh@joachimheintz.de>:
>>> hi oeyvind -
>>>
>>> but isn't kOut simply zero?  when i set instead
>>>        kOut[] fillarray 1, 2, 3
>>> i get 3.00000 as printout.
>>>
>>> best -
>>>        joachim
>>>
>>>
>>>
>>>
>>> On 13/03/18 18:37, Oeyvind Brandtsegg wrote:
>>> Hi,
>>> I guess I must be doing something wrong here, but can\t figure out what.
>>> It seems like my copya2ftab zeroes out both the table and the array.
>>>
>>> The following code prints:
>>> SECTION 1:
>>> new alloc for instr 1:
>>> i1     0.00000
>>> i1     0.00000
>>>
>>>
>>> But if I comment out the copya2ftab line, it prints
>>> SECTION 1:
>>> new alloc for instr 1:
>>> i1     0.00196
>>> i1     0.00196
>>>
>>>
>>>
>>> <CsoundSynthesizer>
>>> <CsOptions>
>>> -n
>>> </CsOptions>
>>> <CsInstruments>
>>>
>>> giLength = 1024
>>> giTable ftgen 0, 0, giLength, 7, 0,1024,1025
>>> instr 1
>>> kArr[] init giLength
>>> copyf2array kArr, giTable
>>> kMags[] mags kArr
>>> kPhs[] phs kArr
>>> kOut[] pol2rect kMags, kPhs
>>> copya2ftab kOut, giTable
>>> printk2 table(2,giTable)
>>> printk2 kOut[2]
>>> endin
>>>
>>> </CsInstruments>
>>> <CsScore>
>>> i1 0 1
>>> e
>>>
>>> </CsScore>
>>> </CsoundSynthesizer>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> Csound mailing list Csound@listserv.heanet.ie
>>> <mailto: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
>>>
>>> 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
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: +47 92 203 205
>>>
>>> http://www.partikkelaudio.com/
>>> http://crossadaptive.hf.ntnu.no
>>> http://gdsp.hf.ntnu.no/
>>> http://soundcloud.com/brandtsegg
>>> http://flyndresang.no/
>>> http://soundcloud.com/t-emp
>>>
>>> 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
>>
>> 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
>>
>
> 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

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



--
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