Csound Csound-dev Csound-tekno Search About

[Csnd-dev] sysdep.h and MAXLEN for ftables

Date2024-10-01 13:36
FromSteven Yi
Subject[Csnd-dev] sysdep.h and MAXLEN for ftables
Hi All,

I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger? 

Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this. 

steven

Date2024-10-01 13:39
From"Dr. Richard Boulanger"
SubjectRe: [Csnd-dev] sysdep.h and MAXLEN for ftables
Please make max table length larger.

- Dr.B


Dr. Richard Boulanger

Professor

Electronic Production and Design

Berklee College of Music

Professional Writing & Technology Division



On Tue, Oct 1, 2024 at 8:36 AM Steven Yi <stevenyi@gmail.com> wrote:
Hi All,

I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger? 

Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this. 

steven

Date2024-10-01 13:43
Fromvlz
SubjectRe: [Csnd-dev] sysdep.h and MAXLEN for ftables
We have to investigate as it may have knockdown consequences to integer phase increment code.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 1 Oct 2024, at 13:36, Steven Yi  wrote:
> 
> 
> Hi All,
> 
> I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger? 
> 
> Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this. 
> 
> steven

Date2024-10-01 20:00
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] sysdep.h and MAXLEN for ftables
MAXLEN is 0x10000000 for most modern archs, that's 2^28 is it not? That translates into
about 101 minutes of audio at 44100.

It does not strike me as too short. I think we could get away with 2^32 without having to do a major overhaul, but I need to check if my idea works correctly. That would allows 1603 minutes or 27 hours of audio.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 1 Oct 2024, at 13:36, Steven Yi <stevenyi@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.

Hi All,

I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger? 

Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this. 

steven

Date2024-10-01 20:20
FromSteven Yi
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] sysdep.h and MAXLEN for ftables
I was going off what's documented in the manual (https://csound.com/docs/manual/f.html)

"p3 -- Size of function table (i.e. number of points) Must be a power of 2, or a power-of-2 plus 1 if this number is positive. Maximum table size is 16777216 (224) points."

I think Giovanni ran into issues with longer sized tables but I don't recall how long. 

On Tue, Oct 1, 2024 at 3:00 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
MAXLEN is 0x10000000 for most modern archs, that's 2^28 is it not? That translates into
about 101 minutes of audio at 44100.

It does not strike me as too short. I think we could get away with 2^32 without having to do a major overhaul, but I need to check if my idea works correctly. That would allows 1603 minutes or 27 hours of audio.

Prof. Victor Lazzarini
Maynooth University
Ireland

On 1 Oct 2024, at 13:36, Steven Yi <stevenyi@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.

Hi All,

I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger? 

Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this. 

steven

Date2024-10-01 20:58
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] sysdep.h and MAXLEN for ftables
That’s if B64BIT is not defined. Actually I don’t think we need to check for this.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 1 Oct 2024, at 20:20, Steven Yi  wrote:
> 
> I was going off what's documented in the manual (https://csound.com/docs/manual/f.html)
> 
> "p3 -- Size of function table (i.e. number of points) Must be a power of 2, or a power-of-2 plus 1 if this number is positive. Maximum table size is 16777216 (224) points."
> 
> I think Giovanni ran into issues with longer sized tables but I don't recall how long. 
> 
> On Tue, Oct 1, 2024 at 3:00 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> MAXLEN is 0x10000000 for most modern archs, that's 2^28 is it not? That translates into 
> about 101 minutes of audio at 44100.
> 
> It does not strike me as too short. I think we could get away with 2^32 without having to do a major overhaul, but I need to check if my idea works correctly. That would allows 1603 minutes or 27 hours of audio. 
> 
> Prof. Victor Lazzarini 
> Maynooth University
> Ireland
> 
>> On 1 Oct 2024, at 13:36, Steven Yi  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.
>> Hi All,
>> 
>> I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger? 
>> 
>> Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this. 
>> 
>> steven


Date2024-10-01 22:47
FromGiovanni Bedetti
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] sysdep.h and MAXLEN for ftables
I tried to create a table (using the API, compileOrc and CopyTableIn) after reading samples from a stereo file (so the table will hold both channels, interleaved): this works: audioClip samples 4549938x2 = 9099876, length (seconds): 103.1732, sr: 44100
this doesn't: audioClip samples 10612538x2 = 21225076, length (seconds): 240.6471, sr: 44100
with this log:
illegal table length
INIT ERROR in instr 0 (opcode ftgen) line 11: ftgen error gisampletable100 ftgen 100 0 -21225076 -7 0 0

