Csound Csound-dev Csound-tekno Search About

+ and - sizes in function tables

Date2017-02-15 23:11
Fromjoachim heintz
Subject+ and - sizes in function tables
when i assign a size of 11 to a function table, ftlen() returns a size 
of 10, and the value in index 10 repeats the value in index 9.

when i assign a size of -11, ftlen() returns a size of 11 and the value 
in index 10 returns the "real" value of this index.

is this difference between positive and negative size meant to be like 
this (guard point), or is it a bug?

i looked in the manual for ftgen, but could not find any information 
about it.

below is a simple example.

cheers -
	joachim


instr 1
  /* size = 11: ftlen reports length 10, index 10 returns 10 (instead of 
11) */
  ift1 ftgen 0, 0, 11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
  print ftlen(ift1)
  print table:i(10,ift1)
  /* size = -11: ftlen reports length 11, index 10 returns 11 */
  ift2 ftgen 0, 0, -11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
  print ftlen(ift2)
  print table:i(10,ift2)
endin
schedule(1,0,0)

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

Date2017-02-16 18:22
Fromjpff
SubjectRe: + and - sizes in function tables
indeed relates t guad poit.  it masks the provided flen with -2, canging 
11 t 10

No time now to investigate futer, but looks like it is expecting a power 
of 2
==John

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

Date2017-02-23 14:24
Fromjoachim heintz
SubjectRe: + and - sizes in function tables
thanks for having a look.

do you want me to file a ticket on github?  or is this expected 
behaviour, and anywhere documented?

	joachim


On 16/02/17 19:22, jpff wrote:
> indeed relates t guad poit.  it masks the provided flen with -2, canging
> 11 t 10
>
> No time now to investigate futer, but looks like it is expecting a power
> of 2
> ==John
>
> 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

Date2017-02-23 14:30
FromJohn ff
SubjectRe: + and - sizes in function tables
File an issue.  I think I have a fix but I forgot about.

Sent from TypeApp
On 23 Feb 2017, at 14:25, joachim heintz <jh@JOACHIMHEINTZ.DE> wrote:
thanks for having a look.

do you want me to file a ticket on github? or is this expected
behaviour, and anywhere documented?

joachim


On 16/02/17 19:22, jpff wrote:
indeed relates t guad poit. it masks the provided flen with -2, canging
11 t 10

No time now to investigate futer, but looks like it is expecting a power
of 2
==John

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

Date2017-02-23 15:34
Fromjpff
SubjectRe: + and - sizes in function tables
Really this is user error.  The manual for Gen2 states length "Must be a 
power of 2 or a power-of-2 plus 1" and the code is enforcing this badly.

Not sure what can be done except checking each gen/size against this test


On Thu, 23 Feb 2017, joachim heintz wrote:

> thanks for having a look.
>
> do you want me to file a ticket on github?  or is this expected behaviour, 
> and anywhere documented?
>
> 	joachim
>
>
> On 16/02/17 19:22, jpff wrote:
>> indeed relates t guad poit.  it masks the provided flen with -2, canging
>> 11 t 10
>> 
>> No time now to investigate futer, but looks like it is expecting a power
>> of 2
>> ==John
>> 
>> 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

Date2017-02-23 16:04
Fromjpff
SubjectRe: + and - sizes in function tables
I have code tat cheks non-powerof2 ad treats it asif negative.  Fixs your 
example but might disturb other code.  Let us ty it for a wile
==John ff

On Thu, 23 Feb 2017, jpff wrote:

> Really this is user error.  The manual for Gen2 states length "Must be a 
> power of 2 or a power-of-2 plus 1" and the code is enforcing this badly.
>
> Not sure what can be done except checking each gen/size against this test
>
>
> On Thu, 23 Feb 2017, joachim heintz wrote:
>
>> thanks for having a look.
>> 
>> do you want me to file a ticket on github?  or is this expected behaviour, 
>> and anywhere documented?
>>
>> 	joachim
>> 
>> 
>> On 16/02/17 19:22, jpff wrote:
>>> indeed relates t guad poit.  it masks the provided flen with -2, canging
>>> 11 t 10
>>> 
>>> No time now to investigate futer, but looks like it is expecting a power
>>> of 2
>>> ==John
>>> 
>>> 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

Date2017-02-23 21:13
Fromjoachim heintz
SubjectRe: + and - sizes in function tables
yes it works now, thanks.

