Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raulgrell/8463051f57c70eabeeb740d7d4850541 to your computer and use it in GitHub Desktop.
Save raulgrell/8463051f57c70eabeeb740d7d4850541 to your computer and use it in GitHub Desktop.
const AUDIO_BUFFER_SIZE = 4096;
const a: f32 = 0.1;
var beep = []f32 { 0 } ** AUDIO_BUFFER_SIZE;
comptime {
var i: u32 = 0;
@setEvalBranchQuota(4097);
while (i < AUDIO_BUFFER_SIZE) : (i += 1) {
beep[i] = if ((i / 64) % 2 == 1) a else -a;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment