Git Product home page Git Product logo

pokemon-synthesizer's Introduction

Pokemon Synthesizer

A synthesizer for the sound format of the Pokemon GameBoy games.

Implementation status:

  • Gen 1
    • Pulse channels
    • Noise channels
    • Wave channels
    • Finite loops
    • Infinite loops
    • Pitch sweeps
    • Music sequences
  • Gen 2
    • Pulse channels
    • Noise channels
    • Wave channels
    • Finite loops
    • Infinite loops
    • Pitch sweeps
    • Music sequences
  • Future generations

Installation

cargo add pokemon-synthesizer

Usage

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()

Testing

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.

Acknowledgements

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.

pokemon-synthesizer's People

Contributors

linusu avatar

Stargazers

 avatar  avatar Dmitry Iv. avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.