Csound Csound-dev Csound-tekno Search About

[Csnd] A remarkable formula

Date2011-03-28 23:54
Fromkalleaho@mappi.helsinki.fi
Subject[Csnd] A remarkable formula
AttachmentsNone  

Date2011-03-29 00:06
FromVictor.Lazzarini@nuim.ie
SubjectRe: [Csnd] A remarkable formula
AttachmentsNone  None  

Date2011-03-29 01:09
Fromkalleaho@mappi.helsinki.fi
SubjectRe: [Csnd] A remarkable formula
AttachmentsNone  

Date2011-03-29 10:31
FromVictor Lazzarini
SubjectRe: [Csnd] A remarkable formula
Shouldn't the tanh be offset in relation to the sawtooth ramp? This  
would place the
transition region of the sigmoid at the sawtooth discontinuity. I  
think it could work better.
In particular, there seems to be a DC component for a < pi
In other words, this :

a1 phasor p4
a1 = 2*a1 - 1
ka = 10
atanh tablei ka*a1, 2, 1, 0.5
kscal tablei ka, 2, 1
asig = (a1 - atanh/kscal)*0dbfs/4


with

f2 0 65537 "tanh" -3.14 +3.14


On 29 Mar 2011, at 01:09, kalleaho@mappi.helsinki.fi wrote:

> And integrating gives parabolic wave
>
> (2*x-1)^2/2-ln(cosh(a*(2*x-1)))/(a*tanh(a))
>
> which can be used to get variable duty cycle triangle waves.
> When the formula for sawtooth is defined so that x goes from -1 to 1  
> it is rather simple
>
> x-tanh(a*x)/tanh(a)
>
> and parabolic wave is then
>
> 1/2*x^2-ln(cosh(a*x))/(a*tanh(a))
>
> Other sigmoids could be used in the place of tanh I guess.
>
> Kalle
>
>
> Quoting Victor.Lazzarini@nuim.ie:
>
>> I don't think so. Interesting.
>>
>> Victor
>>
>> ----- Original Message -----
>> From: kalleaho@mappi.helsinki.fi
>> Date: Monday, March 28, 2011 11:54 pm
>> Subject: [Csnd] A remarkable formula
>> To: csound@lists.bath.ac.uk
>>
>>> Hi,
>>>
>>> I got inspired by Victor's tanh() ideas and found this
>>> remarkable formula
>>>
>>> 2*x-1-tanh(a*(2*x-1))/tanh(a)
>>>
>>> If x is a phasor going from 0 to 1, this gives an approximate
>>> sawtooth
>>> with roughly 2*a harmonics, when a is about 3.5 or greater. Try it!
>>>
>>> Is this known?
>>>
>>> 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,
>> National University of Ireland, Maynooth
>>
>>
>>
>> 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"
>>
>>
>
>
>
>
> 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-29 11:35
Fromkalleaho@mappi.helsinki.fi
SubjectRe: [Csnd] A remarkable formula
AttachmentsNone  

Date2011-03-29 11:57
FromVictor Lazzarini
SubjectRe: [Csnd] A remarkable formula
I meant like in the CSD.

On 29 Mar 2011, at 11:35, kalleaho@mappi.helsinki.fi wrote:

> Like this
>
> http://www.wolframalpha.com/input/?i=1-2*%28%28x-1%29+mod+1%29%2C+tanh%286*x%29%2Ftanh%286%29+from+-1+to+1
>
> ?
>
> Doesn't seem to work
>
> http://www.wolframalpha.com/input/?i=1-2*%28%28x-1%29+mod+1%29%2C+tanh%286*x%29%2Ftanh%286%29+from+-1+to+1
>
> Kalle
>
> Quoting "Victor Lazzarini" :
>
>> Shouldn't the tanh be offset in relation to the sawtooth ramp? This  
>> would place the
>> transition region of the sigmoid at the sawtooth discontinuity. I  
>> think it could work better.
>> In particular, there seems to be a DC component for a < pi
>> In other words, this :
>>
>> a1 phasor p4
>> a1 = 2*a1 - 1
>> ka = 10
>> atanh tablei ka*a1, 2, 1, 0.5
>> kscal tablei ka, 2, 1
>> asig = (a1 - atanh/kscal)*0dbfs/4
>>
>>
>> with
>>
>> f2 0 65537 "tanh" -3.14 +3.14
>>
>>
>> On 29 Mar 2011, at 01:09, kalleaho@mappi.helsinki.fi wrote:
>>
>>> And integrating gives parabolic wave
>>>
>>> (2*x-1)^2/2-ln(cosh(a*(2*x-1)))/(a*tanh(a))
>>>
>>> which can be used to get variable duty cycle triangle waves.
>>> When the formula for sawtooth is defined so that x goes from -1 to  
>>> 1 it is rather simple
>>>
>>> x-tanh(a*x)/tanh(a)
>>>
>>> and parabolic wave is then
>>>
>>> 1/2*x^2-ln(cosh(a*x))/(a*tanh(a))
>>>
>>> Other sigmoids could be used in the place of tanh I guess.
>>>
>>> Kalle
>>>
>>>
>>> Quoting Victor.Lazzarini@nuim.ie:
>>>
>>>> I don't think so. Interesting.
>>>>
>>>> Victor
>>>>
>>>> ----- Original Message -----
>>>> From: kalleaho@mappi.helsinki.fi
>>>> Date: Monday, March 28, 2011 11:54 pm
>>>> Subject: [Csnd] A remarkable formula
>>>> To: csound@lists.bath.ac.uk
>>>>
>>>>> Hi,
>>>>>
>>>>> I got inspired by Victor's tanh() ideas and found this
>>>>> remarkable formula
>>>>>
>>>>> 2*x-1-tanh(a*(2*x-1))/tanh(a)
>>>>>
>>>>> If x is a phasor going from 0 to 1, this gives an approximate
>>>>> sawtooth
>>>>> with roughly 2*a harmonics, when a is about 3.5 or greater. Try  
>>>>> it!
>>>>>
>>>>> Is this known?
>>>>>
>>>>> 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,
>>>> National University of Ireland, Maynooth
>>>>
>>>>
>>>>
>>>> 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"
>>>>
>>>>
>>>
>>>
>>>
>>>
>>> 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"
>>
>>
>>
>
>
>
>
> 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-29 13:13
Fromkalleaho@mappi.helsinki.fi
SubjectRe: [Csnd] A remarkable formula
AttachmentsNone