Csound Csound-dev Csound-tekno Search About

[Csnd] Table oddities

Date2023-02-05 15:14
FromMike McGonagle
Subject[Csnd] Table oddities
Attachmentstable1.csd  table2.csd  
Hello all,

I've got a program that I have several tables that get passed to an instrument, which uses these tables to extract it's performance data. My problem is that in my first example program, everything seems to work fine. But with the second, the difference being there are four tables, instead of two, but the odd sized tables are now one element shorter, and even sized.

Thanks,

Mike
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

Date2023-02-05 15:23
FromMike McGonagle
SubjectRe: [Csnd] Table oddities
I should have mentioned that the sizes being returned by ftlen in the second program are not right. The odd sizes are one smaller than they should be.

On Sun, Feb 5, 2023 at 9:14 AM Mike McGonagle <mjmogo@gmail.com> wrote:
Hello all,

I've got a program that I have several tables that get passed to an instrument, which uses these tables to extract it's performance data. My problem is that in my first example program, everything seems to work fine. But with the second, the difference being there are four tables, instead of two, but the odd sized tables are now one element shorter, and even sized.

Thanks,

Mike
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

Date2023-02-05 15:29
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Table oddities
I think it's because 5 and 3 are power of 2 + 1 sizes. These particular lengths set the table size to a power of two and set guard point to extend the curve. Not sure how this extension applies to GEN2 (need to check) but the size is set to size - 1 in this case afaik.

best

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 15:15, Mike McGonagle <mjmogo@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

Hello all,

I've got a program that I have several tables that get passed to an instrument, which uses these tables to extract it's performance data. My problem is that in my first example program, everything seems to work fine. But with the second, the difference being there are four tables, instead of two, but the odd sized tables are now one element shorter, and even sized.

Thanks,

Mike
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
<table1.csd>
<table2.csd>

Date2023-02-05 15:31
From"Jeanette C."
SubjectRe: [Csnd] Table oddities
Hello Mike!
Feb 5 2023, Mike McGonagle has written:
...
> But with the second, the difference being there are four tables, instead of
> two, but the odd sized tables are now one element shorter, and even sized.
...
Make the table sizes negative. I think this is recommended for all non
power-of-two or power-of-two plus one table sizes. This should be
changed in the most recent Csound versions. I ran your second example as
is and got the same issue. Then I changed all table sizes to negative
values, which caused all sizes to be printed correctly.

Best wishes,

Jeanette

-- 
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Just call out my name, and I will be there... <3
(Britney Spears)

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

Date2023-02-05 15:34
FromMike McGonagle
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Table oddities
I did some other tests changing the sizes to other odd values, and some seemed to work, while others didn't.

I was thinking as a work-around that I could just double the sizes of these tables, and then duplicate the data. It might make it awkward to do certain things, but I just want to get this running.

On Sun, Feb 5, 2023 at 9:29 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
I think it's because 5 and 3 are power of 2 + 1 sizes. These particular lengths set the table size to a power of two and set guard point to extend the curve. Not sure how this extension applies to GEN2 (need to check) but the size is set to size - 1 in this case afaik.

best

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 15:15, Mike McGonagle <mjmogo@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

Hello all,

I've got a program that I have several tables that get passed to an instrument, which uses these tables to extract it's performance data. My problem is that in my first example program, everything seems to work fine. But with the second, the difference being there are four tables, instead of two, but the odd sized tables are now one element shorter, and even sized.

Thanks,

Mike
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
<table1.csd>
<table2.csd>
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

Date2023-02-05 15:36
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Table oddities
Not in that particular case, see

"For arrays whose length is a power of 2, space allocation always provides for 2n points plus an additional guard point. The guard point value, used during interpolated lookup, can be automatically set to reflect the table's purpose: If size is an exact power of 2, the guard point will be a copy of the first point; this is appropriate for interpolated wrap-around lookup as in oscili, etc., and should even be used for non-interpolating oscil for safe consistency. If size is set to 2 n + 1, the guard point value automatically extends the contour of table values; this is appropriate for single-scan functions such in envplxoscil1oscil1i, etc.

