statically declare comb array
[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 free(waves);
17 }
18
19 void load_kgrp(KGRP*);
20 void load_samples(short**);
21
22 unsigned find_free_voice(unsigned char, unsigned char);
23 void handle_midi(uint32_t size, unsigned char* data);
24 void setVolume(float);
25 void setParameter(unsigned char, float);
26
27
28 private:
29 void update(); //my parameter update
30 void noteOn(uint32_t note, uint32_t velocity);
31
32 float param[NPARAMS];
33 float Fs, iFs;
34
35 #define EVENTBUFFER 120
36 #define EVENTS_DONE 99999999
37 uint32_t notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block
38
39 ///global internal variables
40 KGRP kgrp[16];
41 mdaPianoVoice *voices[NVOICES];
42 short *waves;
43 uint32_t sustain;
44 };
45
46 #endif