Csound Csound-dev Csound-tekno Search About

[Csnd] quasi-bandlimited sawtooth and pulse waveforms

Date2011-03-27 02:01
Fromkalleaho@mappi.helsinki.fi
Subject[Csnd] quasi-bandlimited sawtooth and pulse waveforms
AttachmentsNone  

Date2011-03-27 08:51
FromVictor Lazzarini
SubjectRe: [Csnd] quasi-bandlimited sawtooth and pulse waveforms
Looks clever.
By what I've seen it appears to boil down to dealing with the  
discontinuity at the waveform reset with a sigmoid,
which is what your integrated sin(x)^n looks like. I seem to be  
getting a similar result using a tanh() function as well.
I wonder if this is yet another variation on BLEP.

Regards

Victor

On 27 Mar 2011, at 02:01, kalleaho@mappi.helsinki.fi wrote:

> Hi,
>
> this might be of interest:
>
> http://www.csounds.com/node/1475
>
> Kalle Aho
>
>
>
>
>
> 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"

Date2011-03-27 13:44
Fromkalleaho@mappi.helsinki.fi
SubjectRe: [Csnd] quasi-bandlimited sawtooth and pulse waveforms
AttachmentsNone  

Date2011-03-27 17:36
FromVictor Lazzarini
SubjectRe: [Csnd] quasi-bandlimited sawtooth and pulse waveforms
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
>
> Quoting "Victor Lazzarini" :
>
>> Looks clever.
>> By what I've seen it appears to boil down to dealing with the  
>> discontinuity at the waveform reset with a sigmoid,
>> which is what your integrated sin(x)^n looks like. I seem to be  
>> getting a similar result using a tanh() function as well.
>> I wonder if this is yet another variation on BLEP.
>>
>> Regards
>>
>> Victor
>>
>> On 27 Mar 2011, at 02:01, kalleaho@mappi.helsinki.fi wrote:
>>
>>> Hi,
>>>
>>> this might be of interest:
>>>
>>> http://www.csounds.com/node/1475
>>>
>>> Kalle Aho
>
>
>
>
> 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"

Date2011-03-27 18:10
Fromkalleaho@mappi.helsinki.fi
SubjectRe: [Csnd] quasi-bandlimited sawtooth and pulse waveforms
AttachmentsNone  

Date2011-03-27 18:43
FromVictor Lazzarini
SubjectRe: [Csnd] quasi-bandlimited sawtooth and pulse waveforms
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"

Date2011-03-27 18:56
Fromkalleaho@mappi.helsinki.fi
SubjectRe: [Csnd] quasi-bandlimited sawtooth and pulse waveforms
AttachmentsNone  

Date2011-03-27 19:10
FromVictor Lazzarini
SubjectRe: [Csnd] quasi-bandlimited sawtooth and pulse waveforms
didn't try. You're welcome to try...
On 27 Mar 2011, at 18:56, kalleaho@mappi.helsinki.fi wrote:

> Ah, OK, I'm sorry I misunderstood! :)
>
> Thanks for the example! Can your tanh()-version do low pass filter  
> sweeps?
>
> Kalle
>
> Quoting "Victor Lazzarini" :
>
>> I meant as an answer to your question regarding tanh() being  
>> infinite: you just need to truncate the tanh() to whatever segment  
>> you need.
>
>
>
>
> 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"

Date2011-03-27 19:25
FromVictor Lazzarini
SubjectRe: [Csnd] quasi-bandlimited sawtooth and pulse waveforms
didn't try. You're welcome to try...
On 27 Mar 2011, at 18:56, kalleaho@mappi.helsinki.fi wrote:

> Ah, OK, I'm sorry I misunderstood! :)
>
> Thanks for the example! Can your tanh()-version do low pass filter  
> sweeps?
>
> Kalle
>
> Quoting "Victor Lazzarini" :
>
>> I meant as an answer to your question regarding tanh() being  
>> infinite: you just need to truncate the tanh() to whatever segment  
>> you need.
>
>
>
>
> 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"

Date2011-03-27 21:22
Fromkalleaho@mappi.helsinki.fi
SubjectRe: [Csnd] quasi-bandlimited sawtooth and pulse waveforms
AttachmentsNone  

Date2011-03-27 22:16
FromVictor Lazzarini
SubjectRe: [Csnd] quasi-bandlimited sawtooth and pulse waveforms
The hyperbolic tangent spectrum is a bit more complicated, yes, but  
still available to analysis. We have discussed it in
a CMJ paper (http://muse.jhu.edu/login?uri=/journals/computer_music_journal/v034/34.1.lazzarini.html 
). A simple
intro to blep is found in this thesis: http://lib.tkk.fi/Dipl/2007/urn009585.pdf 
  (you can also follow the references).

Victor
On 27 Mar 2011, at 21:22, kalleaho@mappi.helsinki.fi wrote:

> OK, I tried: yes, it can! Your insight about sigmoids is true. So we  
> just have to decide which sigmoid to use. The frequency response of  
> a sin^n window is relatively easy to calculate and there is a closed  
> form expression. This might not be so with a truncated tanh() for  
> example.
>
> Where can I read about BLEP? I'd like to know how similar the  
> techniques are.
>
> Kalle
>
> Quoting "Victor Lazzarini" :
>
>> didn't try. You're welcome to try...
>> On 27 Mar 2011, at 18:56, kalleaho@mappi.helsinki.fi wrote:
>>
>>> Ah, OK, I'm sorry I misunderstood! :)
>>>
>>> Thanks for the example! Can your tanh()-version do low pass filter  
>>> sweeps?
>>>
>>> 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"

Date2011-03-28 23:03
Fromkalleaho@mappi.helsinki.fi
SubjectRe: [Csnd] quasi-bandlimited sawtooth and pulse waveforms
AttachmentsNone