diff options
author | Takamichi Horikawa <takamichiho@gmail.com> | 2017-09-23 22:38:56 +0900 |
---|---|---|
committer | Takamichi Horikawa <takamichiho@gmail.com> | 2017-09-23 22:38:56 +0900 |
commit | c9e1d55f082f8ffed93e566532640f2b4e80d768 (patch) | |
tree | b0a38df180fbf41e8a106bffb04a8c838c9881af /libopna/opnadrum.c | |
parent | 381b0be21439c85ee5810ff25a4c2f1cc97a3ca0 (diff) |
libopna: drum: fixed levelmeter
Diffstat (limited to 'libopna/opnadrum.c')
-rw-r--r-- | libopna/opnadrum.c | 1 |
1 files changed, 1 insertions, 0 deletions
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; |