summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mdaPiano.cpp2
-rw-r--r--src/mdaPiano.h6
-rw-r--r--src/mdaPianoCommon.h1
3 files changed, 5 insertions, 4 deletions
diff --git a/src/mdaPiano.cpp b/src/mdaPiano.cpp
index 6e3d8e7..837626c 100644
--- a/src/mdaPiano.cpp
+++ b/src/mdaPiano.cpp
@@ -32,7 +32,7 @@ mdaPiano::mdaPiano(double rate)
, "4c.raw", "4e.raw", "4a.raw"
};
- for (unsigned char i=0; i<15; ++i) {
+ for (unsigned char i=0; i<NSAMPLES; ++i) {
load_sample(&samples[i], sample_names[i]);
}
diff --git a/src/mdaPiano.h b/src/mdaPiano.h
index 018dadb..f848919 100644
--- a/src/mdaPiano.h
+++ b/src/mdaPiano.h
@@ -13,16 +13,16 @@ class mdaPiano : public LV2::Synth<mdaPianoVoice, mdaPiano> {
public:
mdaPiano(double);
~mdaPiano() {
- for (unsigned char i = 0; i < 15; i++) {
+ for (unsigned char i = 0; i < NSAMPLES; i++) {
free(samples[i].buffer);
}
free(samples);
}
bool sustain;
- KGRP kgrp[16];
+ KGRP kgrp[NSAMPLES];
mdaPianoVoice *voices[NVOICES];
- Sample *samples = (Sample*) malloc (15 * sizeof(Sample));
+ Sample *samples = (Sample*) malloc (NSAMPLES * sizeof(Sample));
void load_kgrp(KGRP*);
void load_sample(Sample*, const char*);
diff --git a/src/mdaPianoCommon.h b/src/mdaPianoCommon.h
index ce41fbd..8168044 100644
--- a/src/mdaPianoCommon.h
+++ b/src/mdaPianoCommon.h
@@ -8,6 +8,7 @@
#define SILENCE 0.0001f //voice choking
#define PARAM_OFFSET 3 //offset for param enum
#define SAMPLES_PER_NOTE 1
+#define NSAMPLES 15
struct KGRP //keygroup
{