File: synth.h

package info (click to toggle)
zynaddsubfx 3.0.6-7.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 65,848 kB
  • sloc: cpp: 124,436; ansic: 39,936; objc: 2,496; makefile: 1,369; python: 567; sh: 566; ruby: 178; javascript: 50
file content (26 lines) | stat: -rw-r--r-- 452 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef SYNTH_H
#define SYNTH_H

struct Adsr
{
    Adsr(void) :at(0.05),dt(0.05),rt(0.05), av(-1.0), dv(1.0), sv(0.0), rv(-1.0) {}
    float time;
    float relval;
    bool  pgate;

    float at,dt,   rt;
    float av,dv,sv,rv;

    float operator()(bool gate);
    static struct rtosc::Ports ports;
};

struct Synth {
    Adsr amp_env, frq_env;
    float freq;
    bool  gate;

    float sample(void);
    static struct rtosc::Ports ports;
};
#endif