| I meant as an answer to your question regarding tanh() being infinite:
you just need to truncate the tanh() to whatever segment you need.
sr = 44100
ksmps = 1
nchnls = 2
0dbfs = 1
instr 1
if p5 == 2 then
iscal = 0.5
else
iscal = 1
endif
icps = p4
imainlobezero = 22050
iwindowwidth = 4.5/imainlobezero
icorrect = .5*iwindowwidth*icps
aramp phasor -icps, icorrect
aindex = 1/icps/iwindowwidth*aramp
aread tablei aindex, p5, 1
aout = aread*iscal-aramp+icorrect
adeclick linseg 0, 1/icps, 1, p3-2/icps, 1, 1/icps, 0
outs adeclick*aout, adeclick*aout
dispfft aout, 0.5, 2048
endin
f 1 0 65537 -9 .5 -.59814453125 90 1.5 .11962890625 90 2.5 -.
02392578125 90 3.5 .00244140625 90
f2 0 65537 "tanh" -3.14 +3.14
i 1 0 1 220 1
i 1 + 1 220 2
i 1 + 1 440 1
i 1 + 1 440 2
i 1 + 1 880 1
i 1 + 1 880 2
i 1 + 1 1760 1
i 1 + 1 1760 2
On 27 Mar 2011, at 18:10, kalleaho@mappi.helsinki.fi wrote:
> Victor,
>
> the window is a sine from 0 to pi that is exponentiated. Outside [0,
> pi] there are just copies of the window (some negative if the
> exponent is odd). I don't see how that is truncated. I understand
> "truncating" to mean that you have some non-periodic function like a
> gaussian or tanh() from which you take a finite portion. Of course
> if I just integrate sin^n without DC correction I get rising stairs
> from -inf to inf. What I do instead is this: one period of the
> impulse train is composed of the window and some "dead time" after
> that. The whole thing is DC corrected so that integration gives a
> periodic sawtooth.
>
> Kalle
>
> Quoting "Victor Lazzarini" :
>
>> But you truncate it. If you try something like this:
>>
>> f2 0 65537 "tanh" -3.14 +3.14
>>
>> you will see that it looks very close to your window. You can set
>> the sharpness of the transition by defining tanh() over a longer
>> or shorter interval. To plug this into your code you will need to
>> scale the output of the table reader by 0.5
>>
>> Not sure about BLEP and lp feature.
>>
>> Victor
>>
>> On 27 Mar 2011, at 13:44, kalleaho@mappi.helsinki.fi wrote:
>>
>>> Hi Victor,
>>>
>>> the integrated sin^n window is finite while tanh() is infinite,
>>> how would you make that work? Also, does BLEP have the LPF
>>> feature? (Sorry for my ignorance!)
>>>
>>> thanks,
>>> Kalle
>
>
>
> 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"
|