The size of the table is used as a code to tell Csound how to fill this guard-point. If the size is exactly power-of-two, then the guard point contains a copy of the first point on the table. If the size is power-of-two plus one, Csound will extend the contour of the function stored in the table for one extra point."


That page also needs to be updated in that negative numbers are not used anymore to allow for any size (since Csound 6).

This issue is not well resolved I think and we'll
need to tackle it on 7.x

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 15:25, Mike McGonagle <mjmogo@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

I should have mentioned that the sizes being returned by ftlen in the second program are not right. The odd sizes are one smaller than they should be.

On Sun, Feb 5, 2023 at 9:14 AM Mike McGonagle <mjmogo@gmail.com> wrote:
Hello all,

I've got a program that I have several tables that get passed to an instrument, which uses these tables to extract it's performance data. My problem is that in my first example program, everything seems to work fine. But with the second, the difference being there are four tables, instead of two, but the odd sized tables are now one element shorter, and even sized.

Thanks,

Mike
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

Date2023-02-05 15:36
FromMike McGonagle
SubjectRe: [Csnd] Table oddities
FREAKING AWESOME, Jeanette! Works for me now!

On Sun, Feb 5, 2023 at 9:33 AM Jeanette C. <julien@mail.upb.de> wrote:
Hello Mike!
Feb 5 2023, Mike McGonagle has written:
...
> But with the second, the difference being there are four tables, instead of
> two, but the odd sized tables are now one element shorter, and even sized.
...
Make the table sizes negative. I think this is recommended for all non
power-of-two or power-of-two plus one table sizes. This should be
changed in the most recent Csound versions. I ran your second example as
is and got the same issue. Then I changed all table sizes to negative
values, which caused all sizes to be printed correctly.

Best wishes,

Jeanette

--
  * Website: http://juliencoder.de - for summer is a state of sound
  * Youtube: https://www.youtube.com/channel/UCMS4rfGrTwz8W7jhC1Jnv7g
  * Audiobombs: https://www.audiobombs.com/users/jeanette_c
  * GitHub: https://github.com/jeanette-c

Just call out my name, and I will be there... <3
(Britney Spears)

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

Date2023-02-05 15:37
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Table oddities
Ah, I see while you don't need to make it negative, for this particular case, it switches off the guardpoint thing.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 5 Feb 2023, at 15:33, Jeanette C.  wrote:
> 
> *Warning*
> 
> This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.
> 
> Hello Mike!
> Feb 5 2023, Mike McGonagle has written:
> ...
>> But with the second, the difference being there are four tables, instead of
>> two, but the odd sized tables are now one element shorter, and even sized.
> ...
> Make the table sizes negative. I think this is recommended for all non
> power-of-two or power-of-two plus one table sizes. This should be
> changed in the most recent Csound versions. I ran your second example as
> is and got the same issue. Then I changed all table sizes to negative
> values, which caused all sizes to be printed correctly.
> 
> Best wishes,
> 
> Jeanette
> 
> --
> * Website: https://eur02.safelinks.protection.outlook.com/?url=http%3A%2F%2Fjuliencoder.de%2F&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Cb41fba455e874ee3d7f508db078e5abc%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638112080233831662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=26j9y4uBrQkSZPSxAnNDED5Nb1KELGwKYR%2F6a90wJIU%3D&reserved=0 - for summer is a state of sound
> * Youtube: https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.youtube.com%2Fchannel%2FUCMS4rfGrTwz8W7jhC1Jnv7g&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Cb41fba455e874ee3d7f508db078e5abc%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638112080233831662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=BkMIqCHc9VNG9Sl3MYeTk8BioKxhU2%2B%2Bg%2ByY7gCH8o0%3D&reserved=0
> * Audiobombs: https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.audiobombs.com%2Fusers%2Fjeanette_c&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Cb41fba455e874ee3d7f508db078e5abc%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638112080233831662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=eIa2kuGy4p%2FJwiIDvIfEK8xFZg0BcxmOanvVrUIdpQ4%3D&reserved=0
> * GitHub: https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fjeanette-c&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Cb41fba455e874ee3d7f508db078e5abc%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638112080233831662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=uwVxR0Jd1xWAtA%2BRpZ8QmJNczhWgh0J97F8Az5SGsZw%3D&reserved=0
> 
> Just call out my name, and I will be there... <3
> (Britney Spears)
> 
> Csound mailing list
> Csound@listserv.heanet.ie
> https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flistserv.heanet.ie%2Fcgi-bin%2Fwa%3FA0%3DCSOUND&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Cb41fba455e874ee3d7f508db078e5abc%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638112080233831662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=jSRsR2zNDLhuxxJ%2B8SUahTg%2FG39sWsD0kylOdtBsbvo%3D&reserved=0
> Send bugs reports to
>       https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fcsound%2Fcsound%2Fissues&data=05%7C01%7CVictor.Lazzarini%40mu.ie%7Cb41fba455e874ee3d7f508db078e5abc%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638112080233831662%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&sdata=2TRNysXNgAR275UefMwXAGM8lgoQxn6uB6PI%2FiqqBZY%3D&reserved=0
> 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

