mirror of
https://github.com/exoticorn/microw8.git
synced 2026-01-20 11:16:42 +01:00
add simple bytebeat example to test first implementation with
This commit is contained in:
10
examples/curlywas/bytebeat.cwa
Normal file
10
examples/curlywas/bytebeat.cwa
Normal file
@@ -0,0 +1,10 @@
|
||||
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 sample = saw & env;
|
||||
sample as f32 / 255 as f32 - 0.5
|
||||
}
|
||||
Reference in New Issue
Block a user