Created
May 6, 2019 04:30
-
-
Save raulgrell/2d7c51132ac69a76fda961623c2cd0f2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const AUDIO_BUFFER_SIZE = 2048; | |
const a: f32 = 0.1; | |
var beep = blk: { | |
var b = []f32 { 0 } ** AUDIO_BUFFER_SIZE; | |
@setEvalBranchQuota(AUDIO_BUFFER_SIZE * 2 + 1); | |
for (b) |*x, i| { | |
x.* = if ((i / 64) % 2 == 1) a else -a; | |
} | |
break :blk b; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment