Main Menu
Main Page
Forums
New pages
Recent changes
Random page
Help

Glitches
Arbitrary code execution
Pokémon cloning
Pomeg glitch and Glitzer Popping
Tweaking and voiding
Glitches by generation
Glitch categories

References/Resources
Databases
Disassembly projects
The Big HEX List
Pokémon cheat codes
Pokémon glitch terminology
Useful tools
More

Affiliates
Legendary Star Blob 2 (Hakuda) (日本語/Japanese)
Pokémon Speedruns wiki (English)
PRAMA Initiative (Français/French)
MissingNo. Glitch City (Italiano/Italian)
Become an affiliate!

Technical
Site source code

Search Wiki

 

Search Forums

 

Author Topic: How to make your own Pikachu cries with ACE  (Read 436 times)

0 Members and 1 Guest are viewing this topic.

Princess Torchic Owl Lover ☽ ❤

  • Head Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • Aspiring mother. 🦋 ✿
    • View Profile
How to make your own Pikachu cries with ACE
« on: February 09, 2019, 01:08:55 am »
1) Set up ACE
2) Set up an ACE memory editor
3) Write the following routine at your access point

061C219F7ECD843E3E02EA00401E003E
002100A019191946232A666F0E040D28
05CD641E18F8F3C5E53E80E0263E77E0
24AFE01A2130FF11FCCB7E12133EFF22
7DFE4020F53E80E01AF025F644E0253E
FFE01B3E20E01C3EFFE01D3E87E01EE1
C1CD5001AFEAF3C0EAF4C03E80E026A
FE01A2130FF11FCCB1A13227DFE4020F
83E80E01AF025E6BBE025AFEA2AC0EA2
BC0EA2CC0EA2DC0F0B8FBC9

(This is a modified version of 3C:4000; that plays the first PCM audio at 2:A000 in SRAM)

4) Get a very short music file you want to use as your Pikachu cry (about 1 second long)

5) Use ffmpeg. According to bg321 and pigdevil2010 on Skeetendo, you'll likely need to downgrade your music file to 4-bit uncompressed PCM, 6000hz.

If not familiar, put ffmpeg in the same folder as your music file, open Notepad and write the following;

ffmpeg  -i "[original music filename with extension (e.g. .mp3) here]" -ac 1 -ar 6000 -acodec adpcm_ms [desired filename].wav
pause

(The pause is optional and is in case there are any errors, otherwise the command prompt will exit automatically. Here there is a new line before pause. I'm unsure if it's needed.)

Save this file as crymaker.bat or anything .bat.

Then, run the .bat file (again it will need to be in the same directory as ffmpeg and your music file).

(Note: I wasn't sure exactly how to get the correct file format Game Freak used, but this works)

6) Your new .wav file will probably not work properly on some operating systems, but if everything went to plan it will work when you import it in the game. The file size of the wav file should be quite small. You will need to use a hex editor (such as HxD, it's free) to copy all the bytes after the "data" ANSI string (for my example this is at 0x98). Save this somewhere (e.g. Pastebin if you want)

7) Use ACE to write the following at 2:A000; 02 03 a0 (+two more bytes that represent the hexadecimal file size.  Use Windows Calculator to take away the end of the file offset and e.g. 0x98 on the hex editor, then add 1 to get the file size. Then swap the digits e.g. the Mario sound effect I used was 03 1C).

In order to write at 2:A000, if you are using BGB emulator, go into the debugger and double click on DA8C (which is just after opening the SRAM bank in your code), then activate ACE early and BGB should pause. Afterwards you can right click and select "go to...". Enter 2:A000, and select OK to jump there in the debugger. From there you should be able to write those bytes (where otherwise they would likely be unchangable FF bytes due to locked SRAM).

8) At 2:A005 paste the bytes from earlier. Usually, there should be just enough space in SRAM for this (SRAM is A000-BFFF or 8192 bytes). If not, get rid of unneeded groups of 00 bytes in the file and modify the file size in step 7 accordingly.

9) Save the game and reset. Now when you run your code, your custom cry should play! Enjoy :)

Example:

Currently the sound quality of custom cries through this method is still very bad. If you listen carefully through the noise though, you can hear "It's a me, Mario!" ✿

https://www.youtube.com/watch?v=gwbnsy9vlPA

I have just added yellow mario.sav and gangnam mon.sav to my Google Sites. https://sites.google.com/site/torchickens2/pokemon-save-files
« Last Edit: February 09, 2019, 05:37:17 am by Quirky Flower Chicken ❤✿ »

✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post ^^
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿



(Images © Sanrio, Nintendo, Pokémon, HAL Laboratory)

✿ Hi, I'm Evie. Sex male, and spiritually doesn't believe 'male'/'female' needs to be defined; lives more stereotypically like a woman. Call me whichever pronouns you like. :)

Feel free to contact me here about anything regarding the site.

Forgiveness. I feel that the more people pray to our greatest source/God/mathematical equality for world peace, the more and more it manifests into reality (until our next spiritual death).

Thank you Nyapon for this lovely artwork. :3

Sherkel

  • Ringsome on the aquaface
  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
    • View Profile