I'm still using Csound6 (6.18) on CsoundUnity on macOS

Il giorno mar 1 ott 2024 alle ore 21:58 Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> ha scritto:
That’s if B64BIT is not defined. Actually I don’t think we need to check for this.
========================
Prof. Victor Lazzarini
Maynooth University
Ireland

> On 1 Oct 2024, at 20:20, Steven Yi <stevenyi@GMAIL.COM> wrote:
>
> I was going off what's documented in the manual (https://csound.com/docs/manual/f.html)
>
> "p3 -- Size of function table (i.e. number of points) Must be a power of 2, or a power-of-2 plus 1 if this number is positive. Maximum table size is 16777216 (224) points."
>
> I think Giovanni ran into issues with longer sized tables but I don't recall how long.
>
> On Tue, Oct 1, 2024 at 3:00 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> MAXLEN is 0x10000000 for most modern archs, that's 2^28 is it not? That translates into
> about 101 minutes of audio at 44100.
>
> It does not strike me as too short. I think we could get away with 2^32 without having to do a major overhaul, but I need to check if my idea works correctly. That would allows 1603 minutes or 27 hours of audio.
>
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
>
>> On 1 Oct 2024, at 13:36, Steven Yi <stevenyi@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.
>> Hi All,
>>
>> I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger?
>>
>> Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this.
>>
>> steven


Date2024-10-01 23:06
Fromvlz
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] sysdep.h and MAXLEN for ftables
Then for some reason in the build B64BIT is not defined. If that’s defined you can do

i1 ftgen 1, 0, 2^28, 2, 0, 2^28, 0 

We need to check that.

> On 1 Oct 2024, at 22:47, Giovanni Bedetti  wrote:
> 
> I tried to create a table (using the API, compileOrc and CopyTableIn) after reading samples from a stereo file (so the table will hold both channels, interleaved): this works: audioClip samples 4549938x2 = 9099876, length (seconds): 103.1732, sr: 44100
> this doesn't: audioClip samples 10612538x2 = 21225076, length (seconds): 240.6471, sr: 44100
> with this log:
> illegal table length 
> INIT ERROR in instr 0 (opcode ftgen) line 11: ftgen error gisampletable100 ftgen 100 0 -21225076 -7 0 0
> 
> I'm still using Csound6 (6.18) on CsoundUnity on macOS
> 
> Il giorno mar 1 ott 2024 alle ore 21:58 Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> ha scritto:
> That’s if B64BIT is not defined. Actually I don’t think we need to check for this.
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> > On 1 Oct 2024, at 20:20, Steven Yi  wrote:
> > 
> > I was going off what's documented in the manual (https://csound.com/docs/manual/f.html)
> > 
> > "p3 -- Size of function table (i.e. number of points) Must be a power of 2, or a power-of-2 plus 1 if this number is positive. Maximum table size is 16777216 (224) points."
> > 
> > I think Giovanni ran into issues with longer sized tables but I don't recall how long. 
> > 
> > On Tue, Oct 1, 2024 at 3:00 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> > MAXLEN is 0x10000000 for most modern archs, that's 2^28 is it not? That translates into 
> > about 101 minutes of audio at 44100.
> > 
> > It does not strike me as too short. I think we could get away with 2^32 without having to do a major overhaul, but I need to check if my idea works correctly. That would allows 1603 minutes or 27 hours of audio. 
> > 
> > Prof. Victor Lazzarini 
> > Maynooth University
> > Ireland
> > 
> >> On 1 Oct 2024, at 13:36, Steven Yi  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.
> >> Hi All,
> >> 
> >> I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger? 
> >> 
> >> Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this. 
> >> 
> >> steven
> 

Date2024-10-01 23:12
Fromvlz
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] sysdep.h and MAXLEN for ftables
I think the check was broken, Steven seems to have fixed it.

