mirror of
https://github.com/iliazeus/punkomatic-js.git
synced 2025-12-15 14:42:29 +00:00
A Punk-O-Matic 2 song data parser and player.
http://iliazeus.lol/punkomatic-js/
| .github/workflows | ||
| data | ||
| dist | ||
| libav.js@e85f2b3d78 | ||
| scripts | ||
| src | ||
| .gitignore | ||
| .gitmodules | ||
| .prettierrc | ||
| LICENSE | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
punkomatic-js
A Punk-O-Matic 2 song data parser and player.
How to use
You'll need the data folder from POM Converter. You can download it from the developer website.
I also host a copy in the repo. These are not mine, but they are publicly available.
All other code and assets are published under the MIT license.
// ESM only
import * as pm from "./punkomatic.browser.js";
const song = pm.parseSong(songData);
const audio = await pm.renderSong(song, { baseSoundPath: "./path-to/samples" });
const file = await pm.encodeSong(song, audio, { compress: true });
// to play or download it in browser:
const url = URL.createObjectUrl(file);
document.querySelector("audio#my-song").src = url;
// to write it to a file in Node.js:
const fs = require("node:fs/promises");
await fs.writeFile("output.wav", new Buffer(await blob.arrayBuffer()));