~ubuntu-branches/ubuntu/raring/pd-smlib/raring-proposed

« back to all changes in this revision

Viewing changes to vrmstodb.c

  • Committer: Package Import Robot
  • Author(s): Hans-Christoph Steiner
  • Date: 2012-09-25 12:20:08 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20120925122008-jhr5hyl3juh91eyv
Tags: 0.12.2-1
* updated to upstream version v0.12.2
* removed patches since they are in new upstream release
* bumped standards version to 3.9.3

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
    t_object x_obj;
10
10
} t_vrmstodb;
11
11
 
12
 
float rmstodb(float f)
 
12
static t_float rmstodecibel(t_float f)
13
13
{
14
14
    if (f <= 0) return (0);
15
15
    else
16
16
    {
17
 
        float val = (float)(100 + 20./LOGTEN * log(f));
 
17
        t_float val = (t_float)(100 + 20./LOGTEN * log(f));
18
18
        return (val < 0 ? 0 : val);
19
19
    }
20
20
}
28
28
 
29
29
        for (i = 0; i < argc; i++)
30
30
        {
31
 
                SETFLOAT(app, rmstodb(atom_getfloat(argv++)));
 
31
                SETFLOAT(app, rmstodecibel(atom_getfloat(argv++)));
32
32
                app++;
33
33
        }
34
34
        outlet_list(x->x_obj.ob_outlet,gensym("list"),argc,ap);