diff --git a/CHANGELOG.md b/CHANGELOG.md index cf1608c..0e3e3ab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,6 +29,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). x87 stack. ### Fixed +- Modulating delaytime in wasm could crash, because delay time was converted to + int with i32.trunc_f32_u. Using i32.trunc_f32_s fixed this. - When recording notes from VSTI, no track was created for instruments that had no notes triggered, resulting in misalignment of the tracks from instruments. - 32-bit su_load_gmdls clobbered ebx, even though __stdcall demands it to be not diff --git a/vm/compiler/templates/wasm/effects.wat b/vm/compiler/templates/wasm/effects.wat index 82d350d..c492bff 100644 --- a/vm/compiler/templates/wasm/effects.wat +++ b/vm/compiler/templates/wasm/effects.wat @@ -313,7 +313,7 @@ )) {{- end}} {{- if .SupportsModulation "delay" "delaytime"}} - (i32.trunc_f32_u (f32.add + (i32.trunc_f32_s (f32.add (f32.add (local.get $delayTime) (f32.mul @@ -324,7 +324,7 @@ (f32.const 0.5) )) {{- else}} - (i32.trunc_f32_u (f32.add (local.get $delayTime) (f32.const 0.5))) + (i32.trunc_f32_s (f32.add (local.get $delayTime) (f32.const 0.5))) {{- end}} {{- else}} (i32.load16_u