> On 1 Oct 2024, at 23:06, vlz  wrote:
> 
> Then for some reason in the build B64BIT is not defined. If that’s defined you can do
> 
> i1 ftgen 1, 0, 2^28, 2, 0, 2^28, 0 
> 
> We need to check that.
> 
>> On 1 Oct 2024, at 22:47, Giovanni Bedetti  wrote:
>> 
>> I tried to create a table (using the API, compileOrc and CopyTableIn) after reading samples from a stereo file (so the table will hold both channels, interleaved): this works: audioClip samples 4549938x2 = 9099876, length (seconds): 103.1732, sr: 44100
>> this doesn't: audioClip samples 10612538x2 = 21225076, length (seconds): 240.6471, sr: 44100
>> with this log:
>> illegal table length 
>> INIT ERROR in instr 0 (opcode ftgen) line 11: ftgen error gisampletable100 ftgen 100 0 -21225076 -7 0 0
>> 
>> I'm still using Csound6 (6.18) on CsoundUnity on macOS
>> 
>> Il giorno mar 1 ott 2024 alle ore 21:58 Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> ha scritto:
>> That’s if B64BIT is not defined. Actually I don’t think we need to check for this.
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland
>> 
>>> On 1 Oct 2024, at 20:20, Steven Yi  wrote:
>>> 
>>> I was going off what's documented in the manual (https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcsound.com%2Fdocs%2Fmanual%2Ff.html&data=05%7C02%7Cvictor.lazzarini%40MU.IE%7Ced34c2452e0944cee65e08dce2655307%7C1454f5ccbb354685bbd98621fd8055c9%7C0%7C0%7C638634172089549293%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&sdata=q%2FHKKa4e2uF9WQRK7Ur%2BjdiJv9EWs55KWuFXTpryVz0%3D&reserved=0)
>>> 
>>> "p3 -- Size of function table (i.e. number of points) Must be a power of 2, or a power-of-2 plus 1 if this number is positive. Maximum table size is 16777216 (224) points."
>>> 
>>> I think Giovanni ran into issues with longer sized tables but I don't recall how long. 
>>> 
>>> On Tue, Oct 1, 2024 at 3:00 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>> MAXLEN is 0x10000000 for most modern archs, that's 2^28 is it not? That translates into 
>>> about 101 minutes of audio at 44100.
>>> 
>>> It does not strike me as too short. I think we could get away with 2^32 without having to do a major overhaul, but I need to check if my idea works correctly. That would allows 1603 minutes or 27 hours of audio. 
>>> 
>>> Prof. Victor Lazzarini 
>>> Maynooth University
>>> Ireland
>>> 
>>>> On 1 Oct 2024, at 13:36, Steven Yi  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.
>>>> Hi All,
>>>> 
>>>> I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger? 
>>>> 
>>>> Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this. 
>>>> 
>>>> steven
>> 

Date2024-10-01 23:46
FromVictor Lazzarini <000010b17ddd988e-dmarc-request@LISTSERV.HEANET.IE>
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] sysdep.h and MAXLEN for ftables
I figured it out:

1) Starting with 6.18.1 on Mac I released universal binaries
2) The check for B64BIT was only picking up the x86_64 nor arm64

The result was that for  i1 ftgen 1, 0, 2^28, 2, 0, 2^28, 0

1) on arm64 (Csound 6.18.1)

/usr/local/bin/csound test.csd -n

INIT ERROR in instr 0 (opcode ftgen) line 8: ftgen error
 from file test.csd (1),i1 ftgen 1 0 268435456 2 0 268435456 0

2) on x86_64 (Csound 6.18.1)

arch -x86_64 /usr/local/bin/csound test.csd -n

ftable 1: 268435456 points, scalemax 1.000

So for 6.18.1, only the x86_64 allows up to 2^28-length tables.

With Steven’s fix, Csound 7 is building with B64BIT on arm64. But I think this changes does not need to be limited to 64bit platforms.
We probably can roll it out to all platforms.


