summaryrefslogtreecommitdiff
path: root/src/soundfont.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/soundfont.rs')
-rw-r--r--src/soundfont.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/soundfont.rs b/src/soundfont.rs
index a671d1c..4acae12 100644
--- a/src/soundfont.rs
+++ b/src/soundfont.rs
@@ -1265,7 +1265,8 @@ impl SoundFont {
} else {
vel
};
- let amplitude = request.volume * (velnum as f32) * (1.0 / 127.0);
+ let fvel = (velnum as f32) * (1.0 / 127.0);
+ let amplitude = request.volume * fvel * fvel;
let mut startloop = (zone.startloop_offset as i64 + (sample.startloop as i64)) as u64;
if startloop > sample_len as u64 {