rearrange variables in header file
[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 struct KGRP //keygroup
12 {
13 long root; //MIDI root note
14 long high; //highest note
15 long loop;
16 };
17
18 typedef struct
19 {
20 long size; //length of sample data
21 short* buffer; //pointer to sample data
22 } Sample;
23
24 static float scale_midi_to_f(unsigned char data)
25 {
26 return 0.0078f * (float)(data);
27 }
28
29 static unsigned char p_offset(unsigned char i)
30 {
31 return (i - PARAM_OFFSET);
32 }
33
34 #endif