> On 1 Oct 2024, at 23:12, vlz  wrote:
>
> I think the check was broken, Steven seems to have fixed it.
>
>> On 1 Oct 2024, at 23:06, vlz  wrote:
>>
>> Then for some reason in the build B64BIT is not defined. If that’s defined you can do
>>
>> i1 ftgen 1, 0, 2^28, 2, 0, 2^28, 0
>>
>> We need to check that.
>>
>>> On 1 Oct 2024, at 22:47, Giovanni Bedetti  wrote:
>>>
>>> I tried to create a table (using the API, compileOrc and CopyTableIn) after reading samples from a stereo file (so the table will hold both channels, interleaved): this works: audioClip samples 4549938x2 = 9099876, length (seconds): 103.1732, sr: 44100
>>> this doesn't: audioClip samples 10612538x2 = 21225076, length (seconds): 240.6471, sr: 44100
>>> with this log:
>>> illegal table length
>>> INIT ERROR in instr 0 (opcode ftgen) line 11: ftgen error gisampletable100 ftgen 100 0 -21225076 -7 0 0
>>>
>>> I'm still using Csound6 (6.18) on CsoundUnity on macOS
>>>
>>> Il giorno mar 1 ott 2024 alle ore 21:58 Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> ha scritto:
>>> That’s if B64BIT is not defined. Actually I don’t think we need to check for this.
>>> ========================
>>> Prof. Victor Lazzarini
>>> Maynooth University
>>> Ireland
>>>
>>>> On 1 Oct 2024, at 20:20, Steven Yi  wrote:
>>>>
>>>> I was going off what's documented in the manual (https://csound.com/docs/manual/f.html)
>>>>
>>>> "p3 -- Size of function table (i.e. number of points) Must be a power of 2, or a power-of-2 plus 1 if this number is positive. Maximum table size is 16777216 (224) points."
>>>>
>>>> I think Giovanni ran into issues with longer sized tables but I don't recall how long.
>>>>
>>>> On Tue, Oct 1, 2024 at 3:00 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>>> MAXLEN is 0x10000000 for most modern archs, that's 2^28 is it not? That translates into
>>>> about 101 minutes of audio at 44100.
>>>>
>>>> It does not strike me as too short. I think we could get away with 2^32 without having to do a major overhaul, but I need to check if my idea works correctly. That would allows 1603 minutes or 27 hours of audio.
>>>>
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>>
>>>>> On 1 Oct 2024, at 13:36, Steven Yi  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.
>>>>> Hi All,
>>>>>
>>>>> I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger?
>>>>>
>>>>> Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this.
>>>>>
>>>>> steven


========================
Prof. Victor Lazzarini
Maynooth University
Ireland


Date2024-10-02 01:13
Fromjoachim heintz
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] sysdep.h and MAXLEN for ftables
but what giovanni mentioned as multi-channel import should be 
considered.  if we import interleaved, we can hit the limit more easy. 
so if it is safe to extend to 2^32 as maximum length, it might be good.

On 02/10/2024 00:46, Victor Lazzarini wrote:
> I figured it out:
> 
> 1) Starting with 6.18.1 on Mac I released universal binaries
> 2) The check for B64BIT was only picking up the x86_64 nor arm64
> 
> The result was that for  i1 ftgen 1, 0, 2^28, 2, 0, 2^28, 0
> 
> 1) on arm64 (Csound 6.18.1)
> 
> /usr/local/bin/csound test.csd -n
> 
> INIT ERROR in instr 0 (opcode ftgen) line 8: ftgen error
>   from file test.csd (1),i1 ftgen 1 0 268435456 2 0 268435456 0
> 
> 2) on x86_64 (Csound 6.18.1)
> 
> arch -x86_64 /usr/local/bin/csound test.csd -n
> 
> ftable 1: 268435456 points, scalemax 1.000
> 
> So for 6.18.1, only the x86_64 allows up to 2^28-length tables.
> 
> With Steven’s fix, Csound 7 is building with B64BIT on arm64. But I think this changes does not need to be limited to 64bit platforms.
> We probably can roll it out to all platforms.
> 
> 
>> On 1 Oct 2024, at 23:12, vlz  wrote:
>>
>> I think the check was broken, Steven seems to have fixed it.
>>
>>> On 1 Oct 2024, at 23:06, vlz  wrote:
>>>
>>> Then for some reason in the build B64BIT is not defined. If that’s defined you can do
>>>
>>> i1 ftgen 1, 0, 2^28, 2, 0, 2^28, 0
>>>
>>> We need to check that.
>>>
>>>> On 1 Oct 2024, at 22:47, Giovanni Bedetti  wrote:
>>>>
>>>> I tried to create a table (using the API, compileOrc and CopyTableIn) after reading samples from a stereo file (so the table will hold both channels, interleaved): this works: audioClip samples 4549938x2 = 9099876, length (seconds): 103.1732, sr: 44100
>>>> this doesn't: audioClip samples 10612538x2 = 21225076, length (seconds): 240.6471, sr: 44100
>>>> with this log:
>>>> illegal table length
>>>> INIT ERROR in instr 0 (opcode ftgen) line 11: ftgen error gisampletable100 ftgen 100 0 -21225076 -7 0 0
>>>>
>>>> I'm still using Csound6 (6.18) on CsoundUnity on macOS
>>>>
>>>> Il giorno mar 1 ott 2024 alle ore 21:58 Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> ha scritto:
>>>> That’s if B64BIT is not defined. Actually I don’t think we need to check for this.
>>>> ========================
>>>> Prof. Victor Lazzarini
>>>> Maynooth University
>>>> Ireland
>>>>
>>>>> On 1 Oct 2024, at 20:20, Steven Yi  wrote:
>>>>>
>>>>> I was going off what's documented in the manual (https://csound.com/docs/manual/f.html)
>>>>>
>>>>> "p3 -- Size of function table (i.e. number of points) Must be a power of 2, or a power-of-2 plus 1 if this number is positive. Maximum table size is 16777216 (224) points."
>>>>>
>>>>> I think Giovanni ran into issues with longer sized tables but I don't recall how long.
>>>>>
>>>>> On Tue, Oct 1, 2024 at 3:00 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>>>> MAXLEN is 0x10000000 for most modern archs, that's 2^28 is it not? That translates into
>>>>> about 101 minutes of audio at 44100.
>>>>>
>>>>> It does not strike me as too short. I think we could get away with 2^32 without having to do a major overhaul, but I need to check if my idea works correctly. That would allows 1603 minutes or 27 hours of audio.
>>>>>
>>>>> Prof. Victor Lazzarini
>>>>> Maynooth University
>>>>> Ireland
>>>>>
>>>>>> On 1 Oct 2024, at 13:36, Steven Yi  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.
>>>>>> Hi All,
>>>>>>
>>>>>> I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger?
>>>>>>
>>>>>> Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this.
>>>>>>
>>>>>> steven
> 
> 
> ========================
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 