Date2023-02-05 15:39
FromMike McGonagle
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Table oddities
So, should I NOT use the negative sizes? They do seem to work with 6.18, but it sounds like this is a point of contention for version 7, right?

Anyway, I think I will continue with Jeanette's recommendation until I find another solution.

Mike

On Sun, Feb 5, 2023 at 9:36 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Not in that particular case, see

"For arrays whose length is a power of 2, space allocation always provides for 2n points plus an additional guard point. The guard point value, used during interpolated lookup, can be automatically set to reflect the table's purpose: If size is an exact power of 2, the guard point will be a copy of the first point; this is appropriate for interpolated wrap-around lookup as in oscili, etc., and should even be used for non-interpolating oscil for safe consistency. If size is set to 2 n + 1, the guard point value automatically extends the contour of table values; this is appropriate for single-scan functions such in envplxoscil1oscil1i, etc.

The size of the table is used as a code to tell Csound how to fill this guard-point. If the size is exactly power-of-two, then the guard point contains a copy of the first point on the table. If the size is power-of-two plus one, Csound will extend the contour of the function stored in the table for one extra point."


That page also needs to be updated in that negative numbers are not used anymore to allow for any size (since Csound 6).

This issue is not well resolved I think and we'll
need to tackle it on 7.x

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 15:25, Mike McGonagle <mjmogo@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

I should have mentioned that the sizes being returned by ftlen in the second program are not right. The odd sizes are one smaller than they should be.

On Sun, Feb 5, 2023 at 9:14 AM Mike McGonagle <mjmogo@gmail.com> wrote:
Hello all,

I've got a program that I have several tables that get passed to an instrument, which uses these tables to extract it's performance data. My problem is that in my first example program, everything seems to work fine. But with the second, the difference being there are four tables, instead of two, but the odd sized tables are now one element shorter, and even sized.

Thanks,

Mike
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

Date2023-02-05 15:41
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] [Csnd] Table oddities
I posted the relevant manual reference for you. Jeanette also gave a good solution.

3, 5, 9, 17, 33 etc will always report sizes of 2, 4, 8, 16, 32

Other lengths will not.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 15:36, Mike McGonagle <mjmogo@gmail.com> wrote:


I did some other tests changing the sizes to other odd values, and some seemed to work, while others didn't.

I was thinking as a work-around that I could just double the sizes of these tables, and then duplicate the data. It might make it awkward to do certain things, but I just want to get this running.

On Sun, Feb 5, 2023 at 9:29 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
I think it's because 5 and 3 are power of 2 + 1 sizes. These particular lengths set the table size to a power of two and set guard point to extend the curve. Not sure how this extension applies to GEN2 (need to check) but the size is set to size - 1 in this case afaik.

best

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 15:15, Mike McGonagle <mjmogo@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

Hello all,

