e4cc261eb7f621c506486d2a814b1830d864b8cf
[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 virtual uint32_t processEvents(VstEvents* events);
23
24 virtual void setParameter(uint32_t index, float value);
25
26
27 private:
28 void update(); //my parameter update
29 void noteOn(uint32_t note, uint32_t velocity);
30
31 float param[NPARAMS];
32 float Fs, iFs;
33
34 #define EVENTBUFFER 120
35 #define EVENTS_DONE 99999999
36 uint32_t notes[EVENTBUFFER + 8]; //list of delta|note|velocity for current block
37
38 ///global internal variables
39 KGRP kgrp[16];
40 mdaPianoVoice *voices[NVOICES];
41 uint32_t activevoices, poly, cpos;
42 short *waves;
43 uint32_t cmax;
44 float *comb, cdep, width, trim;
45 uint32_t size, sustain;
46 float tune, fine, random, stretch;
47 float muff, muffvel, sizevel, velsens, volume;
48 };
49
50 #endif