diff options
Diffstat (limited to 'apps/plugins/midi/synth.c')
-rw-r--r-- | apps/plugins/midi/synth.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/plugins/midi/synth.c b/apps/plugins/midi/synth.c index a364889ea0..2b70074158 100644 --- a/apps/plugins/midi/synth.c +++ b/apps/plugins/midi/synth.c | |||
@@ -255,7 +255,6 @@ inline void stopVoice(struct SynthObject * so) | |||
255 | 255 | ||
256 | } | 256 | } |
257 | 257 | ||
258 | |||
259 | signed short int synthVoice(struct SynthObject * so) | 258 | signed short int synthVoice(struct SynthObject * so) |
260 | { | 259 | { |
261 | struct GWaveform * wf; | 260 | struct GWaveform * wf; |
@@ -362,16 +361,21 @@ signed short int synthVoice(struct SynthObject * so) | |||
362 | 361 | ||
363 | if(so->state == STATE_RAMPDOWN) | 362 | if(so->state == STATE_RAMPDOWN) |
364 | { | 363 | { |
365 | so->decay--; | 364 | so->decay-=5; |
366 | if(so->decay == 0) | 365 | if(so->decay < 5) |
367 | so->isUsed=0; | 366 | so->isUsed=0; |
368 | s = (s * so->decay) >> 8; | 367 | s = (s * so->decay) >> 8; |
369 | } | 368 | } |
370 | 369 | ||
371 | return s*((signed short int)so->vol*(signed short int)chVol[so->ch])>>14; | 370 | /* Scaling by channel volume and note volume is done in sequencer.c */ |
371 | /* That saves us some multiplication and pointer operations */ | ||
372 | return s*so->volscale>>14; | ||
372 | } | 373 | } |
373 | 374 | ||
374 | 375 | ||
376 | |||
377 | |||
378 | |||
375 | inline void synthSample(int * mixL, int * mixR) | 379 | inline void synthSample(int * mixL, int * mixR) |
376 | { | 380 | { |
377 | register int dL=0; | 381 | register int dL=0; |