Date2024-10-02 06:43
Fromvlz
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] sysdep.h and MAXLEN for ftables
For multichannel, you can use one table per channel instead of interleaved and there's no loss in length.

It looks like 2^31 is possible without having to edit the full codebase.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 2 Oct 2024, at 01:14, joachim heintz  wrote:
> 
> but what giovanni mentioned as multi-channel import should be considered.  if we import interleaved, we can hit the limit more easy. so if it is safe to extend to 2^32 as maximum length, it might be good.
> 
>> On 02/10/2024 00:46, Victor Lazzarini wrote:
>> I figured it out:
>> 1) Starting with 6.18.1 on Mac I released universal binaries
>> 2) The check for B64BIT was only picking up the x86_64 nor arm64
>> The result was that for  i1 ftgen 1, 0, 2^28, 2, 0, 2^28, 0
>> 1) on arm64 (Csound 6.18.1)
>> /usr/local/bin/csound test.csd -n
>> INIT ERROR in instr 0 (opcode ftgen) line 8: ftgen error
>>  from file test.csd (1),i1 ftgen 1 0 268435456 2 0 268435456 0
>> 2) on x86_64 (Csound 6.18.1)
>> arch -x86_64 /usr/local/bin/csound test.csd -n
>> ftable 1: 268435456 points, scalemax 1.000
>> So for 6.18.1, only the x86_64 allows up to 2^28-length tables.
>> With Steven’s fix, Csound 7 is building with B64BIT on arm64. But I think this changes does not need to be limited to 64bit platforms.
>> We probably can roll it out to all platforms.
>>>> On 1 Oct 2024, at 23:12, vlz  wrote:
>>> 
>>> I think the check was broken, Steven seems to have fixed it.
>>> 
>>>> On 1 Oct 2024, at 23:06, vlz  wrote:
>>>> 
>>>> Then for some reason in the build B64BIT is not defined. If that’s defined you can do
>>>> 
>>>> i1 ftgen 1, 0, 2^28, 2, 0, 2^28, 0
>>>> 
>>>> We need to check that.
>>>> 
>>>>> On 1 Oct 2024, at 22:47, Giovanni Bedetti  wrote:
>>>>> 
>>>>> I tried to create a table (using the API, compileOrc and CopyTableIn) after reading samples from a stereo file (so the table will hold both channels, interleaved): this works: audioClip samples 4549938x2 = 9099876, length (seconds): 103.1732, sr: 44100
>>>>> this doesn't: audioClip samples 10612538x2 = 21225076, length (seconds): 240.6471, sr: 44100
>>>>> with this log:
>>>>> illegal table length
>>>>> INIT ERROR in instr 0 (opcode ftgen) line 11: ftgen error gisampletable100 ftgen 100 0 -21225076 -7 0 0
>>>>> 
>>>>> I'm still using Csound6 (6.18) on CsoundUnity on macOS
>>>>> 
>>>>> Il giorno mar 1 ott 2024 alle ore 21:58 Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> ha scritto:
>>>>> That’s if B64BIT is not defined. Actually I don’t think we need to check for this.
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Maynooth University
>>>>> Ireland
>>>>> 
>>>>>> On 1 Oct 2024, at 20:20, Steven Yi  wrote:
>>>>>> 
>>>>>> I was going off what's documented in the manual (https://csound.com/docs/manual/f.html)
>>>>>> 
>>>>>> "p3 -- Size of function table (i.e. number of points) Must be a power of 2, or a power-of-2 plus 1 if this number is positive. Maximum table size is 16777216 (224) points."
>>>>>> 
>>>>>> I think Giovanni ran into issues with longer sized tables but I don't recall how long.
>>>>>> 
>>>>>> On Tue, Oct 1, 2024 at 3:00 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>>>>> MAXLEN is 0x10000000 for most modern archs, that's 2^28 is it not? That translates into
>>>>>> about 101 minutes of audio at 44100.
>>>>>> 
>>>>>> It does not strike me as too short. I think we could get away with 2^32 without having to do a major overhaul, but I need to check if my idea works correctly. That would allows 1603 minutes or 27 hours of audio.
>>>>>> 
>>>>>> Prof. Victor Lazzarini
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>> 
>>>>>>> On 1 Oct 2024, at 13:36, Steven Yi  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.
>>>>>>> Hi All,
>>>>>>> 
>>>>>>> I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger?
>>>>>>> 
>>>>>>> Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this.
>>>>>>> 
>>>>>>> steven
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland

