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