[Csnd] + and - sizes in function tables

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Csnd] + and - sizes in function tables

joachim-3
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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

jpff
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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

joachim-3
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
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

jpff
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 <[hidden email]> 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
[hidden email]
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
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

jpff
In reply to this post by joachim-3
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
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

jpff
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
>>> [hidden email]
>>> 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
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

joachim-3
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
>>>> [hidden email]
>>>> 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
>>> [hidden email]
>>> 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
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

Victor Lazzarini
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 <[hidden email]> 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
>>>>> [hidden email]
>>>>> 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
>>>> [hidden email]
>>>> 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
>>> [hidden email]
>>> 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
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

joachim-3
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 <[hidden email]> 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
>>>>>> [hidden email]
>>>>>> 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
>>>>> [hidden email]
>>>>> 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
>>>> [hidden email]
>>>> 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
>>> [hidden email]
>>> 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
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

jpff
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 <[hidden email]> 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
>>>>>>> [hidden email]
>>>>>>> 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
>>>>>> [hidden email]
>>>>>> 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
>>>>> [hidden email]
>>>>> 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
>>>> [hidden email]
>>>> 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
>>> [hidden email]
>>> 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
>> [hidden email]
>> 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
> [hidden email]
> 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
[hidden email]
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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

rorywalsh
I thought the need for power of 2 table sizes was removed a long time back? 

On 24 February 2017 at 16:18, jpff <[hidden email]> 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 <[hidden email]> 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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

jpff
But not in the code for ftlen internally

Sent from TypeApp
On 24 Feb 2017, at 16:49, Rory Walsh <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

rorywalsh
Whoops. This is what happens when you gate crash threads!!...

On 24 February 2017 at 17:07, John ff <[hidden email]> wrote:
But not in the code for ftlen internally

Sent from TypeApp
On 24 Feb 2017, at 16:49, Rory Walsh <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Csnd] + and - sizes in function tables

jpff
Not at all!  The code was not doing the aspiration

Sent from TypeApp
On 24 Feb 2017, at 17:14, Rory Walsh <[hidden email]> wrote:
Whoops. This is what happens when you gate crash threads!!...

On 24 February 2017 at 17:07, John ff <[hidden email]> wrote:
But not in the code for ftlen internally

Sent from TypeApp
On 24 Feb 2017, at 16:49, Rory Walsh <[hidden email]> 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 <[hidden email]> 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 <[hidden email]> 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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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
[hidden email]
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 [hidden email] 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 [hidden email] 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 [hidden email] 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 [hidden email] 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
Loading...