From c9e1d55f082f8ffed93e566532640f2b4e80d768 Mon Sep 17 00:00:00 2001 From: Takamichi Horikawa Date: Sat, 23 Sep 2017 22:38:56 +0900 Subject: libopna: drum: fixed levelmeter --- libopna/opnadrum.c | 1 + 1 file changed, 1 insertion(+) (limited to 'libopna') diff --git a/libopna/opnadrum.c b/libopna/opnadrum.c index c3e8d38..5bb3f56 100644 --- a/libopna/opnadrum.c +++ b/libopna/opnadrum.c @@ -94,6 +94,7 @@ void opna_drum_mix(struct opna_drum *drum, int16_t *buf, int samples) { co *= 15 - (level&7); co >>= 1+(level>>3); unsigned outlevel = co > 0 ? co : -co; + if (!drum->drums[d].left && !drum->drums[d].right) outlevel = 0; if (outlevel > levels[d]) levels[d] = outlevel; if (!(drum->mask & (1u << d))) { if (drum->drums[d].left) lo += co; -- cgit v1.2.3