but i don't understand what you wrote in the previous email:
"Really this is user error.  The manual for Gen2 states length "Must be 
a power of 2 or a power-of-2 plus 1" and the code is enforcing this badly."

i think the statement in the manual is not any more valid since a long 
time?  shouldn't it be removed?

i used to write negative sizes if it wasn't a power of two.  then — i 
think it was while working on the csound book — victor mentioned that 
the negative sign is no longer necessary, that's how i came across this 
little oddity.

cheers -
	joachim


On 23/02/17 17:04, jpff wrote:
> I have code tat cheks non-powerof2 ad treats it asif negative.  Fixs
> your example but might disturb other code.  Let us ty it for a wile
> ==John ff
>
> On Thu, 23 Feb 2017, jpff wrote:
>
>> Really this is user error.  The manual for Gen2 states length "Must be
>> a power of 2 or a power-of-2 plus 1" and the code is enforcing this
>> badly.
>>
>> Not sure what can be done except checking each gen/size against this test
>>
>>
>> On Thu, 23 Feb 2017, joachim heintz wrote:
>>
>>> thanks for having a look.
>>>
>>> do you want me to file a ticket on github?  or is this expected
>>> behaviour, and anywhere documented?
>>>
>>>     joachim
>>>
>>>
>>> On 16/02/17 19:22, jpff wrote:
>>>> indeed relates t guad poit.  it masks the provided flen with -2,
>>>> canging
>>>> 11 t 10
>>>>
>>>> No time now to investigate futer, but looks like it is expecting a
>>>> power
>>>> of 2
>>>> ==John
>>>>
>>>> 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

Date2017-02-23 21:37
FromVictor Lazzarini
SubjectRe: + and - sizes in function tables
The negative sign shouldn't be needed anymore since 6.00. Are we reintroducing it?

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

> On 23 Feb 2017, at 21:14, joachim heintz  wrote:
> 
> yes it works now, thanks.
> 
> but i don't understand what you wrote in the previous email:
> "Really this is user error.  The manual for Gen2 states length "Must be a power of 2 or a power-of-2 plus 1" and the code is enforcing this badly."
> 
> i think the statement in the manual is not any more valid since a long time?  shouldn't it be removed?
> 
> i used to write negative sizes if it wasn't a power of two.  then — i think it was while working on the csound book — victor mentioned that the negative sign is no longer necessary, that's how i came across this little oddity.
> 
> cheers -
>    joachim
> 
> 
>> On 23/02/17 17:04, jpff wrote:
>> I have code tat cheks non-powerof2 ad treats it asif negative.  Fixs
>> your example but might disturb other code.  Let us ty it for a wile
>> ==John ff
>> 
>>> On Thu, 23 Feb 2017, jpff wrote:
>>> 
>>> Really this is user error.  The manual for Gen2 states length "Must be
>>> a power of 2 or a power-of-2 plus 1" and the code is enforcing this
>>> badly.
>>> 
>>> Not sure what can be done except checking each gen/size against this test
>>> 
>>> 
>>>> On Thu, 23 Feb 2017, joachim heintz wrote:
>>>> 
>>>> thanks for having a look.
>>>> 
>>>> do you want me to file a ticket on github?  or is this expected
>>>> behaviour, and anywhere documented?
>>>> 
>>>>    joachim
>>>> 
>>>> 
>>>>> On 16/02/17 19:22, jpff wrote:
>>>>> indeed relates t guad poit.  it masks the provided flen with -2,
>>>>> canging
>>>>> 11 t 10
>>>>> 
>>>>> No time now to investigate futer, but looks like it is expecting a
>>>>> power
>>>>> of 2
>>>>> ==John
>>>>> 
>>>>> 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

Date2017-02-24 06:23
Fromjoachim heintz
SubjectRe: + and - sizes in function tables
it gave another result for size=11 and size=-11 before john's change. 
here is the example again:

instr 1
  /* size = 11: ftlen reports length 10, index 10 returns 10 (instead of 
11) */
  ift1 ftgen 0, 0, 11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
  print ftlen(ift1)
  print table:i(10,ift1)
  /* size = -11: ftlen reports length 11, index 10 returns 11 */
  ift2 ftgen 0, 0, -11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
  print ftlen(ift2)
  print table:i(10,ift2)
endin
schedule(1,0,0)

it works now with recent code, but before the result was different.

	joachim


