Csound Csound-dev Csound-tekno Search About

[Csnd] Different output on table-read out in respect to kr

Date2013-06-09 19:47
FromJan Jacob Hofmann
Subject[Csnd] Different output on table-read out in respect to kr
Dear list,

if I read trough a table using a simple oscil-opcode the result will  
differ according to the kr used if the frequency is pretty low.  
Reading the table with ksmps  = 10 shows an output like expected, the  
tabel is read once during the note. However for ksmps	 =	 1 the table  
is read trough approximately only by 78 %. Have I not yet understood  
something fundamental or are there quite huge rounding errors going on  
in Csound?
A simple test csd to be run with ksmps = 10 once and then with ksmps =  
1 can be found below. Any hints welcome.
All the best,

Jan Jacob






sr	 =	 44100
ksmps	 =	 1
nchnls	 =	 1

instr 1
koscil	oscil	1, 0.01, 1	; reading through table 1
		printk	1, koscil		; printing output every second
endin



f1	0	32768	7	0	32768	1
i1	0	100
e




sound         |         movement          |          object          
|          space
sonic architecture       |        site: http://www.sonicarchitecture.de
spatial electronic composition  |  higher order ambisonic music


Date2013-06-09 20:36
FromVictor Lazzarini
SubjectRe: [Csnd] Different output on table-read out in respect to kr
Not sure what you mean? With ksmps = 1

 i   1 time   100.00000:     0.99805

with ksmps = 10

 i   1 time   100.00000:     0.99969


with ksmps = 100

 i   1 time   100.00000:     0.99997

This is to be expected with oscil/i/3 because they use integer maths for indexing. But it's not that bad in this 
particular example

However, with poscil instead, we get

 i   1 time   100.00000:     0.00743

regardless of the ksmps, because it uses  floating-point indexing.

These results are with Csound 6.

Victor

On 9 Jun 2013, at 19:47, Jan Jacob Hofmann wrote:

> Dear list,
> 
> if I read trough a table using a simple oscil-opcode the result will differ according to the kr used if the frequency is pretty low. Reading the table with ksmps  = 10 shows an output like expected, the tabel is read once during the note. However for ksmps	 =	 1 the table is read trough approximately only by 78 %. Have I not yet understood something fundamental or are there quite huge rounding errors going on in Csound?
> A simple test csd to be run with ksmps = 10 once and then with ksmps = 1 can be found below. Any hints welcome.
> All the best,
> 
> Jan Jacob
> 
> 
> 
> 
> 
> 
> sr	 =	 44100
> ksmps	 =	 1
> nchnls	 =	 1
> 
> instr 1
> koscil	oscil	1, 0.01, 1	; reading through table 1
> 		printk	1, koscil		; printing output every second
> endin
> 
> 
> 
> f1	0	32768	7	0	32768	1
> i1	0	100
> e
> 
> 
> 
> 
> sound         |         movement          |          object         |          space
> sonic architecture       |        site: http://www.sonicarchitecture.de
> spatial electronic composition  |  higher order ambisonic music
> 
> 
> 
> Send bugs reports to the Sourceforge bug tracker
>           https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Date2013-06-09 21:03
FromVictor Lazzarini
SubjectRe: [Csnd] Different output on table-read out in respect to kr
Mind you, the rounding in Csound 5 is what you reported. But I've changed Csound 6 to use a larger range of numbers for the integer maths, and the
results are as I reported.

Also, interestingly Csound 6 here is performing over 4x faster than Csound 5. That's actually a surprise, but it appears to be the case
across the board.

Victor

On 9 Jun 2013, at 20:36, Victor Lazzarini wrote:

> Not sure what you mean? With ksmps = 1
> 
> i   1 time   100.00000:     0.99805
> 
> with ksmps = 10
> 
> i   1 time   100.00000:     0.99969
> 
> 
> with ksmps = 100
> 
> i   1 time   100.00000:     0.99997
> 
> This is to be expected with oscil/i/3 because they use integer maths for indexing. But it's not that bad in this 
> particular example
> 
> However, with poscil instead, we get
> 
> i   1 time   100.00000:     0.00743
> 
> regardless of the ksmps, because it uses  floating-point indexing.
> 
> These results are with Csound 6.
> 
> Victor
> 
> On 9 Jun 2013, at 19:47, Jan Jacob Hofmann wrote:
> 
>> Dear list,
>> 
>> if I read trough a table using a simple oscil-opcode the result will differ according to the kr used if the frequency is pretty low. Reading the table with ksmps  = 10 shows an output like expected, the tabel is read once during the note. However for ksmps	 =	 1 the table is read trough approximately only by 78 %. Have I not yet understood something fundamental or are there quite huge rounding errors going on in Csound?
>> A simple test csd to be run with ksmps = 10 once and then with ksmps = 1 can be found below. Any hints welcome.
>> All the best,
>> 
>> Jan Jacob
>> 
>> 
>> 
>> 
>> 
>> 
>> sr	 =	 44100
>> ksmps	 =	 1
>> nchnls	 =	 1
>> 
>> instr 1
>> koscil	oscil	1, 0.01, 1	; reading through table 1
>> 		printk	1, koscil		; printing output every second
>> endin
>> 
>> 
>> 
>> f1	0	32768	7	0	32768	1
>> i1	0	100
>> e
>> 
>> 
>> 
>> 
>> sound         |         movement          |          object         |          space
>> sonic architecture       |        site: http://www.sonicarchitecture.de
>> spatial electronic composition  |  higher order ambisonic music
>> 
>> 
>> 
>> Send bugs reports to the Sourceforge bug tracker
>>          https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>> 
> 
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
> 
> 
> 
> 
> 
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
> 

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Date2013-06-09 21:55
FromMichael Gogins
SubjectRe: [Csnd] Different output on table-read out in respect to kr
On WIndows 8, I also find Csound 6 is now quite a bit faster than Csound 5, when earlier versions of Csound 6 were slightly slower than Csound 5.

