Crates.io | pokemon-synthesizer |
lib.rs | pokemon-synthesizer |
version | 0.2.0 |
source | src |
created_at | 2023-04-29 09:04:52.305441 |
updated_at | 2023-10-09 18:42:09.333227 |
description | A synthesizer for the sound format of the Pokemon GameBoy games |
homepage | |
repository | https://github.com/LinusU/pokemon-synthesizer |
max_upload_size | |
id | 851937 |
size | 346,044 |
A synthesizer for the sound format of the Pokemon GameBoy games.
Implementation status:
cargo add pokemon-synthesizer
const rom = std::fs::read("pokeyellow.gbc").unwrap();
// Pikachu cry
let pcm = pokemon_synthesizer::gen1::synthesis(&rom, 0x02, 0x40c3, 238, -127);
// 1
pcm.channels()
// 1_048_576
pcm.sample_rate()
// Duration { 987.819672ms }
pcm.total_duration()
// Iterator<Item = f32>
pcm.iter()
In order to run the gen1
tests, you need a ROM file for Pokemon Yellow. The ROM file should have the SHA1 hash cc7d03262ebfaf2f06772c1a480c7d9d5f4a38e1
and be named roms/pokeyellow.gbc
.
In order to run the gen2
tests, you need a ROM file for Pokemon Crystal. The ROM file should have the SHA1 hash f4cd194bdee0d04ca4eac29e09b8e4e9d818c133
and be named roms/pokecrystal.gbc
.
Huge thanks to Retro Game Mechanics Explained for their video on Pokemon cries, and for the accompanying tool. I would not have been able to make this without their help.
Also a big thanks to the pret team for their disassembly of Pokemon Yellow which helped immensely in understanding the sound engine.