I've got a program that I have several tables that get passed to an instrument, which uses these tables to extract it's performance data. My problem is that in my first example program, everything seems to work fine. But with the second, the difference being there are four tables, instead of two, but the odd sized tables are now one element shorter, and even sized.

Thanks,

Mike
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
<table1.csd>
<table2.csd>
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

Date2023-02-05 15:49
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Table oddities
You don't need to use negative sizes except in the case where you want to switch off the extended guardpoint mechanism, which uses the power of 2 + 1 size.

A size 7 will always create a table reporting size 7, no need for negative numbers since 6.0.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 15:41, Mike McGonagle <mjmogo@gmail.com> wrote:


So, should I NOT use the negative sizes? They do seem to work with 6.18, but it sounds like this is a point of contention for version 7, right?

Anyway, I think I will continue with Jeanette's recommendation until I find another solution.

Mike

On Sun, Feb 5, 2023 at 9:36 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Not in that particular case, see

"For arrays whose length is a power of 2, space allocation always provides for 2n points plus an additional guard point. The guard point value, used during interpolated lookup, can be automatically set to reflect the table's purpose: If size is an exact power of 2, the guard point will be a copy of the first point; this is appropriate for interpolated wrap-around lookup as in oscili, etc., and should even be used for non-interpolating oscil for safe consistency. If size is set to 2 n + 1, the guard point value automatically extends the contour of table values; this is appropriate for single-scan functions such in envplxoscil1oscil1i, etc.

The size of the table is used as a code to tell Csound how to fill this guard-point. If the size is exactly power-of-two, then the guard point contains a copy of the first point on the table. If the size is power-of-two plus one, Csound will extend the contour of the function stored in the table for one extra point."


That page also needs to be updated in that negative numbers are not used anymore to allow for any size (since Csound 6).

This issue is not well resolved I think and we'll
need to tackle it on 7.x

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 15:25, Mike McGonagle <mjmogo@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

I should have mentioned that the sizes being returned by ftlen in the second program are not right. The odd sizes are one smaller than they should be.

On Sun, Feb 5, 2023 at 9:14 AM Mike McGonagle <mjmogo@gmail.com> wrote:
Hello all,

I've got a program that I have several tables that get passed to an instrument, which uses these tables to extract it's performance data. My problem is that in my first example program, everything seems to work fine. But with the second, the difference being there are four tables, instead of two, but the odd sized tables are now one element shorter, and even sized.

Thanks,

Mike
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

Date2023-02-05 16:04
FromST Music
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Table oddities
Attachmentstable2a.csd  
FWIW the -2 worked fine for me when the table sizes were set to 0. Although for some reason the canonical manual doesn't seem to mention it, GEN02 will set the table size automatically depending on how many indices (values) there are if you set table size to 0.

Scott Daughtrey

On Sun, Feb 5, 2023, 10:49 AM Victor Lazzarini, <Victor.Lazzarini@mu.ie> wrote:
You don't need to use negative sizes except in the case where you want to switch off the extended guardpoint mechanism, which uses the power of 2 + 1 size.

A size 7 will always create a table reporting size 7, no need for negative numbers since 6.0.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 15:41, Mike McGonagle <mjmogo@gmail.com> wrote:


So, should I NOT use the negative sizes? They do seem to work with 6.18, but it sounds like this is a point of contention for version 7, right?

Anyway, I think I will continue with Jeanette's recommendation until I find another solution.

Mike

On Sun, Feb 5, 2023 at 9:36 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Not in that particular case, see

"For arrays whose length is a power of 2, space allocation always provides for 2n points plus an additional guard point. The guard point value, used during interpolated lookup, can be automatically set to reflect the table's purpose: If size is an exact power of 2, the guard point will be a copy of the first point; this is appropriate for interpolated wrap-around lookup as in oscili, etc., and should even be used for non-interpolating oscil for safe consistency. If size is set to 2 n + 1, the guard point value automatically extends the contour of table values; this is appropriate for single-scan functions such in envplxoscil1oscil1i, etc.