Date2024-10-02 10:15
FromGiovanni Bedetti
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] sysdep.h and MAXLEN for ftables
Yes I'm using a M3 mac (ARM based) so that's why it's failing. I still have to try it on Csound7.
2^31 looks like a big improvement, it's 811 minutes for a mono source at 44100Hz, correct? 
So if it's possible let's go for it!


Il giorno mer 2 ott 2024 alle ore 07:43 vlz <viclazzarini@gmail.com> ha scritto:
For multichannel, you can use one table per channel instead of interleaved and there's no loss in length.

It looks like 2^31 is possible without having to edit the full codebase.

Prof. Victor Lazzarini
Maynooth University
Ireland

> On 2 Oct 2024, at 01:14, joachim heintz <jh@joachimheintz.de> wrote:
>
> but what giovanni mentioned as multi-channel import should be considered.  if we import interleaved, we can hit the limit more easy. so if it is safe to extend to 2^32 as maximum length, it might be good.
>
>> On 02/10/2024 00:46, Victor Lazzarini wrote:
>> I figured it out:
>> 1) Starting with 6.18.1 on Mac I released universal binaries
>> 2) The check for B64BIT was only picking up the x86_64 nor arm64
>> The result was that for  i1 ftgen 1, 0, 2^28, 2, 0, 2^28, 0
>> 1) on arm64 (Csound 6.18.1)
>> /usr/local/bin/csound test.csd -n
>> INIT ERROR in instr 0 (opcode ftgen) line 8: ftgen error
>>  from file test.csd (1),i1 ftgen 1 0 268435456 2 0 268435456 0
>> 2) on x86_64 (Csound 6.18.1)
>> arch -x86_64 /usr/local/bin/csound test.csd -n
>> ftable 1: 268435456 points, scalemax 1.000
>> So for 6.18.1, only the x86_64 allows up to 2^28-length tables.
>> With Steven’s fix, Csound 7 is building with B64BIT on arm64. But I think this changes does not need to be limited to 64bit platforms.
>> We probably can roll it out to all platforms.
>>>> On 1 Oct 2024, at 23:12, vlz <viclazzarini@GMAIL.COM> wrote:
>>>
>>> I think the check was broken, Steven seems to have fixed it.
>>>
>>>> On 1 Oct 2024, at 23:06, vlz <viclazzarini@GMAIL.COM> wrote:
>>>>
>>>> Then for some reason in the build B64BIT is not defined. If that’s defined you can do
>>>>
>>>> i1 ftgen 1, 0, 2^28, 2, 0, 2^28, 0
>>>>
>>>> We need to check that.
>>>>
>>>>> On 1 Oct 2024, at 22:47, Giovanni Bedetti <giovanni.bedetti@GMAIL.COM> wrote:
>>>>>
>>>>> I tried to create a table (using the API, compileOrc and CopyTableIn) after reading samples from a stereo file (so the table will hold both channels, interleaved): this works: audioClip samples 4549938x2 = 9099876, length (seconds): 103.1732, sr: 44100
>>>>> this doesn't: audioClip samples 10612538x2 = 21225076, length (seconds): 240.6471, sr: 44100
>>>>> with this log:
>>>>> illegal table length
>>>>> INIT ERROR in instr 0 (opcode ftgen) line 11: ftgen error gisampletable100 ftgen 100 0 -21225076 -7 0 0
>>>>>
>>>>> I'm still using Csound6 (6.18) on CsoundUnity on macOS
>>>>>
>>>>> Il giorno mar 1 ott 2024 alle ore 21:58 Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> ha scritto:
>>>>> That’s if B64BIT is not defined. Actually I don’t think we need to check for this.
>>>>> ========================
>>>>> Prof. Victor Lazzarini
>>>>> Maynooth University
>>>>> Ireland
>>>>>
>>>>>> On 1 Oct 2024, at 20:20, Steven Yi <stevenyi@GMAIL.COM> wrote:
>>>>>>
>>>>>> I was going off what's documented in the manual (https://csound.com/docs/manual/f.html)
>>>>>>
>>>>>> "p3 -- Size of function table (i.e. number of points) Must be a power of 2, or a power-of-2 plus 1 if this number is positive. Maximum table size is 16777216 (224) points."
>>>>>>
>>>>>> I think Giovanni ran into issues with longer sized tables but I don't recall how long.
>>>>>>
>>>>>> On Tue, Oct 1, 2024 at 3:00 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
>>>>>> MAXLEN is 0x10000000 for most modern archs, that's 2^28 is it not? That translates into
>>>>>> about 101 minutes of audio at 44100.
>>>>>>
>>>>>> It does not strike me as too short. I think we could get away with 2^32 without having to do a major overhaul, but I need to check if my idea works correctly. That would allows 1603 minutes or 27 hours of audio.
>>>>>>
>>>>>> Prof. Victor Lazzarini
>>>>>> Maynooth University
>>>>>> Ireland
>>>>>>
>>>>>>> On 1 Oct 2024, at 13:36, Steven Yi <stevenyi@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.
>>>>>>> Hi All,
>>>>>>>
>>>>>>> I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger?
>>>>>>>
>>>>>>> Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this.
>>>>>>>
>>>>>>> steven
>> ========================
>> Prof. Victor Lazzarini
>> Maynooth University
>> Ireland

