| perhaps a note should be put into the manual about this.
On 19 November 2010 22:04, Victor Lazzarini wrote:
> I think I know what the matter is. Because of truncating, it's not
> guaranteed that the
> phasor will always provide consecutive indexes for the table writing,
> so it might jump one pos now
> and then, and overwrite as well. It somehow works with pow-of-two and
> there might be numerical reasons
> for this.
>
> I think a simple rounding of the index should take care of this problem:
>
> apos phasor 1/(ilen/sr)
> apos = round(apos*ilen)
> tabw ain, apos, p4
>
> it seems to do the trick.
>
> Victor
> On 19 Nov 2010, at 21:16, Victor Lazzarini wrote:
>
>> yes, I think so. The problem is the phasor, but not with normalised
>> indexing. I can't exactly pinpoint what is going wrong there. It's
>> possible that
>> the phasor is not giving integral indexes and that is causing trouble
>> in truncation.
>> I'll keep looking.
>>
>> Victor
>>
>> On 19 Nov 2010, at 20:40, joachim heintz wrote:
>>
>>> but if you replace the line
>>> apos line 0,(ilen/sr),1
>>> with the line
>>> apos phasor 1/(ftlen(p4)/sr)
>>> then you hear the distorted signal again. so it must have something
>>> to do with the phasor as index, doesn't it?
>>>
>>> joachim
>>>
>>>
>>>
>>>
>>>
>>> Am 19.11.2010 um 20:12 schrieb Victor Lazzarini:
>>>
>>>> No, I don't think that is the problem. I have tested with
>>>> normalised indexes and it appears to be OK. There is something
>>>> funny though, with the way your table-to-file works. See the
>>>> attached CSD, the output is OK and so is the reading,
>>>> but the file that is written from the table has some zero samples
>>>> in it (as before). However, I'm quite sure the table
>>>> is OK (as the output is OK). I'm using normalised indexing.
>>>>
>>>> Victor
>>>>
>>>>
>>>>
>>>>
>>>> On 19 Nov 2010, at 18:27, joachim heintz wrote:
>>>>
>>>>> thanks for having such a quick look, victor. these are good news,
>>>>> and
>>>>> i can confirm that it works if i use raw index values. so this is a
>>>>> way to sail round this problem.
>>>>> should we write a warning in the manual, that imode=1 seems to
>>>>> bring
>>>>> problems? for table instead of tab, the phasor works perfectly.
>>>>>
>>>>> joachim
>>>>>
>>>>>
>>>>> Am 19.11.2010 um 17:39 schrieb Victor Lazzarini:
>>>>>
>>>>>> This seems to be related to the index variable to tabw, rather
>>>>>> than a
>>>>>> bug with it (I checked the code and it
>>>>>> does not appear to have any problems. For instance if you set
>>>>>> ksmps=1
>>>>>> and use this instrument
>>>>>>
>>>>>> instr 1 ;writes values to buffers
>>>>>> prints "Writing to buffer %d!\n", p4
>>>>>> apos init 0
>>>>>> ilen = ftlen(p4)
>>>>>> ain oscils 1, 400, 0
>>>>>> apos = apos + 1
>>>>>> kpos downsamp apos
>>>>>> if kpos >= ilen then ;don't start from the beginning
>>>>>> turnoff
>>>>>> endif
>>>>>> tabw ain, apos, p4
>>>>>> endin
>>>>>>
>>>>>> or even (with any ksmps):
>>>>>>
>>>>>> instr 1 ;writes values to buffers
>>>>>> prints "Writing to buffer %d!\n", p4
>>>>>> ilen = ftlen(p4)
>>>>>> ain oscils 1, 400, 0
>>>>>> apos line 0, ilen/sr, ilen
>>>>>> kpos downsamp apos
>>>>>> if kpos >= ilen then ;don't start from the beginning
>>>>>> turnoff
>>>>>> endif
>>>>>> tabw ain, apos, p4
>>>>>> endin
>>>>>>
>>>>>> then there is no problem. I have not found out exactly why the
>>>>>> phasor
>>>>>> is not doing the job properly,
>>>>>> but I think it might be with the way it calculates the sampling
>>>>>> increment, some rounding problem.
>>>>>>
>>>>>> Victor
>>>>>>
>>>>>> On 19 Nov 2010, at 13:51, Victor Lazzarini wrote:
>>>>>>
>>>>>>> I see the problem, will investigate.
>>>>>>>
>>>>>>> Victor
>>>>>>> On 19 Nov 2010, at 09:36, joachim heintz wrote:
>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> ------------------------------------------------------------------------------
>>>>>>> Beautiful is writing same markup. Internet Explorer 9 supports
>>>>>>> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 &
>>>>>>> L3.
>>>>>>> Spend less time writing and rewriting code and more time
>>>>>>> creating
>>>>>>> great
>>>>>>> experiences on the web. Be a part of the beta today
>>>>>>> http://p.sf.net/sfu/msIE9-sfdev2dev
>>>>>>> _______________________________________________
>>>>>>> Csound-devel mailing list
>>>>>>> Csound-devel@lists.sourceforge.net
>>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>>
>>>>>> ------------------------------------------------------------------------------
>>>>>> Beautiful is writing same markup. Internet Explorer 9 supports
>>>>>> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
>>>>>> Spend less time writing and rewriting code and more time creating
>>>>>> great
>>>>>> experiences on the web. Be a part of the beta today
>>>>>> http://p.sf.net/sfu/msIE9-sfdev2dev
>>>>>> _______________________________________________
>>>>>> Csound-devel mailing list
>>>>>> Csound-devel@lists.sourceforge.net
>>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>>>
>>>>>
>>>>>
>>>>> ------------------------------------------------------------------------------
>>>>> Beautiful is writing same markup. Internet Explorer 9 supports
>>>>> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
>>>>> Spend less time writing and rewriting code and more time creating
>>>>> great
>>>>> experiences on the web. Be a part of the beta today
>>>>> http://p.sf.net/sfu/msIE9-sfdev2dev
>>>>> _______________________________________________
>>>>> Csound-devel mailing list
>>>>> Csound-devel@lists.sourceforge.net
>>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>>
>>>> ------------------------------------------------------------------------------
>>>> Beautiful is writing same markup. Internet Explorer 9 supports
>>>> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
>>>> Spend less time writing and rewriting code and more time creating
>>>> great
>>>> experiences on the web. Be a part of the beta today
>>>> http://p.sf.net/sfu/msIE9-sfdev2dev_______________________________________________
>>>> Csound-devel mailing list
>>>> Csound-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>>
>>> ------------------------------------------------------------------------------
>>> Beautiful is writing same markup. Internet Explorer 9 supports
>>> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
>>> Spend less time writing and rewriting code and more time creating
>>> great
>>> experiences on the web. Be a part of the beta today
>>> http://p.sf.net/sfu/msIE9-sfdev2dev_______________________________________________
>>> Csound-devel mailing list
>>> Csound-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>>
>>
>> ------------------------------------------------------------------------------
>> Beautiful is writing same markup. Internet Explorer 9 supports
>> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
>> Spend less time writing and rewriting code and more time creating
>> great
>> experiences on the web. Be a part of the beta today
>> http://p.sf.net/sfu/msIE9-sfdev2dev
>> _______________________________________________
>> Csound-devel mailing list
>> Csound-devel@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
>
> ------------------------------------------------------------------------------
> Beautiful is writing same markup. Internet Explorer 9 supports
> standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
> Spend less time writing and rewriting code and more time creating great
> experiences on the web. Be a part of the beta today
> http://p.sf.net/sfu/msIE9-sfdev2dev
> _______________________________________________
> Csound-devel mailing list
> Csound-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/csound-devel
>
------------------------------------------------------------------------------
Beautiful is writing same markup. Internet Explorer 9 supports
standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3.
Spend less time writing and rewriting code and more time creating great
experiences on the web. Be a part of the beta today
http://p.sf.net/sfu/msIE9-sfdev2dev
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |