summaryrefslogtreecommitdiffstats
path: root/apps/plugins/midi/midiutil.c
diff options
context:
space:
mode:
authorStepan Moskovchenko <stevenm@rockbox.org>2006-05-03 19:32:22 +0000
committerStepan Moskovchenko <stevenm@rockbox.org>2006-05-03 19:32:22 +0000
commit28b5afd05a075cce1f46e5cc85c7e2caae3fc6ee (patch)
treed7285c0d7afb20145a0a9918b17827ed59a1cc9b /apps/plugins/midi/midiutil.c
parent7f1d21480127c9246d2aa7a329f74fd8754b1e42 (diff)
downloadrockbox-28b5afd05a075cce1f46e5cc85c7e2caae3fc6ee.tar.gz
rockbox-28b5afd05a075cce1f46e5cc85c7e2caae3fc6ee.tar.bz2
rockbox-28b5afd05a075cce1f46e5cc85c7e2caae3fc6ee.zip
Optimize synth code by pre-computing the volume scaling for each note.
Scaling is now calculated once per MIDI event at the most, instead of once per sample. Increase voice ramping speed, increase number of active voices a little. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9870 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/midi/midiutil.c')
-rw-r--r--apps/plugins/midi/midiutil.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/apps/plugins/midi/midiutil.c b/apps/plugins/midi/midiutil.c
index daadae8a4f..08e6dbac65 100644
--- a/apps/plugins/midi/midiutil.c
+++ b/apps/plugins/midi/midiutil.c
@@ -127,6 +127,7 @@ struct SynthObject
int note, vol, ch, isUsed;
int curRate, curOffset, targetOffset;
int curPoint;
+ signed short int volscale;
};
struct SynthObject voices[MAX_VOICES] IBSS_ATTR;