Luke Cartwright / Mbed 2 deprecated ELEC2645_Project_el18loc_nearlythere

Dependencies:   mbed

Committer:
lukeocarwright
Date:
Fri May 22 20:10:00 2020 +0000
Revision:
19:08862f49cd9e
Parent:
18:204cd747b54a
Child:
21:60f01b17b0a6
ADSR fully working and interfaceable

Who changed what in which revision?

UserRevisionLine numberNew contents of line
lukeocarwright 18:204cd747b54a 1 #ifndef ENVELOPE_H
lukeocarwright 18:204cd747b54a 2 #define ENVELOPE_H
lukeocarwright 18:204cd747b54a 3
lukeocarwright 18:204cd747b54a 4 #include "mbed.h"
lukeocarwright 18:204cd747b54a 5 #include "N5110.h"
lukeocarwright 18:204cd747b54a 6 #include "Gamepad.h"
lukeocarwright 18:204cd747b54a 7
lukeocarwright 18:204cd747b54a 8 /** Envelope class
lukeocarwright 18:204cd747b54a 9 * @author Luke Cartwright, University of Leeds
lukeocarwright 18:204cd747b54a 10 * @brief converts output to env output
lukeocarwright 18:204cd747b54a 11 * @date May 2020
lukeocarwright 18:204cd747b54a 12 */
lukeocarwright 18:204cd747b54a 13
lukeocarwright 18:204cd747b54a 14 class Envelope
lukeocarwright 18:204cd747b54a 15 {
lukeocarwright 18:204cd747b54a 16 public://-----------------------------------------------------------------------
lukeocarwright 18:204cd747b54a 17 //variables
lukeocarwright 18:204cd747b54a 18
lukeocarwright 18:204cd747b54a 19 //methods
lukeocarwright 18:204cd747b54a 20 //Methods
lukeocarwright 18:204cd747b54a 21 //Constructor
lukeocarwright 18:204cd747b54a 22 Envelope();
lukeocarwright 18:204cd747b54a 23
lukeocarwright 18:204cd747b54a 24 //Destructior
lukeocarwright 18:204cd747b54a 25 ~Envelope();
lukeocarwright 18:204cd747b54a 26
lukeocarwright 18:204cd747b54a 27 //Modifies input to envelope
lukeocarwright 18:204cd747b54a 28 uint16_t env_in(int a, int d, int s, int r, int in, bool init);
lukeocarwright 19:08862f49cd9e 29 uint16_t release(int s, int r, int in, bool init);
lukeocarwright 18:204cd747b54a 30
lukeocarwright 18:204cd747b54a 31
lukeocarwright 18:204cd747b54a 32 private://----------------------------------------------------------------------
lukeocarwright 18:204cd747b54a 33 //variables
lukeocarwright 18:204cd747b54a 34 uint16_t out;
lukeocarwright 18:204cd747b54a 35 int samples;
lukeocarwright 18:204cd747b54a 36 //float time;
lukeocarwright 18:204cd747b54a 37 int av; //a volume
lukeocarwright 18:204cd747b54a 38 int dv;
lukeocarwright 18:204cd747b54a 39 int sv;
lukeocarwright 18:204cd747b54a 40 int rv;
lukeocarwright 18:204cd747b54a 41 int a_vec;
lukeocarwright 18:204cd747b54a 42 int d_vec;
lukeocarwright 18:204cd747b54a 43 int r_vec;
lukeocarwright 18:204cd747b54a 44 int at;
lukeocarwright 19:08862f49cd9e 45 int samples_r;
lukeocarwright 18:204cd747b54a 46
lukeocarwright 18:204cd747b54a 47 //methods
lukeocarwright 18:204cd747b54a 48 int a_vector_calc(int av);
lukeocarwright 19:08862f49cd9e 49 int d_vector_calc(int dv, int sv);
lukeocarwright 19:08862f49cd9e 50 int r_vector_calc(int sv, int rv);
lukeocarwright 18:204cd747b54a 51 };
lukeocarwright 18:204cd747b54a 52 #endif