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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>WebGPU Audio</title> | |
</head> | |
<body> | |
<button type="button" id="play">Play</button> | |
<script type="module"> | |
const code = ` |
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
#!/usr/bin/env -S deno run --allow-read --allow-write --allow-run | |
// compeko - pack JavaScript into a self-extracting html+deflate | |
// v2.0.0 | |
// Copyright (c) 2022-2024 0b5vr | |
// SPDX-License-Identifier: MIT | |
// Usage: | |
// - prepare a js code, which will be fed into `eval` |
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
/* | |
* Copyright (c) 2021 - Peter Johan Salomonsen | |
*/ | |
setBPM(85); | |
addInstrument('piano'); | |
addInstrument('string'); | |
addInstrument('drums'); | |
addInstrument('guitar'); |
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
// $ wat2wasm fft.wat | |
// $ node --experimental-modules call-fft-dynamic.js | |
(async function () { | |
{ | |
const res = fetch(new URL("./fft.wasm", import.meta.url).href); | |
const imports = { | |
"./math.js": await import(new URL("./math.js", import.meta.url)) | |
}; | |
const {instance} = await WebAssembly.instantiateStreaming(res, imports); |
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
from ctypes import cast, py_object | |
from google.colab import output | |
def set_var(v_id, value): | |
obj = cast(v_id, py_object).value | |
obj.value = value | |
output.register_callback('set_var', set_var) | |
class Checkbox: |
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
// Pseudo Effect Via XML - Example File | |
// Full Tutorial: https://www.youtube.com/watch?v=pHwBOFZgKcs&t=296s | |
// Edit the PresetEffects.xml for your version of After Effects to add Pseudo Effects. | |
// XML File Location on Windows: | |
// Program Files > Adobe > After Effects (Version) > Support Files | |
// XML File Location on OSX: | |
// Apps > After Effects > Right-click After Effects.app > “Show Contents” > Contents > Resources |
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
// ADPCM decoder implementation based on https://github.com/jwzhangjie/Adpcm_Pcm/blob/master/adpcm.c | |
const indexTable = [ | |
-1, -1, -1, -1, 2, 4, 6, 8, | |
-1, -1, -1, -1, 2, 4, 6, 8 | |
]; | |
const stepSizeTable = [ | |
7, 8, 9, 10, 11, 12, 13, 14, 16, 17, | |
19, 21, 23, 25, 28, 31, 34, 37, 41, 45, |
NewerOlder