Csound Csound-dev Csound-tekno Search About

[Csnd] The real length of a table

Date2019-08-20 15:19
FromPeter Burgess
Subject[Csnd] The real length of a table
How do I aquire the real length of a function table?

I have an ftable declared as size 5 using gen 2, with 5 values specified in the declaration like so:

gifTable ftgen 0,0,5,  2,  40,43,45,48,52

I can't find a table length opcode that gives the correct length...

'tableng' and 'ftlen' return 4, presumably because they're assuming it's a power of 2 size table with a guard point, even though 'tableng' claims not to know if it has a guard point...

'nsamp' returns 0, for reasons I do not know...

How do I return he true value length of 5?
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

Date2019-08-20 15:28
FromEduardo Moguillansky
SubjectRe: [Csnd] The real length of a table

Use a negative number for the length. Also use a negative value for the gen type if you don't want normalisation

gifTable ftgen 0,0, -5, -2, 40,43,45,48,52

instr 1

ilen ftlen gifTable

printf "ilen: %d\n", 1, ilen

ftprint gifTable

turnoff

endin


It would be nice to have an opcode without all these idiosyncracies. Something like

gitabnum ftgen2 0, 5, 2, ...

(without the delay and all values positive)

On 20.08.19 16:19, Peter Burgess wrote:
How do I aquire the real length of a function table?

I have an ftable declared as size 5 using gen 2, with 5 values specified in the declaration like so:

gifTable ftgen 0,0,5,  2,  40,43,45,48,52

I can't find a table length opcode that gives the correct length...

'tableng' and 'ftlen' return 4, presumably because they're assuming it's a power of 2 size table with a guard point, even though 'tableng' claims not to know if it has a guard point...

'nsamp' returns 0, for reasons I do not know...

How do I return he true value length of 5?
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

Date2019-08-20 15:52
FromPeter Burgess
SubjectRe: [Csnd] The real length of a table
Oh crap yeah, very glad you mentioned the normalisation, I'd forgotten about that, that was also making me scratch my head, haha

I agree though, another ftgen without this might be nice, if it had a name that made it obvious it was doing exactly what you write I reckon.

Cheers for the help, Pete

On Tue, Aug 20, 2019 at 3:28 PM Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Use a negative number for the length. Also use a negative value for the gen type if you don't want normalisation

gifTable ftgen 0,0, -5, -2, 40,43,45,48,52

instr 1

ilen ftlen gifTable

printf "ilen: %d\n", 1, ilen

ftprint gifTable

turnoff

endin


It would be nice to have an opcode without all these idiosyncracies. Something like

gitabnum ftgen2 0, 5, 2, ...

(without the delay and all values positive)

On 20.08.19 16:19, Peter Burgess wrote:
How do I aquire the real length of a function table?

I have an ftable declared as size 5 using gen 2, with 5 values specified in the declaration like so:

gifTable ftgen 0,0,5,  2,  40,43,45,48,52

I can't find a table length opcode that gives the correct length...

'tableng' and 'ftlen' return 4, presumably because they're assuming it's a power of 2 size table with a guard point, even though 'tableng' claims not to know if it has a guard point...

'nsamp' returns 0, for reasons I do not know...

How do I return he true value length of 5?
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

Date2019-08-20 15:56
FromVictor Lazzarini
SubjectRe: [Csnd] The real length of a table
That sounds like a bug. From 6.0 we do not need to use negative numbers for sizes and ftlen should return the correct size.

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

On 20 Aug 2019, at 15:28, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Use a negative number for the length. Also use a negative value for the gen type if you don't want normalisation

gifTable ftgen 0,0, -5, -2, 40,43,45,48,52

instr 1

ilen ftlen gifTable

printf "ilen: %d\n", 1, ilen

ftprint gifTable

turnoff

endin


It would be nice to have an opcode without all these idiosyncracies. Something like

gitabnum ftgen2 0, 5, 2, ...

(without the delay and all values positive)

On 20.08.19 16:19, Peter Burgess wrote:
How do I aquire the real length of a function table?

I have an ftable declared as size 5 using gen 2, with 5 values specified in the declaration like so:

gifTable ftgen 0,0,5,  2,  40,43,45,48,52

I can't find a table length opcode that gives the correct length...

'tableng' and 'ftlen' return 4, presumably because they're assuming it's a power of 2 size table with a guard point, even though 'tableng' claims not to know if it has a guard point...

'nsamp' returns 0, for reasons I do not know...

How do I return he true value length of 5?
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

Date2019-08-20 16:13
FromPeter Burgess
SubjectRe: [Csnd] The real length of a table
It returns the correct size when table length is 6, but not 5

