first working version with sound

This commit is contained in:
2022-03-04 09:50:10 +01:00
parent 35ec5fdb59
commit 85240599e8
5 changed files with 99 additions and 18 deletions

View File

@@ -1,10 +1,8 @@
include "../include/microw8-api.cwa"
export fn upd() {}
export fn snd(index: i32) -> f32 {
let inline saw = index & 255;
let inline env = (-index #>> 9) & 255;
let inline saw = index;
let inline env = (-index #>> 9);
let inline sample = saw & env;
sample as f32 / 255 as f32 - 0.5
}
(sample & 255) as f32 / 255 as f32 - 0.5
}