On 23/02/17 22:37, Victor Lazzarini wrote:
> The negative sign shouldn't be needed anymore since 6.00. Are we reintroducing it?
>
> Victor Lazzarini
> Dean of Arts, Celtic Studies, and Philosophy
> Maynooth University
> Ireland
>
>> On 23 Feb 2017, at 21:14, joachim heintz  wrote:
>>
>> yes it works now, thanks.
>>
>> but i don't understand what you wrote in the previous email:
>> "Really this is user error.  The manual for Gen2 states length "Must be a power of 2 or a power-of-2 plus 1" and the code is enforcing this badly."
>>
>> i think the statement in the manual is not any more valid since a long time?  shouldn't it be removed?
>>
>> i used to write negative sizes if it wasn't a power of two.  then — i think it was while working on the csound book — victor mentioned that the negative sign is no longer necessary, that's how i came across this little oddity.
>>
>> cheers -
>>    joachim
>>
>>
>>> On 23/02/17 17:04, jpff wrote:
>>> I have code tat cheks non-powerof2 ad treats it asif negative.  Fixs
>>> your example but might disturb other code.  Let us ty it for a wile
>>> ==John ff
>>>
>>>> On Thu, 23 Feb 2017, jpff wrote:
>>>>
>>>> Really this is user error.  The manual for Gen2 states length "Must be
>>>> a power of 2 or a power-of-2 plus 1" and the code is enforcing this
>>>> badly.
>>>>
>>>> Not sure what can be done except checking each gen/size against this test
>>>>
>>>>
>>>>> On Thu, 23 Feb 2017, joachim heintz wrote:
>>>>>
>>>>> thanks for having a look.
>>>>>
>>>>> do you want me to file a ticket on github?  or is this expected
>>>>> behaviour, and anywhere documented?
>>>>>
>>>>>    joachim
>>>>>
>>>>>
>>>>>> On 16/02/17 19:22, jpff wrote:
>>>>>> indeed relates t guad poit.  it masks the provided flen with -2,
>>>>>> canging
>>>>>> 11 t 10
>>>>>>
>>>>>> No time now to investigate futer, but looks like it is expecting a
>>>>>> power
>>>>>> of 2
>>>>>> ==John
>>>>>>
>>>>>> 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
>

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

Date2017-02-24 16:18
Fromjpff
SubjectRe: + and - sizes in function tables
Te code sset the table length based on a power of 2 model.  I did not 
change use of negative size at all, nut checked for 2^n or 2^n+1 and 
treated failures as f tey were negative.  I tink tat is better than what 
was there -- size 11 is odd so length trucated to 10.

On Fri, 24 Feb 2017, joachim heintz wrote:

> it gave another result for size=11 and size=-11 before john's change. here is 
> the example again:
>
> instr 1
> /* size = 11: ftlen reports length 10, index 10 returns 10 (instead of 11) 
> */
> ift1 ftgen 0, 0, 11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
> print ftlen(ift1)
> print table:i(10,ift1)
> /* size = -11: ftlen reports length 11, index 10 returns 11 */
> ift2 ftgen 0, 0, -11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
> print ftlen(ift2)
> print table:i(10,ift2)
> endin
> schedule(1,0,0)
>
> it works now with recent code, but before the result was different.
>
> 	joachim
>
>
> On 23/02/17 22:37, Victor Lazzarini wrote:
>> The negative sign shouldn't be needed anymore since 6.00. Are we 
>> reintroducing it?
>> 
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>> 
>>> On 23 Feb 2017, at 21:14, joachim heintz  wrote:
>>> 
>>> yes it works now, thanks.
>>> 
>>> but i don't understand what you wrote in the previous email:
>>> "Really this is user error.  The manual for Gen2 states length "Must be a 
>>> power of 2 or a power-of-2 plus 1" and the code is enforcing this badly."
>>> 
>>> i think the statement in the manual is not any more valid since a long 
>>> time?  shouldn't it be removed?
>>> 
>>> i used to write negative sizes if it wasn't a power of two.  then — i 
>>> think it was while working on the csound book — victor mentioned that the 
>>> negative sign is no longer necessary, that's how i came across this little 
>>> oddity.
>>> 
>>> cheers -
>>>    joachim
>>> 
>>> 
>>>> On 23/02/17 17:04, jpff wrote:
>>>> I have code tat cheks non-powerof2 ad treats it asif negative.  Fixs
>>>> your example but might disturb other code.  Let us ty it for a wile
>>>> ==John ff
>>>> 
>>>>> On Thu, 23 Feb 2017, jpff wrote:
>>>>> 
>>>>> Really this is user error.  The manual for Gen2 states length "Must be
>>>>> a power of 2 or a power-of-2 plus 1" and the code is enforcing this
>>>>> badly.
>>>>> 
>>>>> Not sure what can be done except checking each gen/size against this 
>>>>> test
>>>>> 
>>>>> 
>>>>>> On Thu, 23 Feb 2017, joachim heintz wrote:
>>>>>> 
>>>>>> thanks for having a look.
>>>>>> 
>>>>>> do you want me to file a ticket on github?  or is this expected
>>>>>> behaviour, and anywhere documented?
>>>>>>
>>>>>>    joachim
>>>>>> 
>>>>>> 
>>>>>>> On 16/02/17 19:22, jpff wrote:
>>>>>>> indeed relates t guad poit.  it masks the provided flen with -2,
>>>>>>> canging
>>>>>>> 11 t 10
>>>>>>> 
>>>>>>> No time now to investigate futer, but looks like it is expecting a
>>>>>>> power
>>>>>>> of 2
>>>>>>> ==John
>>>>>>> 
>>>>>>> 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
>> 
>
> 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