On Tue, Aug 20, 2019 at 3:56 PM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
That sounds like a bug. From 6.0 we do not need to use negative numbers for sizes and ftlen should return the correct size.

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

On 20 Aug 2019, at 15:28, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Use a negative number for the length. Also use a negative value for the gen type if you don't want normalisation

gifTable ftgen 0,0, -5, -2, 40,43,45,48,52

instr 1

ilen ftlen gifTable

printf "ilen: %d\n", 1, ilen

ftprint gifTable

turnoff

endin


It would be nice to have an opcode without all these idiosyncracies. Something like

gitabnum ftgen2 0, 5, 2, ...

(without the delay and all values positive)

On 20.08.19 16:19, Peter Burgess wrote:
How do I aquire the real length of a function table?

I have an ftable declared as size 5 using gen 2, with 5 values specified in the declaration like so:

gifTable ftgen 0,0,5,  2,  40,43,45,48,52

I can't find a table length opcode that gives the correct length...

'tableng' and 'ftlen' return 4, presumably because they're assuming it's a power of 2 size table with a guard point, even though 'tableng' claims not to know if it has a guard point...

'nsamp' returns 0, for reasons I do not know...

How do I return he true value length of 5?
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

Date2019-08-20 16:17
FromVictor Lazzarini
SubjectRe: [Csnd] The real length of a table
Ah, because 5 is 4 with an extended guardpoint, that's why. I guess that's a problem we forgot to address...

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

On 20 Aug 2019, at 16:14, Peter Burgess <pete.soundtechnician@gmail.com> wrote:

It returns the correct size when table length is 6, but not 5

On Tue, Aug 20, 2019 at 3:56 PM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
That sounds like a bug. From 6.0 we do not need to use negative numbers for sizes and ftlen should return the correct size.

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

On 20 Aug 2019, at 15:28, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Use a negative number for the length. Also use a negative value for the gen type if you don't want normalisation

gifTable ftgen 0,0, -5, -2, 40,43,45,48,52

instr 1

ilen ftlen gifTable

printf "ilen: %d\n", 1, ilen

ftprint gifTable

turnoff

endin


It would be nice to have an opcode without all these idiosyncracies. Something like

gitabnum ftgen2 0, 5, 2, ...

(without the delay and all values positive)

On 20.08.19 16:19, Peter Burgess wrote:
How do I aquire the real length of a function table?

I have an ftable declared as size 5 using gen 2, with 5 values specified in the declaration like so:

gifTable ftgen 0,0,5,  2,  40,43,45,48,52

I can't find a table length opcode that gives the correct length...

'tableng' and 'ftlen' return 4, presumably because they're assuming it's a power of 2 size table with a guard point, even though 'tableng' claims not to know if it has a guard point...

'nsamp' returns 0, for reasons I do not know...

How do I return he true value length of 5?
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

Date2019-08-20 16:19
FromPeter Burgess
SubjectRe: [Csnd] The real length of a table
Fair enough. That is true of ftlen and tableng (I'm not sure if there's supposed to be a functional difference)

On Tue, Aug 20, 2019 at 4:17 PM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
Ah, because 5 is 4 with an extended guardpoint, that's why. I guess that's a problem we forgot to address...

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

On 20 Aug 2019, at 16:14, Peter Burgess <pete.soundtechnician@gmail.com> wrote:

It returns the correct size when table length is 6, but not 5

On Tue, Aug 20, 2019 at 3:56 PM Victor Lazzarini <Victor.Lazzarini@mu.ie> wrote:
That sounds like a bug. From 6.0 we do not need to use negative numbers for sizes and ftlen should return the correct size.

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

On 20 Aug 2019, at 15:28, Eduardo Moguillansky <eduardo.moguillansky@gmail.com> wrote:

Use a negative number for the length. Also use a negative value for the gen type if you don't want normalisation

gifTable ftgen 0,0, -5, -2, 40,43,45,48,52

instr 1

ilen ftlen gifTable

printf "ilen: %d\n", 1, ilen

ftprint gifTable

turnoff

endin


It would be nice to have an opcode without all these idiosyncracies. Something like

gitabnum ftgen2 0, 5, 2, ...

(without the delay and all values positive)

On 20.08.19 16:19, Peter Burgess wrote:
How do I aquire the real length of a function table?

I have an ftable declared as size 5 using gen 2, with 5 values specified in the declaration like so:

gifTable ftgen 0,0,5,  2,  40,43,45,48,52

I can't find a table length opcode that gives the correct length...

'tableng' and 'ftlen' return 4, presumably because they're assuming it's a power of 2 size table with a guard point, even though 'tableng' claims not to know if it has a guard point...

'nsamp' returns 0, for reasons I do not know...

How do I return he true value length of 5?
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


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