[Csnd] Table oddities
Date | 2023-02-05 15:14 |
From | Mike McGonagle |
Subject | [Csnd] Table oddities |
Attachments | table1.csd table2.csd |
Hello all,
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
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 |
Date | 2023-02-05 15:23 |
From | Mike McGonagle |
Subject | Re: [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:
|
Date | 2023-02-05 15:29 |
From | Victor Lazzarini |
Subject | Re: [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:
|
Date | 2023-02-05 15:31 |
From | "Jeanette C." |
Subject | Re: [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 |
Date | 2023-02-05 15:34 |
From | Mike McGonagle |
Subject | Re: [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:
|
Date | 2023-02-05 15:36 |
From | Victor Lazzarini |
Subject | Re: [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 envplx, oscil1, oscil1i, 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:
|
Date | 2023-02-05 15:36 |
From | Mike McGonagle |
Subject | Re: [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! |
Date | 2023-02-05 15:37 |
From | Victor Lazzarini |
Subject | Re: [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. |
Date | 2023-02-05 15:39 |
From | Mike McGonagle |
Subject | Re: [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:
|
Date | 2023-02-05 15:41 |
From | Victor Lazzarini |
Subject | Re: [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:
|
Date | 2023-02-05 15:49 |
From | Victor Lazzarini |
Subject | Re: [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:
|
Date | 2023-02-05 16:04 |
From | ST Music |
Subject | Re: [Csnd] [EXTERNAL] Re: [Csnd] Table oddities |
Attachments | table2a.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:
|
Date | 2023-02-05 16:21 |
From | Victor Lazzarini |
Subject | Re: [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:
|