Michael Gogins
Irreducible Productions
http://michaelgogins.tumblr.com
Michael dot Gogins at gmail dot com


On Sun, Jun 9, 2013 at 4:03 PM, Victor Lazzarini <Victor.Lazzarini@nuim.ie> wrote:
Mind you, the rounding in Csound 5 is what you reported. But I've changed Csound 6 to use a larger range of numbers for the integer maths, and the
results are as I reported.

Also, interestingly Csound 6 here is performing over 4x faster than Csound 5. That's actually a surprise, but it appears to be the case
across the board.

Victor

On 9 Jun 2013, at 20:36, Victor Lazzarini wrote:

> Not sure what you mean? With ksmps = 1
>
> i   1 time   100.00000:     0.99805
>
> with ksmps = 10
>
> i   1 time   100.00000:     0.99969
>
>
> with ksmps = 100
>
> i   1 time   100.00000:     0.99997
>
> This is to be expected with oscil/i/3 because they use integer maths for indexing. But it's not that bad in this
> particular example
>
> However, with poscil instead, we get
>
> i   1 time   100.00000:     0.00743
>
> regardless of the ksmps, because it uses  floating-point indexing.
>
> These results are with Csound 6.
>
> Victor
>
> On 9 Jun 2013, at 19:47, Jan Jacob Hofmann wrote:
>
>> Dear list,
>>
>> if I read trough a table using a simple oscil-opcode the result will differ according to the kr used if the frequency is pretty low. Reading the table with ksmps  = 10 shows an output like expected, the tabel is read once during the note. However for ksmps      =       1 the table is read trough approximately only by 78 %. Have I not yet understood something fundamental or are there quite huge rounding errors going on in Csound?
>> A simple test csd to be run with ksmps = 10 once and then with ksmps = 1 can be found below. Any hints welcome.
>> All the best,
>>
>> Jan Jacob
>>
>> <CsoundSynthesizer>
>> <CsOptions>
>> </CsOptions>
>> <CsInstruments>
>>
>> sr    =       44100
>> ksmps         =       1
>> nchnls        =       1
>>
>> instr 1
>> koscil       oscil   1, 0.01, 1      ; reading through table 1
>>              printk  1, koscil               ; printing output every second
>> endin
>>
>> </CsInstruments>
>> <CsScore>
>> f1   0       32768   7       0       32768   1
>> i1   0       100
>> e
>> </CsScore>
>> </CsoundSynthesizer>
>>
>>
>> sound         |         movement          |          object         |          space
>> sonic architecture       |        site: http://www.sonicarchitecture.de
>> spatial electronic composition  |  higher order ambisonic music
>>
>>
>>
>> Send bugs reports to the Sourceforge bug tracker
>>          https://sourceforge.net/tracker/?group_id=81968&atid=564599
>> Discussions of bugs and features can be posted here
>> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>>
>
> Dr Victor Lazzarini
> Senior Lecturer
> Dept. of Music
> NUI Maynooth Ireland
> tel.: +353 1 708 3545
> Victor dot Lazzarini AT nuim dot ie
>
>
>
>
>
> Send bugs reports to the Sourceforge bug tracker
>            https://sourceforge.net/tracker/?group_id=81968&atid=564599
> Discussions of bugs and features can be posted here
> To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"
>

Dr Victor Lazzarini
Senior Lecturer
Dept. of Music
NUI Maynooth Ireland
tel.: +353 1 708 3545
Victor dot Lazzarini AT nuim dot ie





Send bugs reports to the Sourceforge bug tracker
            https://sourceforge.net/tracker/?group_id=81968&atid=564599
Discussions of bugs and features can be posted here
To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe csound"