Csound Csound-dev Csound-tekno Search About

Re: [Csnd] table opcodes

Date2018-12-24 11:01
FromAndrea Strappa
SubjectRe: [Csnd] table opcodes
yet from this formula:
itabndx =frac(ipch)*100
whole numbers should come out...

----- Original Message ----- 
From: "Andrea Strappa" 
To: 
Sent: Monday, December 24, 2018 11:48 AM
Subject: Re: [Csnd] table opcodes


yes, in my gen02 example
itabndx =frac(ipch)*100
don't work, it give unexpected results, but
itabndx = round(frac(ipch)*100)
work well.
Maybe it is enough to add a note in the manual.

----- Original Message ----- 
From: "Victor Lazzarini" 
To: 
Sent: Sunday, December 23, 2018 9:36 PM
Subject: Re: [Csnd] table opcodes


But that's surely user error, is it not? If floor is not wanted, then
interpolation is what is
needed. Truncating table lookup uses floor not round.

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

> On 23 Dec 2018, at 20:20, jpff  wrote:
>
> The trouble with floor is rounding error as in the original message of 
> this thread.
>
> At least we should correct the manual and give a warning.
>
>> On Sun, 23 Dec 2018, Victor Lazzarini wrote:
>>
>> yes, I rewrote these for 6 to remove the need for power of two. I think 
>> floor is the correct operation; in any case, if we change it, we will 
>> change behaviour.
>>
>> Victor Lazzarini
>> Dean of Arts, Celtic Studies, and Philosophy
>> Maynooth University
>> Ireland
>>
>>> On 23 Dec 2018, at 20:11, John  wrote:
>>>
>>> More code study shows that if we have a power-of-two table it uses the
>>> fact, but if not resorts to more expensive ways.  So despite the
>>> manual the opcodes are save for any table.  What they do is use floor
>>> operation on the index so small rounding error as in the example in
>>> question give unexpected results.
>>>
>
> 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


---
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus

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

Date2018-12-24 12:18
FromJohn ff
SubjectRe: [Csnd] table opcodes
=frac(ipch)*100 is only an integer if ipch has no part in the thousandths.  Rounding errors are all too easy to get.

⁣Sent from TypeApp ​

On Dec 24, 2018, 11:02, at 11:02, Andrea Strappa  wrote:
>yet from this formula:
>itabndx =frac(ipch)*100
>whole numbers should come out...
>
>----- Original Message ----- 
>From: "Andrea Strappa" 
>To: 
>Sent: Monday, December 24, 2018 11:48 AM
>Subject: Re: [Csnd] table opcodes
>
>
>yes, in my gen02 example
>itabndx =frac(ipch)*100
>don't work, it give unexpected results, but
>itabndx = round(frac(ipch)*100)
>work well.
>Maybe it is enough to add a note in the manual.
>
>----- Original Message ----- 
>From: "Victor Lazzarini" 
>To: 
>Sent: Sunday, December 23, 2018 9:36 PM
>Subject: Re: [Csnd] table opcodes
>
>
>But that's surely user error, is it not? If floor is not wanted, then
>interpolation is what is
>needed. Truncating table lookup uses floor not round.
>
>Victor Lazzarini
>Dean of Arts, Celtic Studies, and Philosophy
>Maynooth University
>Ireland
>
>> On 23 Dec 2018, at 20:20, jpff  wrote:
>>
>> The trouble with floor is rounding error as in the original message
>of 
>> this thread.
>>
>> At least we should correct the manual and give a warning.
>>
>>> On Sun, 23 Dec 2018, Victor Lazzarini wrote:
>>>
>>> yes, I rewrote these for 6 to remove the need for power of two. I
>think 
>>> floor is the correct operation; in any case, if we change it, we
>will 
>>> change behaviour.
>>>
>>> Victor Lazzarini
>>> Dean of Arts, Celtic Studies, and Philosophy
>>> Maynooth University
>>> Ireland
>>>
>>>> On 23 Dec 2018, at 20:11, John  wrote:
>>>>
>>>> More code study shows that if we have a power-of-two table it uses
>the
>>>> fact, but if not resorts to more expensive ways.  So despite the
>>>> manual the opcodes are save for any table.  What they do is use
>floor
>>>> operation on the index so small rounding error as in the example in
>>>> question give unexpected results.
>>>>
>>
>> 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
>
>
>---
>Questa e-mail è stata controllata per individuare virus con Avast
>antivirus.
>https://www.avast.com/antivirus
>
>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