Csound Csound-dev Csound-tekno Search About

[Csnd] db opcode (bug?)

Date2011-12-09 23:51
FromPeiman Khosravi
Subject[Csnd] db opcode (bug?)
Hello,

Something funny happening with the db opcode. Values smaller than –90 cause really large negative outputs. Nearly blew out my ears today!  

Thanks

Peiman

<CsoundSynthesizer>

<CsOptions>
-odac -d
</CsOptions>

<CsInstruments>
sr     = 96000
ksmps  = 1
nchnls = 1
0dbfs  = 1

instr 1

iamp = db(-96)

print iamp 

endin

</CsInstruments>

<CsScore>

i1 0 1

</CsScore>

</CsoundSynthesizer> 

Date2011-12-10 10:15
FromTito Latini
SubjectRe: [Csnd] db opcode (bug?)
AttachmentsNone  

Date2011-12-10 12:04
Frompeiman khosravi
SubjectRe: [Csnd] db opcode (bug?)
Thanks Tito,

Sounds like a good plan. Or at the very least there should be an
internal limit to avoid the value form jumping up. Particularly with
an amplitude related opcode this could potentially be dangerous.

Best,

Peiman

On 10 December 2011 10:15, Tito Latini  wrote:
> The optimized `pow2' function (OOps/aops.c:52) fails
> when the input is < -15. With the `db' opcode,
>
>  db(-96) --> -96 * LOG2_10D20 = -15.945255
>
> The simplest solution is to eliminate the optimization.
> There is also a bug with `db' and the new parser (coming soon)
>
> tito
>
> On Fri, Dec 09, 2011 at 11:51:16PM +0000, Peiman Khosravi wrote:
>> Hello,
>>
>> Something funny happening with the db opcode. Values smaller than ­90 cause
>> really large negative outputs. Nearly blew out my ears today!
>>
>> Thanks
>>
>> Peiman
>>
>> 
>>
>> 
>> -odac -d
>> 
>>
>> 
>> sr     = 96000
>> ksmps  = 1
>> nchnls = 1
>> 0dbfs  = 1
>>
>> instr 1
>>
>> iamp = db(-96)
>>
>> print iamp
>>
>> endin
>>
>> 
>>
>> 
>>
>> i1 0 1
>>
>> 
>>
>> 
>>
>>
>>
>> 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"
>


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-12-10 17:49
FromVictor Lazzarini
SubjectRe: [Csnd] db opcode (bug?)
Another idea is to extend the range. 90dB is a bit limited? I've added a couple macros in aops.c to help this.

Victor
On 10 Dec 2011, at 10:15, Tito Latini wrote:

> The optimized `pow2' function (OOps/aops.c:52) fails
> when the input is < -15. With the `db' opcode,
> 
>  db(-96) --> -96 * LOG2_10D20 = -15.945255
> 
> The simplest solution is to eliminate the optimization.
> There is also a bug with `db' and the new parser (coming soon)
> 
> tito
> 
> On Fri, Dec 09, 2011 at 11:51:16PM +0000, Peiman Khosravi wrote:
>> Hello,
>> 
>> Something funny happening with the db opcode. Values smaller than 90 cause
>> really large negative outputs. Nearly blew out my ears today!
>> 
>> Thanks
>> 
>> Peiman
>> 
>> 
>> 
>> 
>> -odac -d
>> 
>> 
>> 
>> sr     = 96000
>> ksmps  = 1
>> nchnls = 1
>> 0dbfs  = 1
>> 
>> instr 1
>> 
>> iamp = db(-96)
>> 
>> print iamp 
>> 
>> endin
>> 
>> 
>> 
>> 
>> 
>> i1 0 1
>> 
>> 
>> 
>> 
>> 
>> 
>> 
>> 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"