Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/iliazeus/punkomatic-js
A Punk-O-Matic 2 song data parser and player.
https://github.com/iliazeus/punkomatic-js
punk-o-matic punkomatic typescript web-audio-api
Last synced: about 2 months ago
JSON representation
A Punk-O-Matic 2 song data parser and player.
- Host: GitHub
- URL: https://github.com/iliazeus/punkomatic-js
- Owner: iliazeus
- License: mit
- Created: 2023-01-18T09:55:57.000Z (almost 2 years ago)
- Default Branch: master
- Last Pushed: 2024-04-17T18:26:14.000Z (9 months ago)
- Last Synced: 2024-09-21T11:58:06.204Z (3 months ago)
- Topics: punk-o-matic, punkomatic, typescript, web-audio-api
- Language: TypeScript
- Homepage: https://iliazeus.github.io/punkomatic-js/
- Size: 70 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# punkomatic-js
A [Punk-O-Matic 2] song data parser and player.
[Punk-O-Matic 2]: https://www.evildoggames.com/punk-o-matic-2.html
[Try it out online!](https://iliazeus.github.io/punkomatic-js/)
### 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].
[developer website]: https://www.evildoggames.com/punk-o-matic-2.html
[in the repo]: https://github.com/iliazeus/punkomatic-js/tree/master/data
[MIT license]: https://github.com/iliazeus/punkomatic-js/tree/master/LICENSE```ts
// 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()));
```