A user named Intron on my Discord server mentioned to me that I should try using dithering while down-sampling the sound effect to make it sound better. I did just that and it sounds way better! You can have a listen here: cdn.discordapp.com/attachments/287031518533124096/587755536565403812/comparison.wav
@arashikou66615 жыл бұрын
Wow! Those last two samples *really* drive home the benefits and costs of dithering. I feel like this should be used as an educational sample about the power of dithering in downsampling.
@badacktor5 жыл бұрын
a commonly shared and extremely great resource on digital audio comes from monty at xiph: xiph.org/video/
@badacktor5 жыл бұрын
a commonly shared and extremely great resource on digital audio comes from monty at xiph: xiph.org/video/
@mrflamewars5 жыл бұрын
Get Foobar2000 0.8.3 from oldversion.com, it will allow you to output loooow sample rates and bit depths with and without dithering. www.oldversion.com/windows/foobar2000/
@TheRationalPi5 жыл бұрын
You can do even one step better. Since you have an excess sample rate of 78 kHz, you could noise shape the dithering to push some of the residual noise out of the audible band.
@DivisibleByWaffle5 жыл бұрын
As awful as the starter Pikachu sounds to us today, hearing Pikachu's voice come out of the Game Boy speaker was incredible to any impressionable 90's kid. Thanks for the video - it's neat to know how this all works!
@mikekazz53535 жыл бұрын
The feel of joy the first time hearing that and thinking, "whoa he talks, can't wait to hear Charmander, Bulbasaur or Squirtle." Then reality hits you like Mike Tyson the moment you let your guard down.
@vinnie61975 жыл бұрын
I wanted to hear eevee, but alas, twas not meant to be :(
@alienxotic50285 жыл бұрын
Yup
@TorreFernand5 жыл бұрын
I started playing on a non-compatible 1st gen gameboy, so I just got the pokédex cry. It was only when I put it into a borrowed super gameboy color that I learned pikachu could talk ... it got old fast
@cube2fox5 жыл бұрын
@@TorreFernand Strange that it doesn't work on an original Game Boy...
@mishapp44395 жыл бұрын
Me: *looks at Pikachu* Pikachu: *grabs megaphone* **P I K A C H U**
@KingDuckSauce5 жыл бұрын
This needs to be fucking pinned
@user2C475 жыл бұрын
A megaphone that uses a switching transistor as an amplifier.
@solidkeys5 жыл бұрын
I like your pfp
@giovannytorres16815 жыл бұрын
He stole Kirby's megaphone
@bramnemeth5655 жыл бұрын
**looks at Pikachu** Pikachu: **grabs megaphone** *_SPOTLIGHT UH MOONLIGHT UH_*
@aidanbae61625 жыл бұрын
I thought my ROM was fake until I realized that Pikachu’s cry was originally eardrum-bursting loud
@oxithotten58615 жыл бұрын
BASS BOOSTACHU
@nootaboot70425 жыл бұрын
Do you have a link for the rom? I’ve been looking for one for so long
@TakaG5 жыл бұрын
@@nootaboot7042 I think emulator(dot)games has it.
@thatonecabridog5 жыл бұрын
???
@augustoof135 жыл бұрын
1234567 Subs? Like, the website.
@JoshSweetvale4 жыл бұрын
They literally used the _volume dial_ to morse-code out a voice clip. Now that is some next-level jury-rigging.
@Roxor1283 жыл бұрын
You can do this on the PC Speaker, too. Sounds just as horrible.
@SuperSmashDolls2 жыл бұрын
Tim Follin and his ZX Spectrum say hi
@thewhitefalcon85392 жыл бұрын
EVERYTHING on these old consoles more advanced than Mario Bros 1 is like this
@GGigabiteM Жыл бұрын
@@Roxor128 It really doesn't. The PC speaker can be bit banged to have 8 bit audio at a varying sample rate, depending on the host CPU. While old DOS games using it for samples didn't sound great, the later Windows 3.x PC speaker driver sounded fairly good. Linux has a sound driver for the PC Speaker called SND_PCSP, and it can sound very good. I use it on some of my servers that don't have speakers to provide sound output. It all depends on the host CPU, just like in the Game Boy. A 486 isn't fast enough to bit bang audio at a decent sample rate, but when you have a modern multi-core CPU where one core can be dedicated to bit banging audio, you can get really high sample rates.
@Roxor128 Жыл бұрын
@@GGigabiteM I think you may be talking about two different methods of sample playback with the PC Speaker. Yes, there are actually two ways to do it. Method 1 is to set up the timer chip to output a constant voltage and then toggle the speaker-enable gate on and off. Method 2 is to use the timer chip's single-shot mode with varying countdowns to implement pulse-width modulation. Method 1 is loud, but sounds terrible. Method 2 sounds way better, but is fairly quiet. Fast Tracker 2 implements both, so you can use that for comparison (and at the same sample-rate, so it's a fair one).
@Lumix_Corrupt5 жыл бұрын
I find it mind boggling how intricate and complex this is, just for a single sound from a game in the 90s
@ribosomerocker5 жыл бұрын
luckily, since this is 2019, programming has became less complicated, and much better, though i plan to learn the type of assembly used in pokemon to be able to modify the games
@djninjitsuchannel78575 жыл бұрын
The game might be simple, but the language used surely isn't
@mikekazz53535 жыл бұрын
Well back then it was play these games, or hangout with the weird kid down the street that only like to play with their BB gun.
@grn15 жыл бұрын
Assembly code is a unique beast. The technology of the day (especially portable tech) was no near as powerful as it is today and didn't have anywhere near as many functions as modern processors do. As a result the only way to make a game was to write some form of assembly code (each system had it's own). With modern hardware it's nearly impossible to write any form of assembly code due to how complex said hardware is, how many different components are available, and the fact that a lot of the instructions (assembly code) of said hardware are intentionally obscured (so if you want to write optimized assembly code for a particular CPU or GPU you have to have an inside connection). The advantage of Assembly is that it can be more optimized for the hardware while the disadvantages are that it's harder to code with and only works with compatible hardware. Some instruction sets are common but many are not. Assembly is technically the second lowest language (it's as close to directly communicating with hardware as it gets without actually communicating directly with the hardware). Most modern code is written in higher level languages which then communicate with lower level languages which then communicate with the hardware. As a result higher level languages are easier to use and are more hardware agnostic while being less efficient/optimized for particular hardware.
@xyzzy-dv6te5 жыл бұрын
@@grn1 uhhh... you can make a program with assembly on modern hardware, but you will have to use system calls all the time (which aren't in assembly)
@DarkonFullPower4 жыл бұрын
Nintendo: How did you make the Pikachu sound? Game Freak: *By toggling on and off a maxed out megaphone at 23301 hertz.*
@HYP3RHyper2 жыл бұрын
LMAO
@Eternal_Sugar_Cookie2 жыл бұрын
lol
@NotaSkeleton5 жыл бұрын
Nintendo: Plug in your headphones and play your GameBoy games in stereo! Pikachu: **inhales**
@firebuug5 жыл бұрын
NotaSkeleton pikachu: im about to end this mans whole ear
@soldiergaming-n4b4 жыл бұрын
🅿ℹK🅰☪🈂⛎
@mikuenjoyerXD4 жыл бұрын
Pïkãçhù
@annidromeda4 жыл бұрын
_p i k a - b l o w y o u r e a r d r u m s_
@IvoryLoaf3 жыл бұрын
@@firebuug whole carear
@austinwthompson454 жыл бұрын
Me: (talks to Pikachu) Pikachu: (blows into mic)
@jacobrzeszewski65274 жыл бұрын
Then proceeds to leave push-to-talk off.
@ShwappaJ2 жыл бұрын
PĮĶĄÇHÜÛŮ!!!
@mizukittyakinyama2 жыл бұрын
P̃ĮƘÆÇĦÜ
@DJBSharpMusic5 жыл бұрын
>Watching casually >EARRAPE "PIKA" >Me, bleeding from the ears: "sounds great!"
@GapedCeiling5 жыл бұрын
it was at that moment i realized where my desensitization to loud ear rape came from
@underbelieved5 жыл бұрын
I knew someone was gonna comment about this.
@CodeParade5 жыл бұрын
Some optimizations: Instead of 'LD ($FF1C),A', you can pre-load HL with the address and do 'LD (HL),A' (saves 4 cycles) Likewise, the $C0 can be stored in a register (maybe 'e') to do 'AND E' (saves 3 cycles) At the end 'JP NC,.loop' is actually faster than 'JR NC,.loop' when jumping (saves 2 cycles) There may be more, but those come to mind right away ;)
@Gameboygenius5 жыл бұрын
HL is already being used for the data source, so you'd need to use one of the other pointers. Or even better, the GB CPU's C register pointer instruction. Jp is not faster than jr, because the GB CPU is not a Z80 and thus has different timings. I invite you to look at the gist linked below for my best attempt at optimizing the routine. gist.github.com/nitro2k01/e45e47f8469009b8a43ad5e48d951442
@CodeParade5 жыл бұрын
Ah, that's interesting! I always assumed it was z80 since it used the same instruction set, I didn't see any differences from the video other than some timings. Thanks for the info, and your routine looks very optimal!
@runer1124 жыл бұрын
@@Gameboygenius Great job, I really enjoyed reading through your optimization. It really got me interested in the challenge and got the gears turning in my head... I left a comment on your gist with my results. I think you'll like them!
@RoastCDuck4 жыл бұрын
Hard to find comments like this, everything is reddit this days. Even if I don't understand what assembler code does lol.
@PrimoHidrux4 жыл бұрын
I like how CodeParade has a comment here, Retro Game Mechanics Explained subbed.
@Vykori5 жыл бұрын
14:03 I've never heard someone pronounce "compromise" like that... this video is super cool though. I understood and enjoyed learning about this :D
@RGMechEx5 жыл бұрын
Apparently I'm the only one who has ever pronounced it like that. I can't figure out how or where I learned it that way, and no one has called me out on it until now!
@InsaneFirebat5 жыл бұрын
It's really easy to read it that way, but saying it just sounds so wrong to me.
@staglomagnifico57115 жыл бұрын
Don't you know all the COOL people pronounce it that way? (starting now)
@InfoManiac7425 жыл бұрын
I mean, it has the word "promise" in it, and a compromise is sort of like a promise between two parties to give up certain things, so it makes sense.
@creature_of_fur5 жыл бұрын
I guess thats some sorta dialect?
@whynotanyting4 жыл бұрын
"So we can make this sound good" "Have you ever flipped a switch really fast though?"
@Bismuth95 жыл бұрын
Incredible editing, as usual
@isolasion4246 ай бұрын
the saying that this comment has no reply is a lie
@siaowun94185 жыл бұрын
Gamefreak: Put this audio file into the game. Programmers:
@richardnoggin15265 жыл бұрын
I sadly know where exactly were you got you pfp.
@Atzu01105 жыл бұрын
@@richardnoggin1526 Where is it from?
@jackalopegaming49485 жыл бұрын
Programmers: *surprised Pikachu face*
@sylvierose27995 жыл бұрын
@@Atzu0110 X-Mantis, I belive
@PixelBytesPixelArtist5 жыл бұрын
“I’m not getting paid enough for this shit”
@meithecatte84925 жыл бұрын
Fun fact: you can get an even better sample size if you keep all the channels at constant values (doable with a low enough frequency setting and channel restarts every once in a while) and then just enable and disable the channels with the NR51 register. As a side effect, this will give you stereo sound when headphones are plugged in.
@amapola6294 жыл бұрын
Hello :) Didn't expect to see you there
@B3Rand0m4 жыл бұрын
Anyone notice the "pikachu" from 1:29 was actually from smash 64? I played smash way too many times not to know that lol
@hetsmiecht10294 жыл бұрын
I noticed yeah. Is that the sound of his neutral B?
@bait_01544 жыл бұрын
@@hetsmiecht1029 yes
@tobyy8910 ай бұрын
Same
@martenwulf5 жыл бұрын
Pikachu: *PIKA* RGM: "Unique" sound effects.
@AltName75 жыл бұрын
That alternating between mute and not mute system is genius, what a creative way to get around that obstacle.
@vuurniacsquarewave50914 жыл бұрын
It is perfectly possible to faithfully recreate any sound this way if you have a high-enough sampling rate. At that point you can literally drive the voltage up and down faster than the voltage can leap from one extreme to the other, so the exact level can be driven as you please.
@dasutanehineri5 жыл бұрын
"So let's go look at the..--" *"SCREAMS"* "...unique sound effects"
@m_jaded5 жыл бұрын
The visuals on your videos are amazing, as always. Even though I know nothing about audio, you make it very entertaining to follow along.
@FredrIQ5 жыл бұрын
The only additional optimization I saw was a rather trivial one: Since after AND $c0, carry is always 0, you can replace SRL A (8 cycles) with RRA (4 cycles). I've done plenty of tinkering with the Pokémon Crystal code for a romhack, so I'm somewhat familiar with the Game Boy CPU.
@jimmyjohnjoejr5 жыл бұрын
What's your hack about? You uploading a patch anywhere? I have huge respect for you guys fiddling around with old hardware and working with all the limitations it has.
@FredrIQ5 жыл бұрын
@@jimmyjohnjoejr I contribute to Polished Crystal, mostly focusing on its battle engine (new held items, move effects, Abilities, etc) but also worked on porting Prism's code and size optimizations adapting it to work (removing menu lag, 60fps OW, etc), as well as some minor tweaks on my own (such as being able to handle arbitrary OW sprites without forcing things like gatehouses to reload what sprites are available to use)
@zenthichutt70715 жыл бұрын
I definitely totally understood all of this and can definitely contribute more to this topic
@HalfDuck5 жыл бұрын
Junichi Masuda has a short blog post explaining how he programmed the Pikachu samples into the game, nowhere near as detailed as this though :p
@PaplooTheEwok5 жыл бұрын
If anyone was curious to see the blog post, here are Internet Archive links to both the English and Japanese versions (the blog post is technically still live on the current site, but the image links are dead). There really isn't much detail, but it's still interesting to see that he mentioned it: web.archive.org/web/20080302154250/www.gamefreak.co.jp/blog/dir_english/ web.archive.org/web/20080314112247/www.gamefreak.co.jp/blog/dir/
@CapemanProducti0ns5 жыл бұрын
Pikachu's voice actress: "Pika" 90's Programmers: Ok, this may take... Pikachu's voice actress: "Pika Pika!" 90's Programmers: See you in a month.
@skinwalker694205 жыл бұрын
I knew Pikachu was voice acted by a girl!
@Vladimir_Kv4 жыл бұрын
@@skinwalker69420 _"These voiceovers were done by Ikue Ohtani, the actress who played Pikachu in the Japanese version of the Pokémon anime."_ The Cutting Room Floor wiki.
@TheSonicFan44 жыл бұрын
@@skinwalker69420 yeah, so did everyone else.
@evknucklehead4 жыл бұрын
@@Vladimir_Kv Odd that the entry on that page implies that the American version uses someone else's voice. (For anyone reading this who didn't know, the Japanese voice for Pikachu is also used in the American version, unlike the majority of the other voices in the series.)
@GODOFAWSOMENESS14 жыл бұрын
Otacon464 makes sense why spend the money to get brand new voice actors when they would be saying the exact same thing when you can just use the samples you have.
@LaskyLabs5 жыл бұрын
Don't play Pokémon yellow with headphones. *P I K A*
@grn15 жыл бұрын
Don't play any gen 1 game with headphones (enemy Pokemon used screech; it's super effective).
@Pandalka4 жыл бұрын
too late for me 😂 "Oh yeah, I have a Pikach-" " *PIKAAAA!!!!!!!!!!* "
@rabbit06644 жыл бұрын
@@grn1 Oh boy the zubat.
@grn14 жыл бұрын
@@rabbit0664 My ears just bleed thinking about it.
@acemortesubita4 жыл бұрын
(megaphone) *P I K A C H U!*
@RazoredBlade5 жыл бұрын
I'm glad you tackled this topic as i was burning to know for a while how it was done. While i didn't understood half of the video, i understood enough to get an idea of what had to be done, so thanks for that!
@JonathanChancey5 жыл бұрын
Amazing style of presentation and explanations!
@paulus2saa5 жыл бұрын
Honestly, I haven't understood anything of this. But I love it.
@PsychoDiesel485 жыл бұрын
Same XD
@alienxotic50285 жыл бұрын
Same
@gabishgab91505 жыл бұрын
Same here to be honest
@ВіталійЧумаченко-о4ъ5 жыл бұрын
Same
@philhuntsman75884 жыл бұрын
Same
@NXeta5 жыл бұрын
0:16 holy shit i jumped out of my seat
@lv4c8635 жыл бұрын
Same, scared the shit out of me
@toshibatoshamara5 жыл бұрын
Hahaha pussy, im hiding in a clock
@lv4c8635 жыл бұрын
Mr _Quilava Wtf
@pokepress5 жыл бұрын
Would be interesting to see a ROM hack that made use of this to improve the sound in the game.
@jarlfenrir5 жыл бұрын
Guess if someone does the sound in that way, there won't be any room left for actual game on cartridge ;)
@grn15 жыл бұрын
@@jarlfenrir Indeed though depending on the emulation method it may not matter. Most emulators I've used support oversize roms.
@jarlfenrir5 жыл бұрын
@@grn1 If that's the case... than we just have to wait till someone actually does this ;)
@Rutious45 жыл бұрын
A more realistic option would be to increased the bit depth to 2 and divide the sample rate by 2 (rework the assembly so that it takes 360 cycles between samples instead of 180). I'm almost certain that 2bit depth at 11.5 KHz sample rate would sound way better than 1bit depth at 23KHz. And it would keep the ROM size basically the same (except a few more bytes for assembly modification).
@YokiDokiPanic4 жыл бұрын
Me, watching this and pretending to myself that I know what any of this means: "Ah, yes, yes. I see..."
@waferae3 жыл бұрын
SAME, then there's these smart af people who even simplify it but I still can't understand 😭
@gavinmitchell37093 жыл бұрын
@mintswiss There's a lot to learn, but it can be learned by anybody. Here's the very simplest of the basics (this is assuming you don't know what assembly is, if you know then that's enough to understand maybe?) Two sides: Software and Hardware. Software is the games that run and the things that happen on the screen and inside the console. Hardware is the physical electronics that link stuff together for the CPU. The CPU (Central Processing Unit) basically is a speghetti mess of metal wires so complex and tiny that you can't even see them without a very powerful microscope. It basically runs a loop around it, asking the code what to do after every loop. This is a cycle, and the time it takes for every cycle is it's clock speed. 5 hertz (1Hz) = 5 cycles per second (I'll just say cps), 5 Kilohertz (5KHz) = 5,000cps, 5 Megahertz (5MHz) = 5,000,000cps, 5 Gigahertz (5GHz) = 5,000,000,000cps, and so on. Assembly is the CPU's language. Each line of it is called an instruction, basically a word in it's dictionary. Each model of CPU has its own dictionary to suit it's needs, an instruction set. The storage holds data, ones and zeroes, wether it be code or graphics or anything else. The RAM (Random Access Memory) is a quick-access storage that's much faster then regular storage. Once it loses power, it loses all information, so it is only used for temporary stuff. Each instruction tells the CPU to direct Hardware in a certain way. Examples translated from assembly: "move the stuff from A to B" or "Write the number 10 at C", etc. Data can be sent to different modules, such as sound chips or screens. Once it is sent, it is managed by that chip for its own uses. Translated from Assembly, "take the stuff from D and E in the RAM and send it to the display". If you put things in order, you can do stuff like this (translated): Read everything in storage from A - Z (this should be graphics for a smiley face) Copy that data to the RAM at the same location (A - Z). Send A - Z from the RAM to the display Keep sending it in a loop (to ensure it stays on the screen instead of appearing and immediately disappearing). Smily face! He takes whole chunks of code and simplifies it, so you would just see letters and such and he'll say it puts a smiley face on the screen. This is the very basics, and rewatching the video when you know this helps things fit together. But if this is entirely new to you, wrapping your head around would be difficult for anyone. Don't be afraid to pause the video for a second to understand things, if you rewatch it. Please, for anyone who knows this in a little bit more depth for this specific hardware (or if I'm just plain incorrect), correct me if I'm wrong. I'm still learning too.
@qwertyuiop.lkjhgfdsa3 жыл бұрын
All i understand is that it changes the volume a lot and taht makes the sound I think
@BMB4 жыл бұрын
pikachu sounds like he's talking through a csgo player's webcam mic
@Roxor1283 жыл бұрын
A more accurate comparison would be getting speech out of the PC Speaker back in the day. It uses a very similar method.
@GapedCeiling5 жыл бұрын
nobody: Audio engineers: YALL EVER HEARD ABOUT BIT- DEPTH?
@olipolygon4 жыл бұрын
can confirm, we say this all the time during studio sessions
@deepcitrus70234 жыл бұрын
@@olipolygon no but seriously never ask an audio engineer anything about their craft because we'll hold you in that conversation til your last breath all while speaking what sounds like a foreign language with phrases that sound like words, such as "bit-depth, wavetable, & compression"
@TangerineTux4 жыл бұрын
@@deepcitrus7023 And “Nyquist frequency” and “harmonic distorsion” and “quantization noise”
@BalsticMaker125 жыл бұрын
Absolute madman. Can you check how the voice acting is programmed in the Tokimeki Memorial Pocket games? The samples are quite good for Game Boy.
@williamfalls4 жыл бұрын
Me: "Ah, so this video will explain what makes Pikachu feel certain ways." *clicks* Video: *literally explains their sound* Me: *surprised-Pikachu.jpg*
@meta044 жыл бұрын
kzbin.info/www/bejne/pqmydmdqpJibptE
@maxalmonte142 жыл бұрын
Same LOL.
@DevEd_5 жыл бұрын
It's worth noting that there are a couple other ways to get samples out of a Game Boy that weren't discussed in this video. For example, by writing the wave on a timer interrupt you can get really good sounding samples. This method was used in quite a few Game Boy Color games. The main downside is that the samples take up a lot of ROM space when using this method. By the way, please do a video on Gen 2 cries kthx
@mb27765 жыл бұрын
Can u name a few games which used that method u described?
@DevEd_5 жыл бұрын
@@mb2776 Off the top of my head there's Cannon Fodder, the Austin Powers games, The Muppets, a couple games that used the MusyX sound driver (Wendy: Every Witch Way and Sabrina the Animated Series: Spooked! come to mind), and a few others that I'm probably forgetting. IIRC Little Sound DJ uses the same method along with software mixing in order to allow for two sample channels.
@729MendicantTide5 жыл бұрын
I've recreated a couple through the web app using data from a Crystal disassembly. edit: An addendum for the differences between gen1 and gen2: * 30 more cry bases in gen 2 * Pitch and length shift is now a signed 12 bit integer rather than an unsigned 8 bit integer. This allows for negative pitch shift. * New commands for sound generation, e.g. a jump_channel command which seems to jump to another section of the ROM with cry data, but resets pitch transform (I've been trying to get on the discord to discuss this, but the link is down as of this writing)
@CambriaBold2 жыл бұрын
The April 2020 Nintendo leak revealed that they were actually planning to have most if not the entire Kanto Pokedex using their anime cries in Pokemon Yellow. 74 out of the 151 Pokemon in the game had their cries from the Japanese anime found in the leaked source code. They sounded utterly horrific, which probably explains why they opted not to go forward with it.
The pokemon yellow ACE TAS uses some cool tricks (i think it writes to the wave form data and changes the volume) to get an impressively high quality clip of Staying Alive from Portal. Since it's a TAS, space isn't an issue as it can just be input from the controller.
@scoutchorton5 жыл бұрын
jfb-1337 you should totally link a video to that run. I'd love to hear that.
omg what have you done. if rgmechex gets sucked into the nitty gritty of that TAS we won't hear from in again in a year
@moth.monster5 жыл бұрын
Did they every console verify that one?
@youtubeii4345 жыл бұрын
There's a point where i completely lost it but i still loved it. It makes me appreciate the work that went into these
@Macintoshiba5 жыл бұрын
"How much gain do you want with your Pikachu cry?" "Yes."
@yawg6915 жыл бұрын
You seriously have one of the best channels on all of youtube. Thank you for all of your videos and the large volume of effort you place into each one.
@reanimationxp5 жыл бұрын
came here to say this.
@enojelly94525 жыл бұрын
This is not criticism, I am in awe of your videos and learned many interesting things in all of them, I just attempt to give back a little: 1) In the beginning, when you throw every second (or more) sample away, the weird artifacts you are hearing are because of aliasing. When you throw every nth sample away (this is called decimation) you divide the maximum frequency in the sound by n, e.g. with n=2 you can only represent half the frequencies (so, less treble). But simply decimating does not get rid of the higher frequency content you‘ve thrown away, instead it gets *reflected* back into the lower frequency spectrum, hence the additional weird sound. You can avoid that by lo-pass filtering the sound before decimation: If there is no high frequency content, there is nothing to reflect. 2) For somewhat related reasons, the insanely high sample rate at the end is not necessarily doing you a favor. Here’s the thing: The human ear can hear around 20kHz at maximum, usually much less. A ~70kHz sample rate gives you ~35kHz bandwidth. But does it matter if you can’t hear those frequencies? In theory not, in practice it often does: Due to nonlinearities in your audio chain, you often end up reflecting products of those inaudible frequencies back into the audible part of the spectrum. (This is also why “fancy audiophile” 96kHz/192kHz HiFi equipment can end up performing *worse*). 3) Speaking of non-linearities: The non-linear volume steps can be a big problem if you didn’t process the audio so that the volume level from the original sound does not get shifted up by that uneven step for the affected samples. Even with a ~40kHz sample rate, this non-linearity will cause very substantial intermodulation distortion, which simplified means that two tones will combine together to form additional unwanted tones (remember that any audio signal whatsoever is just a sum of-often very many-sinusoidal tones, so this affects all audio in weird ways). It will also cause or exacerbate the problem mentioned in 2)! 4) Sample rate will always affect what frequencies can be played, i.e. how much treble your sound has, and the highest frequency playable is simply the sample rate divided by 2. Again you need to filter to get rid of anything above that, or it will end up as aliasing. Bit depth on the other hand, assuming no non-linearities for now, on the other hand will simply add “quantization noise”, which literally makes it sound noisier the fewer bits you have. Any *distortion* however is the result of non-linearities. 5) You can trade sample rate against bit rate by playing with lower bit depth but (much) higher sample rate, and then filter out every frequency you’re not interested in (e.g. anything until, say, 14kHz), which has the fun additional property that it will actually filter some quantization noise away as well: The quantization noise is spread across the whole oversampled spectrum and your filtering afterwards gets rid of the portion in the inaudible/unwanted spectrum. However, you really need a lot higher sampling rate. So called 1-bit/Delta-Sigma ADCs (someone also mentioned SACD which does that) are related: They literally have a 1-bit depth as well but much higher sample rate than the original signal’s spectrum. But there’s much more to Delta-Sigma (namely a feedback loop which you cannot implement here), otherwise you cannot recover significant bit depth unless you have insane and unpractical sample rates. Still, if the Game Boy can really play back at hundreds of kHz (not nearly enough for good audio, but we’re just having fun here), maybe worth a try? It all depends on the filtering that happens after sample output on the Game Boy on what happens.
@blara24015 жыл бұрын
This is a very interesting engineer, and I thank you very much for it. How do these "reflections" from high to low frequency happen with sample rate reduction and decimation, however ?
@PrimoHidrux4 жыл бұрын
I hear these types of conversation often in the audio realm, never thought they'd be applied to GameBoy.
@BruhMoment717773 жыл бұрын
Bababooey
@josephlucas.444 жыл бұрын
Bro, as a longtime Pokemon fan and a sound engineer, this blew my mind
@PlantedWave51905 жыл бұрын
Fun Fact: Pikachu's voice in Pokémon Yellow was provided by Ikue Otani.
@user-rb8wt6xg3f5 жыл бұрын
I don't understand a word of this, but your voice is very relaxing and I loved listening to the whole thing. It's really amazing.
@Sonicgott5 жыл бұрын
Programming is an art form, and this proves that.
@mario_94315 жыл бұрын
agreed
@thenthson5 жыл бұрын
Respect +1
@Doritomurderer5 жыл бұрын
making games was hard and continues to be hard!
@kirin12304 жыл бұрын
Gen 1 is such an interesting art. It's awful and broken, but for the time and budget, it's pretty incredible what they were able to do.
@thenickstrikebetter4 жыл бұрын
An art that breaks your ears
@ElNeroDiablo5 жыл бұрын
Man, that was rather beautiful improvement on Pikachu's call, by cutting down on cycles spent waiting for code to be called, ran and dropped (before calling again). Sure technically you're duplicating code written as needed to perform (as it USED to be done, writing code in sequence, before you could add calls to code elsewhere), but it making for faster code and a cleaner output was beautiful.
@megatrix5005 жыл бұрын
4:36 When you play every other sample it's like reducing the bitrate of the sample instead of the bit depth, and sometimes when making music or designing sounds you can use an effect made to do that, called a Bitcrusher. Usually it also allows for bit depth reduction too but bitrate reduction has a more unique sound. You can couple it with a pitch-changing simple wave like a sine or triangle and it produces a soft dubstep-like growl.
@karentookthekids10324 жыл бұрын
me: having insomnia KZbin: 20 minute video on Pikachu's cry Me: yes
@vaendryl5 жыл бұрын
com promise? lol good job once again dude :D
@cullensaquarium5 жыл бұрын
Same. thought i was going mad when I thought he said that
@wanderingrandomer4 жыл бұрын
That is the first time I've ever heard anyone prononce it like that
@innerface.5 жыл бұрын
A video based on the differences between the GBA and SNES sound chips would be cool. The GBA chip seems so much stronger, but all of the Super Mario Advance games had heavily “compressed” sounding music. So the benefits/detriments to either would be an interesting topic I think
@audiohacked5 жыл бұрын
I love how in-depth you go into these topics! Keep up the amazing work!
@Nikku42114 жыл бұрын
Little Nicky and Cannon Fodder probably do the circular buffer method, using a low sample rate by using a low wave pitch, and then making extremely slight pauses to update the waveform. When this is done, a minor buzzing sound is created, which is definitely the case with Little Nicky and Cannon Fodder.
@InsaneFirebat5 жыл бұрын
Great video! It's amazing how much thought has to go into designing something like this. We take so much for granted. Thank you for shining some light on it.
@dll99005 жыл бұрын
The best channel I've found since years.
@Dryon11965 жыл бұрын
Couldn't keep up entirely in the assembly explanations part, but as always your job is incredible and extremely well done. Without all your slides, examples and your curiosity for going in-depth, a bunch of people like me wouldn't be able to even barely imagine how it all works in the end. I sincerely hope you'll keep this passion in your future works whatever they might be.
@AURORAFIELDS5 жыл бұрын
This throws me back to when MarkeyJester was developing Dual PCM. The amount of crazy insane Z80 code to run two-channel sample-based sound driver for Mega Drive... That thing was insane to watch, like so much work just to save 2 cycles to push the sample rate nearer 16khz... That I think is still the most technically amazing software written for the Z80 ever.
@DlolFace5 жыл бұрын
I was today years old that Pokemon is a shortened version of pocket monster
@opalpersonal5 жыл бұрын
Even back in the day, this stuff was so dang complicated... it amazes me how advanced all this coding and programming was just to make a voice come out of a machine.
@amyshaw8935 жыл бұрын
making a computer in minecraft has trained me in the art of assembly code =D
@fantoast69325 жыл бұрын
Weird flex
@tuxedobird5 жыл бұрын
but okay.
@kjl30804 жыл бұрын
how long did laying out the ALU and memory take
@amyshaw8934 жыл бұрын
@@kjl3080 I cloned a lot of the memory, so once I had a working module it wasn't too bad. The ALU was pretty complicated, however in the version I made, it was a pretty simple ALU, so it wasn't incredibly complicated. I'm kinda working on a new version that will have more operations though
@kjl30804 жыл бұрын
@@amyshaw893 wow thats a long project
@linktheplayer35 жыл бұрын
I love pikachu and I can't wait to play Pokemon yellow! Pikachu: PPIIKKAACCHHUU
@robin97934 жыл бұрын
Those pikachu sound effects are low key jumpscares
@Cyber_Cheese5 жыл бұрын
Man when I saw 20 minutes I was confused af, but that was outstanding dude
@skarmux19445 жыл бұрын
Masterful editing. I was able to follow the assembly code and mechanics without pausing the video. You got my subscription for sure, sir.
@kquote035 жыл бұрын
20:40 Dang ! You missed the PERFECT Segway to a skillshare ad
@juliewinchester14885 жыл бұрын
Maybe they aren't sponsoring them.
@markkoetsier64755 жыл бұрын
Segway
@tommyvercetti14815 жыл бұрын
You've been watching too much *LINUS TECH TIPS*
@RiVaLBrite4 жыл бұрын
Damn my computer architecture course came in handy for understanding the assembly language and code optimization. Well done sir.
@crowmigration82455 жыл бұрын
At about 5:00 my eyes glazed over. 7:43 "This is about to get pretty complicated" OH THAT WAS THE EASY PART BEFORE. I still enjoy these videos though.
@crimson33625 жыл бұрын
i’m a music producer and i don’t even understand half this shit
@penapower8945 жыл бұрын
@@crimson3362 Probaly because of bits things
@do38075 жыл бұрын
I watch these things, learn nothing (except a few random factoids), but have fun.
@cereal75914 жыл бұрын
At that moment I was like "nah, don't worry, I wasn't planning on understanding anyway. Just stopped for nostalgic curiosity"
@lucegibbs60444 жыл бұрын
I never completely know what’s going on in these videos but I still enjoy it
@BrunoValads5 жыл бұрын
ASM improvements are very welcome in the games you work with, I really enjoy seeing and understanding the possibilities
@jesspumphrey87514 жыл бұрын
I never knew assembly could be so fascinating and calming
@adam0777T5 жыл бұрын
Absolutely fantastic video yet again. Love these. Keep them coming!!!
@pausmth5 жыл бұрын
My god, I honestly think you are one of my favorite youtubers/content creators. Once I have a steady source of income I'm certainly sending some your way. Keep up the awesome work! And damn the visuals you make for both this and the snes series are incredible!
@3lH4ck3rC0mf0r75 жыл бұрын
I'm thinking, someone could think up some sort of algorithm to identify the best possible shape pattern to upload into the wave channel for the chosen sound effect (instead of just FF) to achieve a virtual bitdepth that way. That way it doesn't sound like it's overdriving to hell and back. Think the waveform shape setting in an additive synthesizer like Harmor in FL Studio, and you could be modulating with volume and pitch, instead of just volume to get the sound. This would sacrifice samplerate, definitely, but since we were overkill anyway, the percieved quality could still be much higher.
@DevEd_5 жыл бұрын
Such a method could theoretically be used to get decent speech synthesis out of a Game Boy. I've considered trying something like this, but I have no idea how to approach such a system at the moment. EDIT: Some additional thoughts for using such a system for samples: While the ROM space usage would be very small with this method, it would result in a very synthetic sound, similar to Impossible Mission on C64. Like I said, it's far more suitable for speech synthesis, which is going to sound synthetic anyway.
@3lH4ck3rC0mf0r75 жыл бұрын
@@DevEd_ Speech synthesis is a much more complex thing to consider doing. First try getting good wave sound XD
@DevEd_5 жыл бұрын
@@3lH4ck3rC0mf0r7 Way ahead of you :P github.com/DevEd2/SamplePlayer/ NOTE: Make sure you run the included ROM in mono Game Boy mode, otherwise, the samples will sound distorted. Also, this doesn't use the method you suggested, it's basically a .WAV player.
@3lH4ck3rC0mf0r75 жыл бұрын
@@DevEd_ Alrighty then.
@kjl30804 жыл бұрын
@@DevEd_ if anyone sees this comment tag me, this will serve as a random duration self notification for me to check this out
@AttilaSVK5 жыл бұрын
I've had a full year of 8086 assembly class at secondary school and I would have failed it, if my classmate haven't written the code for the two assignments I had to hand in. It didn't help either that we had a teacher who was really bad at explaining things. Despite that I can sort of understand what's going on in an assembly code, so I was able to follow along. As for writing assembly, that's much harder IMHO, so hats off to all the developers who are able to do it and can come up with some crazy ways to optimize their code to run basically anything, even a potato :))
@thesamplemotion5 жыл бұрын
Another great video that I could barely follow along with but understood anyway :) Nice work!
@scoutchorton5 жыл бұрын
Because of your videos, I learned some assembly. I have a TI 84+CE, and a great emulator called CEMU which will show the stack, registers, entire ROM and RAM of the calculator, and even has a disassembler. I literally downloaded the Zilog documentation for the eZ80 processor the calculator's CPU. Using some online documentation, I found where the VRAM was (something I learned here), found a HEX to 565 Color converter, and was able to write out the raw hex codes within the calculator's code editor to set up two values and write them on top of the entire VRAM (in combination with a few other calculator routines to not update the screen) to change the entire screen to whatever color I wanted until a button press. I learned all of this from your videos, online documentation, and CEMU's display of stuff to help me understand the CPU. Also, I've done programming for 5 years and counting, but I've never done a language that goes down the hardware code. Even though I didn't take the time to slow down and understand the ASM, I could have given time. Thank you for going in depth for nerds like me, who decorated my graduation cap last week with a Matrix theme and even wrote eZ80 ASM on the side. Thank you for all your videos!!!
@Michirin98015 жыл бұрын
Now THIS is what I've been wanting to know about Gen 1 Pokemon!
@ashkirby88965 жыл бұрын
Michirin9801 Hi MIch!😄
@gloweye8 ай бұрын
I have mad respect for the absolute legend that came up with this way of getting an understandable sound out of the gameboy in the first place.
@rayzojams5 жыл бұрын
smooth animation + 60 fps? I'm charmed.
@glitchhunter094 жыл бұрын
Fun fact, in the files of the recently leaked pokemon gold and silver source some leftover pokemon cries form yellow exist. they include Onix, Krabby and others. These cries are based on their anime versions. Seems they cut the idea
@ThinDi3sel5 жыл бұрын
This is such a great explanation! Subbed.
@etiennenijboer57445 жыл бұрын
Using volume modulation was exactly how sampling was done on the MSX computer back in the 80s. Using better lookup tables the sound quality was much improved.
@Tarodenaro5 жыл бұрын
huh wut, that optimization technique sounds familiarly like SACD encoding bitrate & sampe rate.
@GoAwayStupidAI5 жыл бұрын
As soon as you mentioned the volume had 4 levels I wanted you to explore what that sounded like. You did and it was awesome. Thanks!
@gmr_redpanda86754 жыл бұрын
Pokemon company: * makes pokemon yellow pikachu cry and tests it out * Also pokemon company: its music to my ears
@bonciutalentadv75995 жыл бұрын
A nightmare, also called a bad dream, is an unpleasant dream that can cause a strong emotional response from the mind, typically fear but also despair, anxiety and great sadness.
@first__last Жыл бұрын
A few optimization ideas: - I notice you're not making use of the (often neglected) 'LD (FF00+C), A' instruction. It's 4 cycles faster than 'LD ($FF00+n), A', though using it would require some register re-allocation. - The 'SLA D' instructions could be replaced by faster bit rotations (shuffling in and out of the A register as needed). Then, with all the shifts having been replaced by rotations, you could pre-rotate each sample byte by 1 bit and replace 'AND #$C0; SRL A' with simply 'AND #$60'. - Since the FF1C register has only two usable bits anyway, you can skip the bit-masking altogether. With all those optimizations in place, that brings it down to 28 cycles per write (exactly twice as fast). Here is some pseudocode to help illustrate: ld c, low($FF1C) ; 8 .loop: ld a, [hl+] ; 8 ldh [c], a ; 8 rrca ; 4 rrca ; 4 dec de ; 8 nop ; delay, 4 ldh [c], a ; 8 rrca ; 4 rrca ; 4 bit 0, [hl] ; delay, 12 ldh [c], a ; 8 rrca ; 4 rrca ; 4 ld b, a ; 4 add a, d ; 4 ld a, b ; 4 ldh [c], a ; 8 jr nc, .loop ; 12;8
@Foxhood Жыл бұрын
What strikes me. Is that if one is familiar with the Commodore 64's MOS 6518 sound chip. This trick sounds eerily familiar. The C64 had this flaw where modulating the Volume control of the sound chip could alter the output waveform. Which on discovery led to people using the Volume Control on the chip to get it to play samples. Seems that the Yellow Devs where quite familiar with this hack and translated it to the Gameboy hardware.
@exVariaa4 жыл бұрын
2:33 what the teacher uses. 2:57 what the teacher gives you.
@KusaneHexaku5 жыл бұрын
I used to be completely clueless about any Assembly code and would just blank out on sections where you explain them. But, after I have played a wonderful game called TIS-100, suddenly I'm able to understand the code shown now! Video games are great!
@razmetrez5 жыл бұрын
Damn dude, nice video. Would explaining how Iwata managed to fit Kanto into Gen 2 be worth a video?
@FredrIQ5 жыл бұрын
To my knowledge, before Iwata was involved, the game didn't use any compression whatsoever. My guess is that Iwata simply ported a lz-decompression implementation and made various things (such as the Pokémon bitmaps) lz-compressed. It makes a huge difference. A major Crystal romhack did something similar to map data -- compressing it and optimizing the decompression code lead to freeing up around 5% space in the ROM (from around 6% free to 11% free -- a huge boost in context).
@luiss4285 жыл бұрын
apparently that was iwatas 'gift' to gamefreak a graphic compression tool
@FredrIQ5 жыл бұрын
@@luiss428 To be fair, he has been very helpful overall in fixing shitty programming in games, not just Pokémon. Apparently he ported the RBY battle system to the game that would become Pokémon Stadium in less than a month, and was the one who implemented link battles in RBY. I've looked at RBY's battle code. It's... not very well written. GSC's isn't much better, but it's *far* better than RBY. And keep in mind, the compression algoritm alone doesn't help anything -- he also has to go into the logic and add additional code to account for the compression. For something like displaying Pokémon images, that's a lot of places. I implemented Abilities in a Crystal romhack a year ago-ish. Adding the ability names and descriptions took a few hours at most. Adding the functionality in the battle engine and OW code appropriate took several months, and then additional months for bugfixing the inevitable bugs... (even if I were to compress working time to something like an actual working week, it'd still have taken over a month)
@grn15 жыл бұрын
Gen 2 was also a GBC game which means it had a larger rom size (from what I could gather GB games maxed out around 1MB while GBC games maxed out around 16MB though I had some trouble finding concrete information with the quick Google search I just did).
@FredrIQ5 жыл бұрын
@@grn1 GSC all used MBC3 as their rom type, which maxes out at 2MB. IIRC Yellow used MBC5 for whatever reason, which has a theoretical max of 8MB (they didn't use even remotely close to much -- perhaps they intended to have higher quality cries at first?), but unlike MBC3, has no real time clock support (hence the "downgrade") There is no difference about GB and GBC ROMs hardware-wise -- GBC-only ROMs had to do the hardware detection to refuse to run on a Game Boy by themselves.
@MNGoldenEagle5 жыл бұрын
Fascinating description of the assembly. I'm impressed you were able to optimize it even further to get a better sample rate, though I will say listening to that particular clip it's actually harder to understand Pikachu's voice, as it seems muffled and lacking detail. It certainly has less noise than the 1-bit sample, but it's particularly noticeable around the second syllable. Maybe some finessing of the waveform could exaggerate the voice enough to bring out those details though.
@RGMechEx5 жыл бұрын
Someone mentioned dithering to me, and I made a version of the sound using it and it became way better sounding. I might make an update video, or at least post it on Twitter/Patreon for everyone to hear.
@MNGoldenEagle5 жыл бұрын
@@RGMechEx Nice! I'm looking forward to it! Maybe a quick explainer of how dithering works with audio too? 😉
@pickles31284 жыл бұрын
I remember the attack Screech would irritate my babysitter's ears, even if my game was on low sound.
@mincrmatt124 жыл бұрын
It's really interesting to see this sort of analysis in the light of the recent Gen 1 source code leak. (if you've got it, in the file Gen 1/yellow/Source/P_VOICE.dmg) There are actually comments with all of the timing info next to the relevant instructions! (although they are divided by 4 for some reason)
@PixelBrushArt5 жыл бұрын
~5:35 “Modualtion” I have spotted a typo.
@paranthesisism3 жыл бұрын
"man i can't wait to play the new copy of pokemon yellow i got for christmas!" "P̴̨̤̻̩̭̔̋̌̾̐͘͝͝͠I̵͉̰͖̦̯͎̼̗̟̓́̌́̽̌̆̀́̉͌̍͊ͅK̵̨̡̨̰͓̜̼̼͇̪̀͒͐̌̌̎̄̽̀̚͠Ä̶̻̜̥̇̌̌͌̉̃̓̒͗̃̉̕͝C̴̙̮͂̾̒̈́̈́̅̾̃͐̃̾Ḩ̵̥̣̭̠͖̰͈̥̱̄̅́̚͜͝U̸̼̰̳̎̈́̂̐̑̿̔͌̈́́̕͜͝"
@allencummings75645 жыл бұрын
amazing 😅 I didn't really follow too much but you gotta' start somewhere so
@MaxOakland4 жыл бұрын
Holy crap! You are such a genius. This was an amazing technique by the original gameboy crew and you made it significantly better. Amazing video
@PrinceSnivy245 жыл бұрын
This is amazing! Thank you so much for this information! It’s music to my ears and both the original and improved cries brings tears of joy! :’)