[Csnd] array copy oddity

classic Classic list List threaded Threaded
10 messages Options
Reply | Threaded
Open this post in threaded view
|

[Csnd] array copy oddity

Oeyvind Brandtsegg-3
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 [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
|

Re: [Csnd] array copy oddity

joachim-3
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 [hidden email]
> <mailto:[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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] array copy oddity

Oeyvind Brandtsegg-3
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 <[hidden email]>:
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: <a href="tel:%2B47%2092%20203%20205" value="+4792203205" target="_blank">+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 [hidden email]
<mailto:[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



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

Re: [Csnd] array copy oddity

Victor Lazzarini-2
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 <[hidden email]> 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 <[hidden email]>:
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: <a href="tel:%2B47%2092%20203%20205" value="&#43;4792203205" target="_blank">+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 [hidden email]
<mailto:[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



--
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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] array copy oddity

jpff
In reply to this post by Oeyvind Brandtsegg-3
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
>
>
>
> <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 [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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] array copy oddity

Victor Lazzarini-2
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 <[hidden email]> 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
>> <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 [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

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
|

Re: [Csnd] array copy oddity

Victor Lazzarini-2
In reply to this post by Oeyvind Brandtsegg-3
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 <[hidden email]> 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 <[hidden email]>:
> 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 [hidden email]
> <mailto:[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
>
>
>
> --
>
> 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 [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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] array copy oddity

jpff
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 <[hidden email]> 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 <[hidden email]>:
>> 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 [hidden email]
>> <mailto:[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
>>
>>
>>
>> --
>>
>> 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 [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
>

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
|

Re: [Csnd] array copy oddity

Victor Lazzarini-2
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>:
>>> 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 [hidden email]
>>> <mailto:[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
>>>
>>>
>>>
>>> --
>>>
>>> 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 [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
>>
>
> 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
Reply | Threaded
Open this post in threaded view
|

Re: [Csnd] array copy oddity

Oeyvind Brandtsegg-3
Ok. Thank you so much for the help. 

2018-03-13 21:45 GMT+01:00 Victor Lazzarini <[hidden email]>:
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 <[hidden email]> 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 <[hidden email]> 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 <[hidden email]>:
>>> 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 [hidden email]
>>> <mailto:[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
>>>
>>>
>>>
>>> --
>>>
>>> Oeyvind Brandtsegg
>>> Professor of Music Technology
>>> NTNU
>>> 7491 Trondheim
>>> Norway
>>> Cell: <a href="tel:%2B47%2092%20203%20205" value="+4792203205">+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 [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
>>
>
> 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



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