[Csnd] envelop clicks with sr=96000 Hz
Date | 2007-11-14 23:27 |
From | peiman |
Subject | [Csnd] envelop clicks with sr=96000 Hz |
Hello, Apologies for the double post, can't be sure if the last one was sent properly. I keep getting messages saying that the message is still pending I have just renewed my acount so it should hopefully work now! I am using a single sine oscillator with it's envelop controlled by a second oscillator. At a sample rate of 44100 everything runs fine, but when the rate is changed to 96000 then I get clicks at the end of most notes (and it's not a real-time performance issue since it's the same with render to file). Bellow is the csd. I would very much appreciate any suggestions to unveil the mystery :-) Many Thanks in advance Peiman |
Date | 2007-11-15 11:37 |
From | peiman |
Subject | [Csnd] Re: envelop clicks with sr=96000 Hz |
Thanks Tim :-) ciao! p peiman wrote: > > Hello, > > Apologies for the double post, can't be sure if the last one was sent > properly. I keep getting messages saying that the message is still pending > I have just renewed my acount so it should hopefully work now! > > I am using a single sine oscillator with it's envelop controlled by a > second oscillator. At a sample rate of 44100 everything runs fine, but > when the rate is changed to 96000 then I get clicks at the end of most > notes (and it's not a real-time performance issue since it's the same with > render to file). > > > Bellow is the csd. I would very much appreciate any suggestions to unveil > the mystery :-) > > Many Thanks in advance > > Peiman > > > |
Date | 2007-11-20 01:15 |
From | joachim heintz |
Subject | [Csnd] Re: envelop clicks with sr=96000 Hz |
Attachments | click1a.csd click1b.csd click2a.csd click2b.csd click3a.csd click3b.csd click4a.csd click4b.csd click5a.csd click5b.csd click6a.csd click6b.csd |
Hello Peiman - I checked your example, and found some strange results. Here they are, with new questions: 1. I got the same click as you did, but I think the click is just stronger at sr=96000 (click1a.csd) than at sr=44100 (click1b.csd). When you render your orc with a full-scale amplitude and just two notes with a pause between them, e.g. i1 0 2 i1 3 2 and you take a look in an audio-editor, you can see the discontiuity at the end of the first note. And it's audible, too. 2. I guess, the click arises, because aenv is not zero at the end of the note. So I tried an other way of using a half sine as envelope: f 2 0 65536 9 .5 1 0 Going through this table with oscili and 1/p3: aenv oscili 1, 1/p3, 2 gives the following values for aenv at sr=96000 (click2a.csd): i 1 time 0.00001: 0.00000 i 1 time 1.00000: 0.99998 i 1 time 2.00000: 0.01373 The same instr at sr=44100 (click2b.csd) gives: i 1 time 0.00002: 0.00000 i 1 time 1.00000: 1.00000 i 1 time 2.00000: 0.00363 So this is obviously more exact at sr=44100 than at sr=96000! 3. I tried reading the table with tablei instead of oscili and 1/p3 as frequency: itablen tableng 2 aindx linseg 0, p3, itablen-1; from 0 to 65535 as indices aenv tablei aindx, 2 Results: At sr=96000 (click3a.csd): i 1 time 0.00001: 0.00000 i 1 time 1.00000: 1.00000 i 1 time 2.00000: 0.00531 At sr=44100 (click3b.csd): i 1 time 0.00002: 0.00000 i 1 time 1.00000: 1.00000 i 1 time 2.00000: 0.00265 So again the table is more exactly read at the lower sample rate! 4. But why isn't the table read correctly? Why isn't the last value of aenv zero? I tried aindx linseg 0, p3, itablen instead of aindx linseg 0, p3, itablen-1 (though this should be correct, because the last index ist itablen-1?!). Results: At sr=96000 (click4a.csd): i 1 time 0.00001: 0.00000 i 1 time 1.00000: 1.00000 i 1 time 2.00000: 0.00531 At sr=44100 (click4b.csd): i 1 time 0.00002: 0.00000 i 1 time 1.00000: 1.00000 i 1 time 2.00000: 0.00265 So these are exactly the same results as in 3, though I am going to 65536 as the last index instead of 65535. 5. When I continue increasing the index, I get at aindx linseg 0, p3, itablen+50 (i.e. going to 50 indices more than the table has!) and at sr=96000 (click5a.csd): i 1 time 0.00001: 0.00000 i 1 time 1.00000: 1.00000 i 1 time 2.00000: 0.00488 At sr=44100 (click5b.csd): i 1 time 0.00002: 0.00000 i 1 time 1.00000: 1.00000 i 1 time 2.00000: 0.00029 When I go to itablen+100, finally the values of aenv are zero at time 2.00000. So my questions are: 1. Why leads sr=96000 in all the examples to worse results than sr=44100? 2. Why gives reading the table with oscili and 1/p3 as frequency so inexact results (click2a/b)? 3. Why is reading the table not exact in this way (click3a/b): itablen tableng 2 aindx linseg 0, p3, itablen-1 aenv tablei aindx, 2 But seems to be correct in this way (click6a/b): itablen tableng 2 aindx linseg 0, p3, itablen+100 aenv tablei aindx, 2 ? Best - joachim Am 15.11.2007 um 00:27 schrieb peiman: > > Hello, > > Apologies for the double post, can't be sure if the last one was sent > properly. I keep getting messages saying that the message is still > pending I > have just renewed my acount so it should hopefully work now! > > I am using a single sine oscillator with it's envelop controlled by > a second > oscillator. At a sample rate of 44100 everything runs fine, but > when the > rate is changed to 96000 then I get clicks at the end of most notes > (and > it's not a real-time performance issue since it's the same with > render to > file). > > > Bellow is the csd. I would very much appreciate any suggestions to > unveil > the mystery :-) > > Many Thanks in advance > > Peiman > > > |
Date | 2007-11-20 01:43 |
From | peiman |
Subject | [Csnd] Re: envelop clicks with sr=96000 Hz |
Hi Joachim, Thanks very much for testing this, and the thorough report. It seems very strange indeed. One thing I found also was that if the table is read at k-rate (instead of a-rate) then the clicks disappear, depending on the krate of course (the lower the better it seems!!). So I can confirm that the 96000 Hz is certainly the issue here. I am absolutely baffled, more so because it's such a basic thing: how can it be that no one else has encountered these problems before? I guess 96000 Hz is not such a common sampling rate. It would be great if someone could please take a look at this (I don't know about deep DSP or programing!). Thanks very much Peiman joachim heintz wrote: > > Hello Peiman - > > I checked your example, and found some strange results. Here they > are, with new questions: > > 1. > I got the same click as you did, but I think the click is just > stronger at sr=96000 (click1a.csd) than at sr=44100 (click1b.csd). > When you render your orc with a full-scale amplitude and just two > notes with a pause between them, e.g. > i1 0 2 > i1 3 2 > and you take a look in an audio-editor, you can see the discontiuity > at the end of the first note. And it's audible, too. > > 2. > I guess, the click arises, because aenv is not zero at the end of the > note. So I tried an other way of using a half sine as envelope: > f 2 0 65536 9 .5 1 0 > Going through this table with oscili and 1/p3: > aenv oscili 1, 1/p3, 2 > gives the following values for aenv at sr=96000 (click2a.csd): > i 1 time 0.00001: 0.00000 > i 1 time 1.00000: 0.99998 > i 1 time 2.00000: 0.01373 > The same instr at sr=44100 (click2b.csd) gives: > i 1 time 0.00002: 0.00000 > i 1 time 1.00000: 1.00000 > i 1 time 2.00000: 0.00363 > So this is obviously more exact at sr=44100 than at sr=96000! > > 3. > I tried reading the table with tablei instead of oscili and 1/p3 as > frequency: > itablen tableng 2 > aindx linseg 0, p3, itablen-1; from 0 to 65535 as indices > aenv tablei aindx, 2 > Results: > At sr=96000 (click3a.csd): > i 1 time 0.00001: 0.00000 > i 1 time 1.00000: 1.00000 > i 1 time 2.00000: 0.00531 > At sr=44100 (click3b.csd): > i 1 time 0.00002: 0.00000 > i 1 time 1.00000: 1.00000 > i 1 time 2.00000: 0.00265 > So again the table is more exactly read at the lower sample rate! > > 4. > But why isn't the table read correctly? Why isn't the last value of > aenv zero? I tried > aindx linseg 0, p3, itablen instead of > aindx linseg 0, p3, itablen-1 (though this should be correct, because > the last index ist itablen-1?!). Results: > At sr=96000 (click4a.csd): > i 1 time 0.00001: 0.00000 > i 1 time 1.00000: 1.00000 > i 1 time 2.00000: 0.00531 > At sr=44100 (click4b.csd): > i 1 time 0.00002: 0.00000 > i 1 time 1.00000: 1.00000 > i 1 time 2.00000: 0.00265 > So these are exactly the same results as in 3, though I am going to > 65536 as the last index instead of 65535. > > 5. > When I continue increasing the index, I get at > aindx linseg 0, p3, itablen+50 (i.e. going to 50 indices more than > the table has!) > and at sr=96000 (click5a.csd): > i 1 time 0.00001: 0.00000 > i 1 time 1.00000: 1.00000 > i 1 time 2.00000: 0.00488 > At sr=44100 (click5b.csd): > i 1 time 0.00002: 0.00000 > i 1 time 1.00000: 1.00000 > i 1 time 2.00000: 0.00029 > When I go to itablen+100, finally the values of aenv are zero at time > 2.00000. > > So my questions are: > 1. Why leads sr=96000 in all the examples to worse results than > sr=44100? > 2. Why gives reading the table with oscili and 1/p3 as frequency so > inexact results (click2a/b)? > 3. Why is reading the table not exact in this way (click3a/b): > itablen tableng 2 > aindx linseg 0, p3, itablen-1 > aenv tablei aindx, 2 > But seems to be correct in this way (click6a/b): > itablen tableng 2 > aindx linseg 0, p3, itablen+100 > aenv tablei aindx, 2 > ? > > Best - > > joachim > > > > > > Send bugs reports to this list. > To unsubscribe, send email sympa@lists.bath.ac.uk with body "unsubscribe > csound" > > > > > > > > > > > > > > > > > > > > Am 15.11.2007 um 00:27 schrieb peiman: > >> >> Hello, >> >> Apologies for the double post, can't be sure if the last one was sent >> properly. I keep getting messages saying that the message is still >> pending I >> have just renewed my acount so it should hopefully work now! >> >> I am using a single sine oscillator with it's envelop controlled by >> a second >> oscillator. At a sample rate of 44100 everything runs fine, but >> when the >> rate is changed to 96000 then I get clicks at the end of most notes >> (and >> it's not a real-time performance issue since it's the same with >> render to >> file). >> >> >> Bellow is the csd. I would very much appreciate any suggestions to >> unveil >> the mystery :-) >> >> Many Thanks in advance >> >> Peiman >> >> >> |
Date | 2007-11-20 01:57 |
From | Adam |
Subject | [Csnd] Re: Re: envelop clicks with sr=96000 Hz |
Attachments | None |
Date | 2007-11-20 02:46 |
From | Peiman Khosravi |
Subject | [Csnd] Re: Re: Re: envelop clicks with sr=96000 Hz |
Hi Adam, I think I tried that. But I'll give it another go in the morning and post the result. Thanks Peiman On 20 Nov 2007, at 01:57, Adam wrote: > > It could be you need a power-of-2-plus-1 for your ftable, > when you use the interpolating oscili > > See ftable in the manual. Sorry I haven't got the exact url. > >>>> |
Date | 2007-11-20 12:32 |
From | peiman |
Subject | [Csnd] Re: Re: envelop clicks with sr=96000 Hz |
As I suspected, power of 2 + 1 doesn't make any difference at all. But for some reason using poscil3 instead of oscil or oscili gets rid of the clicks. I know that poscil3 is supposed to be high precision but why do oscil and oscili work at 44100 and not 96000? If this is normal behavior and only poscil3 is precise enough to generate a reliable envelope at higher sample rate then shouldn't this be mentioned in the document? Best Peiman Adam Chennells wrote: > > > It could be you need a power-of-2-plus-1 for your ftable, > when you use the interpolating oscili > > See ftable in the manual. Sorry I haven't got the exact url. > >> >> |
Date | 2007-11-20 14:50 |
From | Victor Lazzarini |
Subject | [Csnd] Re: Re: Re: envelop clicks with sr=96000 Hz |
The difference between poscil and oscil(i) is simple: Oscil et all use integer math to keep track of the table index increment; large tables will reduce the precision in the increment integration and off the top of my head I think so does the SR. But poscil uses double-precision floating point maths and its precision is always that of a double (about 13-4 digits), no matter what size the table is. Victor At 12:32 20/11/2007, you wrote: >As I suspected, power of 2 + 1 doesn't make any difference at all. But for >some reason using poscil3 instead of oscil or oscili gets rid of the clicks. >I know that poscil3 is supposed to be high precision but why do oscil and >oscili work at 44100 and not 96000? If this is normal behavior and only >poscil3 is precise enough to generate a reliable envelope at higher sample >rate then shouldn't this be mentioned in the document? > >Best >Peiman > > >Adam Chennells wrote: > > > > > > It could be you need a power-of-2-plus-1 for your ftable, > > when you use the interpolating oscili > > > > See ftable in the manual. Sorry I haven't got the exact url. > > > >> >> |
Date | 2007-11-20 15:12 |
From | joachim heintz |
Subject | [Csnd] Re: Re: Re: Re: envelop clicks with sr=96000 Hz |
Thanks, Victor - that's the solution. I checked my "cklick2a.csd" with poscil instead of oscili, and it's exact now (no click and correct value of aenv). I thought that the difference you are describing was the difference between oscil and oscili. It's very good to know the qualities of poscil(3) now, and the problems of oscili. Perhaps there could be a hint in the manual page of oscili, and under "see also" a link to poscil and poscil3, too? joachim Am 20.11.2007 um 15:50 schrieb Victor Lazzarini: > The difference between poscil and oscil(i) is simple: Oscil et all > use integer > math to keep track of the table index increment; large tables will > reduce the precision > in the increment integration and off the top of my head I think so > does the SR. > But poscil uses double-precision floating point maths and its > precision is always > that of a double (about 13-4 digits), no matter what size the table > is. > > Victor > > > At 12:32 20/11/2007, you wrote: > >> As I suspected, power of 2 + 1 doesn't make any difference at all. >> But for >> some reason using poscil3 instead of oscil or oscili gets rid of >> the clicks. >> I know that poscil3 is supposed to be high precision but why do >> oscil and >> oscili work at 44100 and not 96000? If this is normal behavior and >> only >> poscil3 is precise enough to generate a reliable envelope at >> higher sample >> rate then shouldn't this be mentioned in the document? >> >> Best >> Peiman >> >> >> Adam Chennells wrote: >> > >> > >> > It could be you need a power-of-2-plus-1 for your ftable, >> > when you use the interpolating oscili >> > >> > See ftable in the manual. Sorry I haven't got the exact url. >> > >> >> >> |
Date | 2007-11-20 15:21 |
From | peiman |
Subject | [Csnd] Re: Re: Re: Re: envelop clicks with sr=96000 Hz |
Yes... Also my thanks Victor for the hint. Best Peiman joachim heintz wrote: > > Thanks, Victor - that's the solution. I checked my "cklick2a.csd" > with poscil instead of oscili, and it's exact now (no click and > correct value of aenv). I thought that the difference you are > describing was the difference between oscil and oscili. It's very > good to know the qualities of poscil(3) now, and the problems of oscili. > Perhaps there could be a hint in the manual page of oscili, and under > "see also" a link to poscil and poscil3, too? > > joachim > > > > Am 20.11.2007 um 15:50 schrieb Victor Lazzarini: > >> The difference between poscil and oscil(i) is simple: Oscil et all >> use integer >> math to keep track of the table index increment; large tables will >> reduce the precision >> in the increment integration and off the top of my head I think so >> does the SR. >> But poscil uses double-precision floating point maths and its >> precision is always >> that of a double (about 13-4 digits), no matter what size the table >> is. >> >> Victor >> >> >> At 12:32 20/11/2007, you wrote: >> >>> As I suspected, power of 2 + 1 doesn't make any difference at all. >>> But for >>> some reason using poscil3 instead of oscil or oscili gets rid of >>> the clicks. >>> I know that poscil3 is supposed to be high precision but why do >>> oscil and >>> oscili work at 44100 and not 96000? If this is normal behavior and >>> only >>> poscil3 is precise enough to generate a reliable envelope at >>> higher sample >>> rate then shouldn't this be mentioned in the document? >>> >>> Best >>> Peiman >>> >>> >>> Adam Chennells wrote: >>> > >>> > >>> > It could be you need a power-of-2-plus-1 for your ftable, >>> > when you use the interpolating oscili >>> > >>> > See ftable in the manual. Sorry I haven't got the exact url. >>> > >>> >> >> |
Date | 2007-11-20 15:28 |
From | Victor Lazzarini |
Subject | [Csnd] Re: Re: Re: Re: Re: envelop clicks with sr=96000 Hz |
Comparing the two on a waveform editor, it looks like the envelope period of the oscili version is slightly longer than 1/2 cycle in p3 secs, so it clicks, because the envelope does not reach 0. This agrees with the fact that the freq precision is lost with long tables (and higher sr). Victor At 15:12 20/11/2007, you wrote: >Thanks, Victor - that's the solution. I checked my "cklick2a.csd" >with poscil instead of oscili, and it's exact now (no click and >correct value of aenv). I thought that the difference you are >describing was the difference between oscil and oscili. It's very >good to know the qualities of poscil(3) now, and the problems of oscili. >Perhaps there could be a hint in the manual page of oscili, and under >"see also" a link to poscil and poscil3, too? > > joachim > > > >Am 20.11.2007 um 15:50 schrieb Victor Lazzarini: > >>The difference between poscil and oscil(i) is simple: Oscil et all >>use integer >>math to keep track of the table index increment; large tables will >>reduce the precision >>in the increment integration and off the top of my head I think so >>does the SR. >>But poscil uses double-precision floating point maths and its >>precision is always >>that of a double (about 13-4 digits), no matter what size the table >>is. >> >>Victor >> >> >>At 12:32 20/11/2007, you wrote: >> >>>As I suspected, power of 2 + 1 doesn't make any difference at all. >>>But for >>>some reason using poscil3 instead of oscil or oscili gets rid of >>>the clicks. >>>I know that poscil3 is supposed to be high precision but why do >>>oscil and >>>oscili work at 44100 and not 96000? If this is normal behavior and >>>only >>>poscil3 is precise enough to generate a reliable envelope at >>>higher sample >>>rate then shouldn't this be mentioned in the document? >>> >>>Best >>>Peiman >>> >>> >>>Adam Chennells wrote: >>> > >>> > >>> > It could be you need a power-of-2-plus-1 for your ftable, >>> > when you use the interpolating oscili >>> > >>> > See ftable in the manual. Sorry I haven't got the exact url. >>> > >>> >> >> |