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

« back to all changes in this revision

Viewing changes to vlmax.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
typedef struct _vlmax
10
10
{
11
11
    t_object x_obj;
12
 
        float m_c_leak;
13
 
        float m_leak;
14
 
        float *m_max;
 
12
        t_float m_c_leak;
 
13
        t_float m_leak;
 
14
        t_float *m_max;
15
15
        int m_n;
16
16
} t_vlmax;
17
17
 
20
20
{
21
21
        int i;
22
22
        t_atom *ap,*app;
23
 
        float *fp;
24
 
        float m_leak;
25
 
        float m_c_leak;
 
23
        t_float *fp;
 
24
        t_float m_leak;
 
25
        t_float m_c_leak;
26
26
        m_leak=x->m_leak;
27
27
        m_c_leak=x->m_c_leak;
28
28
 
31
31
                int i;
32
32
                if (x->m_max)
33
33
                        freebytes(x->m_max,x->m_n);
34
 
                x->m_max=(float*)getbytes(argc*sizeof(float));
 
34
                x->m_max=(t_float*)getbytes(argc*sizeof(t_float));
35
35
                for(i=0;i<argc;i++)
36
 
                        x->m_max[i]=0.0f;
 
36
                        x->m_max[i]=0.0;
37
37
                x->m_n=argc;
38
38
        }
39
39
 
42
42
        app=ap;
43
43
        for (i = 0; i < argc; i++)
44
44
        {
45
 
                float f=atom_getfloat(argv++);
 
45
                t_float f=atom_getfloat(argv++);
46
46
                *fp =(f > *fp ) ? f : *fp *m_c_leak + f*m_leak;
47
47
                SETFLOAT(app, *fp);
48
48
                app++;
54
54
 
55
55
static void vlmax_setHalfDecay(t_vlmax *x, t_floatarg halfDecayTime)
56
56
{
57
 
        x->m_c_leak=(float)powf(.5,(1.0f/halfDecayTime));
58
 
        x->m_leak=1.0f-x->m_c_leak;
 
57
        x->m_c_leak=(t_float)powf(.5,(1.0/halfDecayTime));
 
58
        x->m_leak=1.0-x->m_c_leak;
59
59
}
60
60
 
61
61
static void *vlmax_new(t_float halfDecayTime)