[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-dev] UnaryOpUGen with dbamp and ampdb broken for audio-rate?



The definitions are here:

inline float32 sc_ampdb(float32 amp)
{
	return std::log10(amp) * (float32)20.;
}


inline float32 sc_dbamp(float32 db)
{
	return std::pow((float32)10., db * (float32).05);
}




On 19.12.2014, at 14:59, Julian Rohrhuber <julian.rohrhuber@xxxxxxxxxxxxxxxxxx> wrote:

> Here is a general test:
> 
> (
> f = { |operator ... args|
> 	{
> 		var cases;
> 		cases = args.collect { |x|
> 			[
> 				x,
> 				DC.kr(x),
> 				DC.ar(x),
> 				Duty.ar(1, 0, Dseq([x])),
> 			]
> 		};
> 		cases.flop.collect { |x|
> 			var a, b;
> 			#a, b = x;
> 			K2A.ar(a.perform(operator, b))
> 		}
> 	}.loadToFloatArray(0.01, s, { |x| x.clump(4).at(100).postln })
> };
> )
> f.value(\ampdb, 0)
> f.value('+', 5, 4)
> 
> 
> On 19.12.2014, at 13:31, Hanns Holger Rutz <contact@xxxxxxxx> wrote:
> 
>> Signed PGP part
>> So for inputs between -765 and -770, dbamp outputs -nan instead of zero!
>> 
>> play {
>>   DC.ar(-764).dbamp.poll(0, "A");  // 0
>>   DC.ar(-765).dbamp.poll(0, "B");  // -nan
>>   DC.ar(-770).dbamp.poll(0, "C");  // -nan
>>   DC.ar(-771).dbamp.poll(0, "D");  // 0
>>   0.0
>> }
>> 
>> 
>> _______________________________________________
>> sc-dev mailing list
>> 
>> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
>> archive: https://listarc.bham.ac.uk/marchives/sc-dev/
>> search: https://listarc.bham.ac.uk/lists/sc-dev/search/
> 
> 
> _______________________________________________
> sc-dev mailing list
> 
> info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
> archive: https://listarc.bham.ac.uk/marchives/sc-dev/
> search: https://listarc.bham.ac.uk/lists/sc-dev/search/


_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/