Skip to content

Commit 79d093d

Browse files
committed
tweak max envelope calculation vs number of active notes
1 parent 992457c commit 79d093d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

shared-module/synthio/__init__.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ void synthio_synth_synthesize(synthio_synth_t *synth, uint8_t **bufptr, uint32_t
6666
const int16_t *waveform = synth->waveform;
6767
uint32_t waveform_length = synth->waveform_length;
6868
if (active_channels) {
69-
int16_t loudness = 0x3fff / (1 + active_channels);
69+
int16_t loudness = 0xffff / (1 + 2 * active_channels);
7070
for (int chan = 0; chan < CIRCUITPY_SYNTHIO_MAX_CHANNELS; chan++) {
7171
if (synth->span.note[chan] == SYNTHIO_SILENCE) {
7272
synth->accum[chan] = 0;

0 commit comments

Comments
 (0)