Keep empty instruments in sample list, to match up with hydrogen layout. NB: this will break existing patterns created against older versions of DrMr that used kits with empty instruments. Sorry about that.

This commit is contained in:
Nick Lanham
2012-02-21 13:16:37 +01:00
parent b3dd5bb1b2
commit 6bb66abca2
2 changed files with 13 additions and 7 deletions

7
drmr.c
View File

@@ -210,10 +210,11 @@ static void run(LV2_Handle instance, uint32_t n_samples) {
// changed after the check that the midi-note is valid
pthread_mutex_lock(&drmr->load_mutex);
if (nn >= 0 && nn < drmr->num_samples) {
if (drmr->samples[nn].layer_count > 0)
if (drmr->samples[nn].layer_count > 0) {
layer_to_sample(drmr->samples+nn,*(drmr->gains[nn]));
if (drmr->samples[nn].limit == 0)
fprintf(stderr,"Failed to find layer at: %i for %f\n",nn,*drmr->gains[nn]);
if (drmr->samples[nn].limit == 0)
fprintf(stderr,"Failed to find layer at: %i for %f\n",nn,*drmr->gains[nn]);
}
drmr->samples[nn].active = 1;
drmr->samples[nn].offset = 0;
}