Date2024-10-02 10:21
Fromvlz
SubjectRe: [Csnd-dev] [EXTERNAL] [Csnd-dev] sysdep.h and MAXLEN for ftables
yes, 13 hours for mono at 44.1 KHz. I am working on the PR now.
> On 2 Oct 2024, at 10:15, Giovanni Bedetti  wrote:
> 
> Yes I'm using a M3 mac (ARM based) so that's why it's failing. I still have to try it on Csound7.
> 2^31 looks like a big improvement, it's 811 minutes for a mono source at 44100Hz, correct? 
> So if it's possible let's go for it!
> 
> 
> Il giorno mer 2 ott 2024 alle ore 07:43 vlz  ha scritto:
> For multichannel, you can use one table per channel instead of interleaved and there's no loss in length.
> 
> It looks like 2^31 is possible without having to edit the full codebase.
> 
> Prof. Victor Lazzarini
> Maynooth University
> Ireland
> 
> > On 2 Oct 2024, at 01:14, joachim heintz  wrote:
> > 
> > but what giovanni mentioned as multi-channel import should be considered.  if we import interleaved, we can hit the limit more easy. so if it is safe to extend to 2^32 as maximum length, it might be good.
> > 
> >> On 02/10/2024 00:46, Victor Lazzarini wrote:
> >> I figured it out:
> >> 1) Starting with 6.18.1 on Mac I released universal binaries
> >> 2) The check for B64BIT was only picking up the x86_64 nor arm64
> >> The result was that for  i1 ftgen 1, 0, 2^28, 2, 0, 2^28, 0
> >> 1) on arm64 (Csound 6.18.1)
> >> /usr/local/bin/csound test.csd -n
> >> INIT ERROR in instr 0 (opcode ftgen) line 8: ftgen error
> >>  from file test.csd (1),i1 ftgen 1 0 268435456 2 0 268435456 0
> >> 2) on x86_64 (Csound 6.18.1)
> >> arch -x86_64 /usr/local/bin/csound test.csd -n
> >> ftable 1: 268435456 points, scalemax 1.000
> >> So for 6.18.1, only the x86_64 allows up to 2^28-length tables.
> >> With Steven’s fix, Csound 7 is building with B64BIT on arm64. But I think this changes does not need to be limited to 64bit platforms.
> >> We probably can roll it out to all platforms.
> >>>> On 1 Oct 2024, at 23:12, vlz  wrote:
> >>> 
> >>> I think the check was broken, Steven seems to have fixed it.
> >>> 
> >>>> On 1 Oct 2024, at 23:06, vlz  wrote:
> >>>> 
> >>>> Then for some reason in the build B64BIT is not defined. If that’s defined you can do
> >>>> 
> >>>> i1 ftgen 1, 0, 2^28, 2, 0, 2^28, 0
> >>>> 
> >>>> We need to check that.
> >>>> 
> >>>>> On 1 Oct 2024, at 22:47, Giovanni Bedetti  wrote:
> >>>>> 
> >>>>> I tried to create a table (using the API, compileOrc and CopyTableIn) after reading samples from a stereo file (so the table will hold both channels, interleaved): this works: audioClip samples 4549938x2 = 9099876, length (seconds): 103.1732, sr: 44100
> >>>>> this doesn't: audioClip samples 10612538x2 = 21225076, length (seconds): 240.6471, sr: 44100
> >>>>> with this log:
> >>>>> illegal table length
> >>>>> INIT ERROR in instr 0 (opcode ftgen) line 11: ftgen error gisampletable100 ftgen 100 0 -21225076 -7 0 0
> >>>>> 
> >>>>> I'm still using Csound6 (6.18) on CsoundUnity on macOS
> >>>>> 
> >>>>> Il giorno mar 1 ott 2024 alle ore 21:58 Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> ha scritto:
> >>>>> That’s if B64BIT is not defined. Actually I don’t think we need to check for this.
> >>>>> ========================
> >>>>> Prof. Victor Lazzarini
> >>>>> Maynooth University
> >>>>> Ireland
> >>>>> 
> >>>>>> On 1 Oct 2024, at 20:20, Steven Yi  wrote:
> >>>>>> 
> >>>>>> I was going off what's documented in the manual (https://csound.com/docs/manual/f.html)
> >>>>>> 
> >>>>>> "p3 -- Size of function table (i.e. number of points) Must be a power of 2, or a power-of-2 plus 1 if this number is positive. Maximum table size is 16777216 (224) points."
> >>>>>> 
> >>>>>> I think Giovanni ran into issues with longer sized tables but I don't recall how long.
> >>>>>> 
> >>>>>> On Tue, Oct 1, 2024 at 3:00 PM Victor Lazzarini <000010b17ddd988e-dmarc-request@listserv.heanet.ie> wrote:
> >>>>>> MAXLEN is 0x10000000 for most modern archs, that's 2^28 is it not? That translates into
> >>>>>> about 101 minutes of audio at 44100.
> >>>>>> 
> >>>>>> It does not strike me as too short. I think we could get away with 2^32 without having to do a major overhaul, but I need to check if my idea works correctly. That would allows 1603 minutes or 27 hours of audio.
> >>>>>> 
> >>>>>> Prof. Victor Lazzarini
> >>>>>> Maynooth University
> >>>>>> Ireland
> >>>>>> 
> >>>>>>> On 1 Oct 2024, at 13:36, Steven Yi  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.
> >>>>>>> Hi All,
> >>>>>>> 
> >>>>>>> I was chatting with Giovanni Bedetti on Discord about max table length. It seems awfully small at 2^24 (~16MB). Any reason not to bump that up to something larger?
> >>>>>>> 
> >>>>>>> Also, while looking at that, I noticed B64BIT detection in sysdep.h. I saw that it was missing aarch64 amongst other things, so I've submitted a PR to update this.
> >>>>>>> 
> >>>>>>> steven
> >> ========================
> >> Prof. Victor Lazzarini
> >> Maynooth University
> >> Ireland