The size of the table is used as a code to tell Csound how to fill this guard-point. If the size is exactly power-of-two, then the guard point contains a copy of the first point on the table. If the size is power-of-two plus one, Csound will extend the contour of the function stored in the table for one extra point."


That page also needs to be updated in that negative numbers are not used anymore to allow for any size (since Csound 6).

This issue is not well resolved I think and we'll
need to tackle it on 7.x

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 15:25, Mike McGonagle <mjmogo@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

I should have mentioned that the sizes being returned by ftlen in the second program are not right. The odd sizes are one smaller than they should be.

On Sun, Feb 5, 2023 at 9:14 AM Mike McGonagle <mjmogo@gmail.com> wrote:
Hello all,

I've got a program that I have several tables that get passed to an instrument, which uses these tables to extract it's performance data. My problem is that in my first example program, everything seems to work fine. But with the second, the difference being there are four tables, instead of two, but the odd sized tables are now one element shorter, and even sized.

Thanks,

Mike
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

Date2023-02-05 16:21
FromVictor Lazzarini
SubjectRe: [Csnd] [EXTERNAL] Re: [Csnd] Table oddities
yes, because 0 is not power of 2 + 1

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 16:06, ST Music <stunes6556@gmail.com> wrote:


FWIW the -2 worked fine for me when the table sizes were set to 0. Although for some reason the canonical manual doesn't seem to mention it, GEN02 will set the table size automatically depending on how many indices (values) there are if you set table size to 0.

Scott Daughtrey

On Sun, Feb 5, 2023, 10:49 AM Victor Lazzarini, <Victor.Lazzarini@mu.ie> wrote:
You don't need to use negative sizes except in the case where you want to switch off the extended guardpoint mechanism, which uses the power of 2 + 1 size.

A size 7 will always create a table reporting size 7, no need for negative numbers since 6.0.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 15:41, Mike McGonagle <mjmogo@gmail.com> wrote:


So, should I NOT use the negative sizes? They do seem to work with 6.18, but it sounds like this is a point of contention for version 7, right?

Anyway, I think I will continue with Jeanette's recommendation until I find another solution.

Mike

On Sun, Feb 5, 2023 at 9:36 AM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Not in that particular case, see

"For arrays whose length is a power of 2, space allocation always provides for 2n points plus an additional guard point. The guard point value, used during interpolated lookup, can be automatically set to reflect the table's purpose: If size is an exact power of 2, the guard point will be a copy of the first point; this is appropriate for interpolated wrap-around lookup as in oscili, etc., and should even be used for non-interpolating oscil for safe consistency. If size is set to 2 n + 1, the guard point value automatically extends the contour of table values; this is appropriate for single-scan functions such in envplxoscil1oscil1i, etc.

The size of the table is used as a code to tell Csound how to fill this guard-point. If the size is exactly power-of-two, then the guard point contains a copy of the first point on the table. If the size is power-of-two plus one, Csound will extend the contour of the function stored in the table for one extra point."


That page also needs to be updated in that negative numbers are not used anymore to allow for any size (since Csound 6).

This issue is not well resolved I think and we'll
need to tackle it on 7.x

Prof. Victor Lazzarini
Maynooth University
Ireland

On 5 Feb 2023, at 15:25, Mike McGonagle <mjmogo@gmail.com> wrote:



*Warning*

This email originated from outside of Maynooth University's Mail System. Do not reply, click links or open attachments unless you recognise the sender and know the content is safe.

I should have mentioned that the sizes being returned by ftlen in the second program are not right. The odd sizes are one smaller than they should be.

On Sun, Feb 5, 2023 at 9:14 AM Mike McGonagle <mjmogo@gmail.com> wrote:
Hello all,

I've got a program that I have several tables that get passed to an instrument, which uses these tables to extract it's performance data. My problem is that in my first example program, everything seems to work fine. But with the second, the difference being there are four tables, instead of two, but the odd sized tables are now one element shorter, and even sized.

Thanks,

Mike
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
<table2a.csd>