[chuck-users] dbtopow(), dbtorms(), powtodb(), powtorms() off by 100 db
adamtindale at hotmail.com
Sun May 3 12:28:43 EDT 2009
This is intentional. This is the same convention that Pure Data uses, the reason being is that it is easy to use MIDI velocity numbers to change volume.
Std.dbopow(MIDI_VEL) => mysynth.volume;
Or some similar line of code. It is nice because a MIDI value of 100 means full volume (1.0) and anything above that jacks up the volume if you have a quiet synth or sample loaded.
Remember that decibels are a logarithmic scale that is relative to some value, in this case 1.0.
> From: rdpoor at gmail.com
> To: chuck-users at lists.cs.princeton.edu
> Date: Sun, 3 May 2009 08:28:24 -0700
> Subject: [chuck-users] dbtopow(), dbtorms(), powtodb(), powtorms() off by 100 db
> In chuck 184.108.40.206, the family of db conversion functions appear to be
> broken, or at least have a unconventional interpretation of db -- they
> all seem have an offset of 100 db:
> for example:
> Std.powtodb(1.0) => 100.0 (expected 0.0)
> Std.powtodb(10.0) => 110.0 (expected 10.0)
> Std.dbtopow(0) => 0 (expected 1.0)
> Std.dbtopow(100) => 1.0 (expected 10000000000)
> (Similar comments apply to rmstodb() and dbtorms())
> OTOH they are self-consistent, in that Std.dbtopow(Std.powtodb(x)) ==
> x, so maybe someone thinks that's how they're supposed to behave?
> - Rob
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
Find info faster and easier with Internet Explorer 8.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the chuck-users