name peg file after TYPE
[software/lv2-mdametapiano.git] / src / mdaPianoCommon.h
1 #ifndef MDA_PIANO_COMMON_H
2 #define MDA_PIANO_COMMON_H
3
4 #define NPARAMS 12 //number of parameters
5 #define NOUTS 2 //number of outputs
6 #define NVOICES 64 //max polyphony
7 #define SUSTAIN 128
8 #define SILENCE 0.0001f //voice choking
9 #define PARAM_OFFSET 3 //offset for param enum
10
11 #ifdef PIANO
12 #define SAMPLES_PER_NOTE 1
13 #define NSAMPLES 15
14 #elif defined EPIANO
15 #define SAMPLES_PER_NOTE 3
16 #define NSAMPLES 33
17 #endif
18
19 struct KGRP //keygroup
20 {
21 long root; //MIDI root note
22 long high; //highest note
23 long loop;
24 };
25
26 typedef struct
27 {
28 long size; //length of sample data
29 short* buffer; //pointer to sample data
30 } Sample;
31
32 inline float scale_midi_to_f(unsigned char data)
33 {
34 return 0.0078f * (float)(data);
35 }
36
37 inline unsigned char p_offset(unsigned char i)
38 {
39 return (i - PARAM_OFFSET);
40 }
41
42 #endif