remove unneeded headers
[software/lv2-mdametapiano.git] / src / mdaPiano.h
1 //See associated .cpp file for copyright and other info
2
3 #ifndef MDA_PIANO_H
4 #define MDA_PIANO_H
5
6 #pragma GCC system_header
7 #include "mdaPianoVoice.h"
8 #include "mdaPiano.peg"
9 #include <lv2synth.hpp>
10
11
12 class mdaPiano : public LV2::Synth<mdaPianoVoice, mdaPiano> {
13 public:
14 mdaPiano(double rate);
15 ~mdaPiano() {
16 for (unsigned char i = 0; i < 15; i++) {
17 free(samples[i].buffer);
18 }
19 free(samples);
20 }
21
22 void load_kgrp(KGRP*);
23 void load_sample(Sample*, const char*);
24
25 unsigned find_free_voice(unsigned char, unsigned char);
26 void handle_midi(uint32_t size, unsigned char* data);
27 void setVolume(float);
28
29
30 private:
31 void update(); //my parameter update
32 void noteOn(uint32_t note, uint32_t velocity);
33
34 float param[NPARAMS];
35 float Fs, iFs;
36
37 ///global internal variables
38 KGRP kgrp[16];
39 mdaPianoVoice *voices[NVOICES];
40 Sample *samples = (Sample*) malloc (15 * sizeof(Sample));
41 uint32_t sustain;
42 };
43
44 #endif