Date2017-02-24 16:48
FromRory Walsh
SubjectRe: + and - sizes in function tables
I thought the need for power of 2 table sizes was removed a long time back? 

On 24 February 2017 at 16:18, jpff <jpff@codemist.co.uk> wrote:
Te code sset the table length based on a power of 2 model.  I did not change use of negative size at all, nut checked for 2^n or 2^n+1 and treated failures as f tey were negative.  I tink tat is better than what was there -- size 11 is odd so length trucated to 10.

On Fri, 24 Feb 2017, joachim heintz wrote:

it gave another result for size=11 and size=-11 before john's change. here is the example again:

instr 1
/* size = 11: ftlen reports length 10, index 10 returns 10 (instead of 11) */
ift1 ftgen 0, 0, 11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
print ftlen(ift1)
print table:i(10,ift1)
/* size = -11: ftlen reports length 11, index 10 returns 11 */
ift2 ftgen 0, 0, -11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
print ftlen(ift2)
print table:i(10,ift2)
endin
schedule(1,0,0)

it works now with recent code, but before the result was different.

        joachim


On 23/02/17 22:37, Victor Lazzarini wrote:
The negative sign shouldn't be needed anymore since 6.00. Are we reintroducing it?

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

On 23 Feb 2017, at 21:14, joachim heintz <jh@JOACHIMHEINTZ.DE> wrote:

yes it works now, thanks.

but i don't understand what you wrote in the previous email:
"Really this is user error.  The manual for Gen2 states length "Must be a power of 2 or a power-of-2 plus 1" and the code is enforcing this badly."

i think the statement in the manual is not any more valid since a long time?  shouldn't it be removed?

i used to write negative sizes if it wasn't a power of two.  then — i think it was while working on the csound book — victor mentioned that the negative sign is no longer necessary, that's how i came across this little oddity.

cheers -
   joachim


On 23/02/17 17:04, jpff wrote:
I have code tat cheks non-powerof2 ad treats it asif negative.  Fixs
your example but might disturb other code.  Let us ty it for a wile
==John ff

On Thu, 23 Feb 2017, jpff wrote:

Really this is user error.  The manual for Gen2 states length "Must be
a power of 2 or a power-of-2 plus 1" and the code is enforcing this
badly.

Not sure what can be done except checking each gen/size against this test


On Thu, 23 Feb 2017, joachim heintz wrote:

thanks for having a look.

do you want me to file a ticket on github?  or is this expected
behaviour, and anywhere documented?

   joachim


On 16/02/17 19:22, jpff wrote:
indeed relates t guad poit.  it masks the provided flen with -2,
canging
11 t 10

No time now to investigate futer, but looks like it is expecting a
power
of 2
==John

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


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

Date2017-02-24 17:07
FromJohn ff
SubjectRe: + and - sizes in function tables
But not in the code for ftlen internally

Sent from TypeApp
On 24 Feb 2017, at 16:49, Rory Walsh <rorywalsh@EAR.IE> wrote:
I thought the need for power of 2 table sizes was removed a long time back? 