Re: How to make your own Pikachu cries with ACE
« Reply #1 on: February 09, 2019, 09:59:16 am »
The sound could probably be made clearer by narrowing down the frequency range and (this is just a guess) making it quieter. Maybe making it closer to whatever the spectrogram of the original Pikachu voices is would help. I don't know how the Game Boy's PCM player works, so I can't really say for sure. Do you have the WAVs you imported (after all conversions.edits were done)?

Sticking to quality control and moderation until I sort some IRL matters out. I check in here almost daily and will answer questions, but not all of them.
I don't have a habit of keeping Discord open, so direct inquiries are preferred through here.

konakonaa

  • GCLF Member
  • Offline Offline
  • Gen 1 will always have 190 Pokémon in my heart.
    • View Profile
Re: How to make your own Pikachu cries with ACE
« Reply #2 on: February 09, 2019, 02:13:05 pm »
The audio format used by Pokémon Yellow for the cries is actually 1-bit PCM, not ADPCM. The bad audio quality is a result of the wrong sample format being used.

I have created a small Shell script to do the conversion - it requires FFmpeg and Python 3. Since I'm not exactly sure of the bit endianness used by the game, I have created two versions of the script. Just try each one and see which one sounds better.
EDIT: As pointed out by ISSOtm, the sample format used by Pokémon Yellow is MSB-first - so you should use the first script.
https://pastebin.com/ecguWxip

To use them, you can put them into a .sh file and execute them by passing the input and output file as arguments.

I also made a little tool that you can use to preview how the audio file will sound before putting it into the game.

I hope these tools can be of help to all of you.
« Last Edit: February 10, 2019, 04:15:52 am by konakonaa »
:3

Mefista

  • GCLF Member
  • *
  • Offline Offline
  • Gender: Female
  • GREEN
    • View Profile
Re: How to make your own Pikachu cries with ACE
« Reply #3 on: February 09, 2019, 05:17:57 pm »
So...much...meme...power

Sherkel

  • Ringsome on the aquaface
  • Administrator
  • *****
  • Offline Offline
  • Gender: Male
    • View Profile
Re: How to make your own Pikachu cries with ACE
« Reply #4 on: February 09, 2019, 06:22:14 pm »
Now THAT'S what I call an introduction! :O

Thank you for your contributions!

Sticking to quality control and moderation until I sort some IRL matters out. I check in here almost daily and will answer questions, but not all of them.
I don't have a habit of keeping Discord open, so direct inquiries are preferred through here.

ISSOtm

  • The French Lord of Laziness (and a huge The Legend Of Zelda fan)
  • Staff
  • *****
  • Offline Offline
  • Gender: Male
  • Pewter City (B)rocks !
    • View Profile
    • My Little Website
Re: How to make your own Pikachu cries with ACE
« Reply #5 on: February 10, 2019, 03:51:15 am »
According to this instruction, bits are played out MSB first.
I guess the correct script to run is the first one, then?
"THOU SHALL NOT PASS !!"  RIVAL's effect, Gandalf.

Proudly glitching Pokémon Red and Yellow on a Black & White GB, Pocket GB, GB Color, GBA SP and new 3DS.

My Twitter (beware, I'm French)
My YouTube (same warning)

Here is an online tool to build 8F setups : GBz80 to Items !

They see me layzin', they ha-tin'...
Heavy contributor of the global augmentation of entropy (my room's is too damn high !)

konakonaa

  • GCLF Member
  • Offline Offline
  • Gen 1 will always have 190 Pokémon in my heart.
    • View Profile
Re: How to make your own Pikachu cries with ACE
« Reply #6 on: February 10, 2019, 04:14:12 am »
Quote
According to this instruction, bits are played out MSB first.
I guess the correct script to run is the first one, then?

Indeed, you should use the first script.

It will output the raw bitstream to the specified file, and you can just copy the data into the .sav file using your hex editor of choice.

Oh yeah, the script doesn't run on Windows, not without MinGW, Cygwin or WSL (which you can get from the Windows 10 Store). I might make a standalone Python script that's cross-platform, to avoid the need of a POSIX-compliant environment.
:3

Princess Torchic Owl Lover ☽ ❤

  • Head Administrator
  • *****
  • Offline Offline
  • Gender: Female
  • Aspiring mother. 🦋 ✿
    • View Profile
Re: How to make your own Pikachu cries with ACE
« Reply #7 on: February 10, 2019, 01:41:27 pm »
Wow, thank you konakonaa! Will try this out when I get the chance. :)

So...much...meme...power

Yes! ✿
« Last Edit: February 10, 2019, 01:49:50 pm by Quirky Flower Chicken ❤✿ »

✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿
Here have some free flowers on every post ^^
✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿✿



(Images © Sanrio, Nintendo, Pokémon, HAL Laboratory)

✿ Hi, I'm Evie. Sex male, and spiritually doesn't believe 'male'/'female' needs to be defined; lives more stereotypically like a woman. Call me whichever pronouns you like. :)

Feel free to contact me here about anything regarding the site.

Forgiveness. I feel that the more people pray to our greatest source/God/mathematical equality for world peace, the more and more it manifests into reality (until our next spiritual death).

Thank you Nyapon for this lovely artwork. :3