On 24 February 2017 at 16:18, jpff <jpff@codemist.co.uk> wrote:
Te code sset the table length based on a power of 2 model.  I did not change use of negative size at all, nut checked for 2^n or 2^n+1 and treated failures as f tey were negative.  I tink tat is better than what was there -- size 11 is odd so length trucated to 10.

On Fri, 24 Feb 2017, joachim heintz wrote:

it gave another result for size=11 and size=-11 before john's change. here is the example again:

instr 1
/* size = 11: ftlen reports length 10, index 10 returns 10 (instead of 11) */
ift1 ftgen 0, 0, 11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
print ftlen(ift1)
print table:i(10,ift1)
/* size = -11: ftlen reports length 11, index 10 returns 11 */
ift2 ftgen 0, 0, -11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
print ftlen(ift2)
print table:i(10,ift2)
endin
schedule(1,0,0)

it works now with recent code, but before the result was different.

        joachim


On 23/02/17 22:37, Victor Lazzarini wrote:
The negative sign shouldn't be needed anymore since 6.00. Are we reintroducing it?

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

On 23 Feb 2017, at 21:14, joachim heintz <jh@JOACHIMHEINTZ.DE> wrote:

yes it works now, thanks.

but i don't understand what you wrote in the previous email:
"Really this is user error.  The manual for Gen2 states length "Must be a power of 2 or a power-of-2 plus 1" and the code is enforcing this badly."

i think the statement in the manual is not any more valid since a long time?  shouldn't it be removed?

i used to write negative sizes if it wasn't a power of two.  then — i think it was while working on the csound book — victor mentioned that the negative sign is no longer necessary, that's how i came across this little oddity.

cheers -
   joachim


On 23/02/17 17:04, jpff wrote:
I have code tat cheks non-powerof2 ad treats it asif negative.  Fixs
your example but might disturb other code.  Let us ty it for a wile
==John ff

On Thu, 23 Feb 2017, jpff wrote:

Really this is user error.  The manual for Gen2 states length "Must be
a power of 2 or a power-of-2 plus 1" and the code is enforcing this
badly.

Not sure what can be done except checking each gen/size against this test


On Thu, 23 Feb 2017, joachim heintz wrote:

thanks for having a look.

do you want me to file a ticket on github?  or is this expected
behaviour, and anywhere documented?

   joachim


On 16/02/17 19:22, jpff wrote:
indeed relates t guad poit.  it masks the provided flen with -2,
canging
11 t 10

No time now to investigate futer, but looks like it is expecting a
power
of 2
==John

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


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

Date2017-02-24 17:12
FromRory Walsh
SubjectRe: + and - sizes in function tables
Whoops. This is what happens when you gate crash threads!!...

On 24 February 2017 at 17:07, John ff <jpff@codemist.co.uk> wrote:
But not in the code for ftlen internally

Sent from TypeApp
On 24 Feb 2017, at 16:49, Rory Walsh <rorywalsh@EAR.IE> wrote:
I thought the need for power of 2 table sizes was removed a long time back? 

On 24 February 2017 at 16:18, jpff <jpff@codemist.co.uk> wrote:
Te code sset the table length based on a power of 2 model.  I did not change use of negative size at all, nut checked for 2^n or 2^n+1 and treated failures as f tey were negative.  I tink tat is better than what was there -- size 11 is odd so length trucated to 10.

On Fri, 24 Feb 2017, joachim heintz wrote:

it gave another result for size=11 and size=-11 before john's change. here is the example again:

instr 1
/* size = 11: ftlen reports length 10, index 10 returns 10 (instead of 11) */
ift1 ftgen 0, 0, 11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
print ftlen(ift1)
print table:i(10,ift1)
/* size = -11: ftlen reports length 11, index 10 returns 11 */
ift2 ftgen 0, 0, -11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
print ftlen(ift2)
print table:i(10,ift2)
endin
schedule(1,0,0)

it works now with recent code, but before the result was different.

        joachim


On 23/02/17 22:37, Victor Lazzarini wrote:
The negative sign shouldn't be needed anymore since 6.00. Are we reintroducing it?

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

On 23 Feb 2017, at 21:14, joachim heintz <jh@JOACHIMHEINTZ.DE> wrote:

yes it works now, thanks.

but i don't understand what you wrote in the previous email:
"Really this is user error.  The manual for Gen2 states length "Must be a power of 2 or a power-of-2 plus 1" and the code is enforcing this badly."

i think the statement in the manual is not any more valid since a long time?  shouldn't it be removed?

i used to write negative sizes if it wasn't a power of two.  then — i think it was while working on the csound book — victor mentioned that the negative sign is no longer necessary, that's how i came across this little oddity.

cheers -
   joachim


On 23/02/17 17:04, jpff wrote:
I have code tat cheks non-powerof2 ad treats it asif negative.  Fixs
your example but might disturb other code.  Let us ty it for a wile
==John ff

On Thu, 23 Feb 2017, jpff wrote:

Really this is user error.  The manual for Gen2 states length "Must be
a power of 2 or a power-of-2 plus 1" and the code is enforcing this
badly.

Not sure what can be done except checking each gen/size against this test


On Thu, 23 Feb 2017, joachim heintz wrote:

thanks for having a look.

do you want me to file a ticket on github?  or is this expected
behaviour, and anywhere documented?

   joachim


On 16/02/17 19:22, jpff wrote:
indeed relates t guad poit.  it masks the provided flen with -2,
canging
11 t 10

No time now to investigate futer, but looks like it is expecting a
power
of 2
==John

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


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

Date2017-02-24 18:51
FromJohn ff
SubjectRe: + and - sizes in function tables
Not at all!  The code was not doing the aspiration

Sent from TypeApp
On 24 Feb 2017, at 17:14, Rory Walsh <rorywalsh@EAR.IE> wrote:
Whoops. This is what happens when you gate crash threads!!...

On 24 February 2017 at 17:07, John ff <jpff@codemist.co.uk> wrote:
But not in the code for ftlen internally

Sent from TypeApp
On 24 Feb 2017, at 16:49, Rory Walsh <rorywalsh@EAR.IE> wrote:
I thought the need for power of 2 table sizes was removed a long time back? 

On 24 February 2017 at 16:18, jpff <jpff@codemist.co.uk> wrote:
Te code sset the table length based on a power of 2 model.  I did not change use of negative size at all, nut checked for 2^n or 2^n+1 and treated failures as f tey were negative.  I tink tat is better than what was there -- size 11 is odd so length trucated to 10.

On Fri, 24 Feb 2017, joachim heintz wrote:

it gave another result for size=11 and size=-11 before john's change. here is the example again:

instr 1
/* size = 11: ftlen reports length 10, index 10 returns 10 (instead of 11) */
ift1 ftgen 0, 0, 11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
print ftlen(ift1)
print table:i(10,ift1)
/* size = -11: ftlen reports length 11, index 10 returns 11 */
ift2 ftgen 0, 0, -11, -2, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11
print ftlen(ift2)
print table:i(10,ift2)
endin
schedule(1,0,0)

it works now with recent code, but before the result was different.

        joachim


On 23/02/17 22:37, Victor Lazzarini wrote:
The negative sign shouldn't be needed anymore since 6.00. Are we reintroducing it?

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

On 23 Feb 2017, at 21:14, joachim heintz <jh@JOACHIMHEINTZ.DE> wrote:

yes it works now, thanks.

but i don't understand what you wrote in the previous email:
"Really this is user error.  The manual for Gen2 states length "Must be a power of 2 or a power-of-2 plus 1" and the code is enforcing this badly."

i think the statement in the manual is not any more valid since a long time?  shouldn't it be removed?

i used to write negative sizes if it wasn't a power of two.  then — i think it was while working on the csound book — victor mentioned that the negative sign is no longer necessary, that's how i came across this little oddity.

cheers -
   joachim


On 23/02/17 17:04, jpff wrote:
I have code tat cheks non-powerof2 ad treats it asif negative.  Fixs
your example but might disturb other code.  Let us ty it for a wile
==John ff

On Thu, 23 Feb 2017, jpff wrote:

Really this is user error.  The manual for Gen2 states length "Must be
a power of 2 or a power-of-2 plus 1" and the code is enforcing this
badly.

Not sure what can be done except checking each gen/size against this test


On Thu, 23 Feb 2017, joachim heintz wrote:

thanks for having a look.

do you want me to file a ticket on github?  or is this expected
behaviour, and anywhere documented?

   joachim


On 16/02/17 19:22, jpff wrote:
indeed relates t guad poit.  it masks the provided flen with -2,
canging
11 t 10

No time now to investigate futer, but looks like it is expecting a
power
of 2
==John

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


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