BRR Samples Explained - SPC700 Series pt. 3

  Рет қаралды 43,252

Retro Game Mechanics Explained

Retro Game Mechanics Explained

Күн бұрын

Пікірлер: 209
@michaelcalvin42
@michaelcalvin42 2 жыл бұрын
I actually used the fact that a sample's loop point doesn't need to point to an address within the same sample when I created my SNES jukebox project. I set up a couple of buffers and loaded the contents of one while the other played, setting the loop points dynamically as each sample "looped" so that it plays as one continuous "sample." This allowed me to stream an entire song (converted to brr format, of course) from an Arduino.
@HaveYouTriedGuillotines
@HaveYouTriedGuillotines 2 жыл бұрын
I suspect this is probably how the MSU-1 works.
@michaelcalvin42
@michaelcalvin42 2 жыл бұрын
@@HaveYouTriedGuillotines Without looking at the source code for the MSU-1 "chip," I couldn't say for sure. But some docs I found online claim that it leaves "... the SNES’ own SPC700 sound chip free to do better sound effects and jingles" so I kind of doubt it. The cartridge port does have pins to externally mix audio into the output, and those pins are probably an easier interface for this if you're rolling your own custom chip. This would also remove the 32KHz sample rate limitation, since you're directly mixing your own analog signal.
@Cubearr
@Cubearr 2 жыл бұрын
@@michaelcalvin42 I believe you are correct. MSU1 audio comes through at 44.1khz at CD quality. Likely via similar means as the Soundlink system found in the Broadcast Satellaview system.
@YEWCHENGYINMoe
@YEWCHENGYINMoe Жыл бұрын
Y
@_aitchfactor188
@_aitchfactor188 2 жыл бұрын
9:37 a number of games rely on this overflow to make some percussion samples have more "pop", and many later konami and squaresoft games combine overflow behaviours with unstable looping for very space-efficient pitchable noise samples. On the other hand, late-era konami games increasingly avoid using any filters, and clamp all "normal" samples to about 90% of the dynamic range seemingly to avoid overflows at any cost.
@Waccoon
@Waccoon 2 жыл бұрын
Wow, that's an impressive amount of hardware for a device from 1989. Just having a hardware multiplier in audio hardware was a pretty big investment. I did work on a differential audio engine for an 8-bit retro computer, and got something pretty decent with a 9-bit adder, a single-stage funnel shifter, and a 56-bit lookup table.
@T3sl4
@T3sl4 2 жыл бұрын
Can confirm. Did an audio project on AVR XMEGA before: a reverb effect with 6 delay taps and 2 biquad filter sections, 12 bit ADC/DAC, 25kSps. CPU runs at 32MHz. It would hardly handle just one filter, if not for the 8x8 hardware multiply!
@ImSquiggs
@ImSquiggs 2 жыл бұрын
This is coming out on the same day I'm trying to figure out how to create .brr samples for Super Mario World ROM hacking... I can't think of a video that would be more relevant to my day today, haha. I'm gonna be trying to make some of my own too so I bet I walk away with a few useful tricks.
@noisecross
@noisecross 2 жыл бұрын
Bregalad's "BRRTools" in the romhacking page is a great starting point to create new samples. My own "SNES Sound Editor" in the "FF5 Hacking Wiki" can also ease your life a lot.
@pichonPoP
@pichonPoP 2 жыл бұрын
In my case, I want to know from where the sound came in final fight.
@tiileaf
@tiileaf 2 жыл бұрын
Pleasure seeing you here again! Good luck with the samples in your hack Squiggs!
@AftercastGames
@AftercastGames 2 жыл бұрын
I love these videos, but it amazes me that anyone else is interested in this stuff. I figured it would be me and like 4 other people watching it.
@benox50
@benox50 2 жыл бұрын
Nice to meet more rom hackers here
@impiaaa
@impiaaa 2 жыл бұрын
It's also worth noting that the PlayStation 1 and CD-i use (mostly) the same ADPCM encoding (which makes sense because Sony designed the audio chips for all 3 🙂)
@vuurniacsquarewave5091
@vuurniacsquarewave5091 2 жыл бұрын
It's double the channels, and more ARAM basically, but I'm pretty sure other aspects got improvements too.
@CarbonRollerCaco
@CarbonRollerCaco 2 жыл бұрын
Nice. Sony may be run by scummy businessmen (which is why Nintendo ducked out of the CD-ROM deal with them-Sony wanted too much money), but they put out _sound_ tech. *rimshot* Thank you; I'll be here all night.
@BurritoKingdom
@BurritoKingdom 2 жыл бұрын
PS2 also. Its basically an evolution of the PS1 SPU, which is an evolution of the SNES sound system. With SPU2, it has twice the channels and 4 times the ARAM of SPU.
@BurritoKingdom
@BurritoKingdom 2 жыл бұрын
3 times as many channels and 8 times the ARAM. 24 audio channels with 512KB of ARAM. SNES had 8 channels with 64KB of ARAM.
@delta3244
@delta3244 2 жыл бұрын
The timing of this video could not be better for me. I recently started reading "C Language Algorithms for Digital Signal Processing," an old book which talks about the math behind and implementation of a bunch of algorthms, including ones similar to the one discussed in this video. (it was written around the time digital techniques were becoming the standard way to process signals, and was written for engineers who needed to learn C/DSP fundamentals to keep doing their jobs effectively). Having an easily understood explanation of one of the kinds of algorthms the book describes will be invaluable for understanding the math/implementation behind it, and as always, your explanation is excellent. Thank you for making these videos with consistantly excellent quality, and thank you a second time for the timing of this video being so coincidentally good.
@JohnGames-gz7ue
@JohnGames-gz7ue 2 жыл бұрын
The fact that you can make people understand this stuff is astounding. I learned assembly from you. Good job and thank you.
@ThePerfectKiosk
@ThePerfectKiosk 2 жыл бұрын
What you're referring to as a "sample cycle"--that is, one of those 32 KHz processing steps--is conventionally called a "frame".
@somerand0mpers0n
@somerand0mpers0n 2 жыл бұрын
🖼
@renakunisaki
@renakunisaki 2 жыл бұрын
I'm sure that doesn't get confusing in the context of game development where you have other kinds of frames to worry about.
@r.pizzamonkey7379
@r.pizzamonkey7379 2 жыл бұрын
​@@renakunisaki I mean, 'frames' can already refer to frames of animation, render frames, input frames, iterations through the main game loop, and more. Why not add one more?
@paulsnar
@paulsnar 2 жыл бұрын
One funny thing, Nintendo has gotten a lot of mileage out of the ADPCM format-a lot of their current games continue to use it to store most, if not all, sounds and music. The BRSTM format also uses ADPCM, with some minor differences like not having explicit end/loop bits in the ADPCM data and listing the loop point in the file header.
@DogsRNice
@DogsRNice 2 жыл бұрын
They also used sequenced music as late as super Mario Galaxy 2 I believe Though sometimes it would just have a long sample of the orchestrated music at some point
@RoadrunnerWMC
@RoadrunnerWMC 2 жыл бұрын
I think it's more just that "ADPCM" is a really general category name that can be applied to a wide variety of formats. I was messing around with the version on the Nintendo DS (known as "IMA-ADPCM") recently, and while it does have the same basic idea of encoding the differences between samples and making use of context to change the quantization step sizes, the exact way it works is pretty different from the format described in this video. And the BRSTM version ("DSP-ADPCM") is the same situation: same high-level ideas, but not the same actual format.
@paulsnar
@paulsnar 2 жыл бұрын
@@RoadrunnerWMC That's fair-I'm not well versed in the particulars beyond having written a BRWAV decoder once and noticing the superficial similarities. Still, the fact that there's a lineage between the SNES and what they pervasively use today felt worth pointing out.
@RushJet1
@RushJet1 2 жыл бұрын
@@DogsRNice Some of the music in Odyssey sounds like the sequenced music from the Galaxy games, though not sure if they actually have it sequenced in the game or just recorded.
@SuperSmashDolls
@SuperSmashDolls 2 жыл бұрын
And yet they forgot to use it for the SNES Virtual Console and instead ripped out all the BRR samples for some reason 🤷
@silent-science
@silent-science 2 жыл бұрын
bit rate reduced samples go BRRRRR
@redstonewarrior0152
@redstonewarrior0152 2 жыл бұрын
Damn. Stole my comment before I watched the video.
@marti5420
@marti5420 2 жыл бұрын
Damn it now I have to delete my comment
@dukemagus
@dukemagus 2 жыл бұрын
Goddamned ninjas!
@JohnGames-gz7ue
@JohnGames-gz7ue 2 жыл бұрын
BRR Goes BRRRR!!!!!!!!!!
@nyspwastaken
@nyspwastaken 22 күн бұрын
get out
@PuglyWont
@PuglyWont 2 жыл бұрын
Thank you so much for making this! I still can barely believe it... it's tailor made to my interest, technical understanding and learning style. Perfect!
@Iroh72
@Iroh72 2 жыл бұрын
Great explanation as usual, but for these topics I feel giving short audio examples to listen to could be useful for those who aren't too familiar with terms like octaves, perfect fifths and so on.
@hobbified
@hobbified 2 жыл бұрын
The presence of filter modes 1-3 is what makes it *differential* PCM (we're coding the difference from some predictive model instead of coding the sample itself), and the ability to change the shift and the filter per frame is what makes it *adaptive* differential PCM (the encoder can choose the parameters that give the best match for each little bit of audio). The way the pitch register is integrated (and the fractional portion used for interpolation) basically amounts to "direct digital synthesis" (which has pleasing similarities to Bresenham's line-drawing algorithm, and the way that subpixel math leads to smooth movement in games like Mario). Carrying over all of those fractional bits is important not only for getting good accurate pitches (which many older consoles and computers weren't capable of), but for making vibrato and pitch-bends glitch-free.
@bmartin427
@bmartin427 2 жыл бұрын
Nice vid! I hope we hear more about filter overflow at some point, since it's critical to some games' sounds like FF3 and CT. Circa 2002, I put a lot of effort into reverse engineering how this worked without getting noise in songs that aren't supposed to have it (e.g. CT's Johnny C Bad). Built my own flash cart, made my own test ROMs to run BRR samples and save the results to echo RAM, read it out and print it in hex on the screen, then undo the gaussian filter to figure out what the actual decoded BRR values were. It still kind of blows my mind that the answer was, it's allowed to overflow *exactly once* before being clamped; basically a hidden 17th bit. 🤔
@johneygd
@johneygd 8 күн бұрын
Well i found it strang that 15 sample pointers are added up with 11bit bellcurve, then the top 16bit are summer together and then are cut into a 15bit value and then get fed into those 16bit dac’s? And then this approach could result into error overflow thus causing pop & click in he audio? mmm that sounds pretty strange to me. Just imsgine if those 4bit adpcm samples are upsampled to 16bit but then cut in halve to 15bit just to save on bandwide but then get fed into those 16bit dac’s. Then i consider this to be a very very misoppertunity from nintendo to not think about those longterm decisions to make sure they could stay keep ahead from it’s competitors and to keep their soundchip still relevant against future competitors nack then. Not only that but that means that we actually don’t hear those games as they were made and thus that we have missed aloooot,if that’s the case. I played supermario allstars on zsnes and let me tell you i was shocked what i heard. Those instruments and sound effects seems to have more clearity,more detail and a higher dynamic range in them, those samples are sounding closer from what i heard on the gba, so does it mean that zsnes actually outputs true 16bit audio rather then 15bit? If so then the 16bit sound get’s hidden inside the snes and those games. Unless it is the lowpass filter screwing up all those samples?? Because i have switched off that filter on zsnes.
@GO-tq6hs
@GO-tq6hs 2 жыл бұрын
hell yea part 3. Can't wait til we get to the Echo and Filter since I just got a Super Midi Pak and I'm still trying to figure out the best way to utilize the echo and filter section.
@livvy94
@livvy94 2 жыл бұрын
It's so cool to see all of this after having done so much research on it to make my own music tools!
@ExperimentIV
@ExperimentIV 2 жыл бұрын
oh wow i just discovered your work last night! i wish i could wrap my head around the kinds of tools you use.
@jammy3662
@jammy3662 2 жыл бұрын
@@ExperimentIV what a coincidence! thats so cool!
@livvy94
@livvy94 2 жыл бұрын
@@ExperimentIV 💜💜
@bosscrafty
@bosscrafty 2 жыл бұрын
Oh hi Livvy lol
@jojodi
@jojodi 2 жыл бұрын
Beautiful! I have been implementing this in Verilog/FPGA and this was a fantastic depiction of the entire process. Yes, the decoders/DSP do A LOT of work!
@saxxonpike
@saxxonpike 2 жыл бұрын
Thank you for this! I've been writing sound tools for all sorts of game consoles and home computers for a long time. This may be SNES specific but is probably the best illustration of ADPCM, a popular staple for all sorts of memory and bus bandwidth limited systems.
@HeadCodeMonkey82
@HeadCodeMonkey82 Жыл бұрын
You probably hear it repeatedly, but your animations are clean, simple and really well done. I appreciate the effort you put into them (and your clear explanations!)
@warmCabin
@warmCabin 2 жыл бұрын
So, when you illustrate the bell curve at 17:26, you show it looking back a sample. So if the counter was $155C, sample 0 would be included. But based on the run-through at 21:20, it looks like the interpolation can't look backwards like that, and the 4th point would always make a vanishingly small contribution. Is it a purely predictive algorithm, then?
@RGMechEx
@RGMechEx 2 жыл бұрын
Correct, in the actual implementation, it doesn't look backwards--this is because old samples can possibly be immediately overwritten by new ones coming from the BRR block.
@Jordan10704
@Jordan10704 2 жыл бұрын
It’s almost like the start of the processing is shifted - at the start when the pitch counter is 0, the peak of the interpolation curve is actually data point 1, not data point 0.
@aaendi6661
@aaendi6661 10 ай бұрын
You know, I haven't really ever thought of what happens with the Gaussian interpolation when you key on. Does it just clear out the last 4 samples it decoded, or does it process junk that was left over?
@johneygd
@johneygd 2 ай бұрын
You cannot predict new samples without old and new ones. If it only could look at new ones, then it can never know what’s the average value in between them. If it only could look at old ones, it again can’t create an average value either. Am mean i can imagine if the predictor litteraly only speculates new samples with only new onss or old old ones, then i can imagine that there will be lots of errors in the shaped sudio waveform.
@Mindthegame
@Mindthegame 2 жыл бұрын
27:23 The exact moment my soul left my body. What a screamer.
@spelwerdzrite
@spelwerdzrite 2 жыл бұрын
Please never stop making these videos
@fonesrphunny7242
@fonesrphunny7242 6 ай бұрын
I tried out a famous 70s sampler keyboard. Even with "modern" tools and SysEx, it's quite the adventure. Without tools, you rely on a 2 digit display for setting memory address, loop points, ADSR ... a project for rainy weekends.
@uintptr_t5585
@uintptr_t5585 2 жыл бұрын
This (BRR/ADPCM) took me about 2 weeks to reverse engineer based on Optiroc/BRRtools . I wish I had this video back then!
@Magus12000BC
@Magus12000BC 2 жыл бұрын
I noticed that you mentioned stereo at the end of the video. As I recall it, the Super Nintendo did have a game or two that was supposedly surround sound. I remember Fatal Fury Special having the Dolby Surround logo at the title screen. I don't know how good it was, but maybe you can elaborate on that in your next video if there's any significant difference with how that game mixes samples.
@nyanpasu64
@nyanpasu64 2 жыл бұрын
Negative audio volume in one but not both speakers.
@maxwelseven
@maxwelseven 2 жыл бұрын
Actually a lot of games uses Surround Sound on SNES, but just some of them uses the Dolby logo (mostly Factor 5 games).
@renakunisaki
@renakunisaki 2 жыл бұрын
I don't know if it's related, but the GameCube supported pseudo-surround sound by having some kind of depth information encoded in the audio stream.
@Aquatarkus96
@Aquatarkus96 2 жыл бұрын
It's probably Dolby Pro Logic, a matrix surround format which is a way to process normal stereo audio into pseudo surround sound. The audio of games does not need to be made specifically for this, which is part of the beauty, but some care can be taken by the devs when crafting audio for the game to make the surround sensation even more apparent. That is why some games have a Dolby Pro Logic logo. It's not the same beast as Dolby Digital, which as a discrete format, contains a dedicated audio stream for all 6 output channels (or however many the program is mixed for.) This requires a specific digital interconnect, either a single coax/RCA cable or a Toslink fiber optic cable.
@nyanpasu64
@nyanpasu64 2 жыл бұрын
@@Aquatarkus96 Dolby Pro Logic is a speaker system which detects out-of-phase audio coming from the eg. SNES, and routes it to back speakers. I know how it's implemented in games, and it sometimes sounds odd when played on two-speaker headphones or speakers, but I've never had the chance to listen with a Pro Logic decoder. Out-of-phase *echo* sounds good even on stereo speakers though, when tuned well.
@nintendoloverin9567
@nintendoloverin9567 2 жыл бұрын
One of the KZbin Channels I hold most dearest. Perfect timing, as I was exactly looking for this topic recently!
@FUZxxl
@FUZxxl 2 жыл бұрын
It's interesting how the Gauss interpolation effectively applies a low-pass filter to the signal. Have samples been preconditioned to undo the effect of this filtering?
@RiedlerMusics
@RiedlerMusics 2 жыл бұрын
While this was very informative, a few more audio examples would've been nice. For example, the difference in audio quality with and without interpolation or the different interpolation methods.
@MrBizznessMan
@MrBizznessMan 2 жыл бұрын
Every time one of these videos uploads, I feel like a very excitable dog. I have little understanding of what is actually going on but I'm still happy and onboard with it all.
@wangledteb5671
@wangledteb5671 2 жыл бұрын
Hey I actually had a pretty easy time understanding this video! Finally my audio engineering diploma is coming in handy lol... Hey have you ever considered making a tutorial video or series for programming for SNES? You clearly have a really great grasp of how it works and you're great at explaining. I think if you did that it'd be really helpful as most of the tutorials I could find online (at least the good ones) were text-only!
@Jordan10704
@Jordan10704 2 жыл бұрын
Does that mean interpolation is always affecting the output? Since even if P=$1000, we’re still taking a small part (N[255]) of the surrounding points of the “main point” (N[511]) in calculating the output.
@RGMechEx
@RGMechEx 2 жыл бұрын
Correct!
@DarkAkuma
@DarkAkuma 2 жыл бұрын
Always love these vids. This one even more, as it reminds me that I need to finish working my BRRADPCM converter (specifically used with Virtual/Classic Console games), while also informing me a bit. I forget where I left off. But as I recall, I got stuck reverse engineering some unique elements to the format. The games use a unique patching of the ROM to replace 9 byte BRR sample blocks with 9 byte pointers. Included in the pointer are information on the original block, like one of the nibbles of the header byte among other things. But I got stuck figuring out one byte specifically. I figured it was pitch or interpolation related, but lacked the info to actually generate the byte properly. With PCM2BRR conversion, the byte does not need to be referenced to get accurate output (accurate besides the data loss from the right shift of 1). But with BRR2PCM, there's no viable source to draw from to properly set the byte. It may very well be a pitch byte, thus requiring pitch registers that are set from the SPC program. And as a result... not be data that can be properly generated from a command line app.
@renakunisaki
@renakunisaki 2 жыл бұрын
Super NES: patching the binaries to inject higher quality sound samples from an external source to make the games sound sightly better than the real thing. N64: not even bothering to get fog and textures right.
@DarkAkuma
@DarkAkuma 2 жыл бұрын
@@renakunisaki One, BRR2PCM isn't a quality upgrade. Its a 1 to 1 format conversion. The reason Nintendo did it was either to save processing time, or due to licensing concerns. The VC phased out use of pre-compiled PCM data, and NSO no longer uses it at all. Two, N64 is a more complex system than NES/SNES. It did 3D back before 3D standards were figured out. As a result, its not always strait forward to emulate different things. Making things harder was the use of unique micro code with different games, making it hard to design once, and catch correct feature support with all games. Making fun of NSO-N64 emulation is just a bandwagon that people jump on without understanding it. It is most certainly a flawed emu, but the default from people is to expect it to be at least as good as fan emu's that have 2 decades of development history. Hiyoko was made for the WiiU, could not use any fan code, and was made by a team thats spread thin over several projects. Finally, the issues like fog in zelda that people cite HAVE been fixed. There are certainly things to complain about of goof on with Nintendo's N64 emu. But generally not what most parrots think.
@SpringySpring04
@SpringySpring04 2 жыл бұрын
I don't know if anyone else caught this but the pronunciation of the KON register mentioned at 1:13 is the same as the anime about girls in a music club called "K-On!" (really good anime btw) What an interesting coincidence!
@flygonbreloom
@flygonbreloom 2 жыл бұрын
Part of me would love to see you cover the Ricoh RF5C164 after this series - it is the non-SONY (and relative potato) contemporary to the SPC700, and it would be interesting to contrast the differences between it and the SPC. I'll never get over just how janky the end-of-sample is in the RF5C164.
@GameDevYal
@GameDevYal 2 жыл бұрын
haha sample go brr (nah but seriously... I've messed around a bit with trackers and it's amazing how complicated this stuff is under the hood! I've clearly underestimated how advanced retro music is despite years of experience with it lol)
@karlosk5773
@karlosk5773 2 жыл бұрын
That was an amazing video. Thank you for doing this series!
@nathanisbored
@nathanisbored 2 жыл бұрын
in other words, DSP go brr
@jsd1982
@jsd1982 2 жыл бұрын
Excellent video as always! I'm wondering though why couldn't they implement 4-point interpolation with a sliding window immediately surrounding the BRR sample being processed (-2, +2). It seems they only move the interpolation window in 4-sample increments instead of 1-sample increments.
@IntegerOfDoom
@IntegerOfDoom 2 жыл бұрын
Finally! I now vaguely understand how sampling and all the interpolation nonsense works.
@TS6815
@TS6815 2 жыл бұрын
8:00 so is the behavior of the loop flag responsible for the behavior of audio during crashes? Like a given sample is looping, waiting indefinitely on the cpu to come by and clear the flag?
@RGMechEx
@RGMechEx 2 жыл бұрын
Sure, if there's nobody to tell the DSP to stop playing a note, it will just let it go on forever.
@DFX2KX
@DFX2KX 2 жыл бұрын
@@RGMechEx my brother and I always called that 'the scream of death' whenever my SNES would crash (which it had an odd habit of doing with a few of my old games) It's funny to actually watch the code being executed that caused it.
@vuurniacsquarewave5091
@vuurniacsquarewave5091 2 жыл бұрын
One thing that could intervene in that is if the ADSR or GAIN envelope of the note was definite and would eventually reach 0 volume.
@renakunisaki
@renakunisaki 2 жыл бұрын
@@DFX2KX I always kinda enjoyed the fact that when a SNES crashed, there was a pretty good chance the game would send nonsense to the SPC, which would usually keep on playing but would start a different song and/or a bunch of random sound effects. Most systems you just got the most recent note sustaining forever, or a horrible buzz (repeating the sample buffer that's no longer being filled in).
@DFX2KX
@DFX2KX 2 жыл бұрын
@@renakunisaki I've only ever personally experienced repetitive short loops, often times the FF3 (FF 6 technically) menu confirm sound, I suspect that cart had some.... issues. I'dve been rather creeped out to hear the thing just play music with nothing else going on. lol
@warrioroflight3489
@warrioroflight3489 11 ай бұрын
This guy who made the video is extremely inteligent
@Raikaska
@Raikaska Жыл бұрын
That this video exists is beyond amazing. Thank you so much!
@Raikaska
@Raikaska Жыл бұрын
I LOVED the example. Really did it for me in terms of clarifying all the steps. Ty so much. Gonna try this as soon as I get home
@Raikaska
@Raikaska Жыл бұрын
Done :) tho now im struggling with having good loop points.
@catmacopter8545
@catmacopter8545 2 жыл бұрын
Wow I sure barely understand what's happening, but what I do get is still amazing 😍!
@zabrak999
@zabrak999 2 жыл бұрын
This guy is my Bob Ross - cheers 🍺
@Jehezukiel
@Jehezukiel 2 жыл бұрын
So this is where the *.bms sequenced audio data starts from. Interesting :D
@Alexs23743
@Alexs23743 Жыл бұрын
Why such odd bit values? I heard "15-bit", "14-bit", and "11-bit" in this video. D:
@TildaAzrisk
@TildaAzrisk 3 ай бұрын
Hardware need not be limited by the concept of bytes.
@johneymute
@johneymute 3 ай бұрын
But the snes does absolutely output 16bit audio at whether 8khz,22khz or 32khz. It’s absolutely 16bit !!!
@quabanos
@quabanos 2 жыл бұрын
Love your vids man, keep up the good work!
@TrueN8-bit
@TrueN8-bit 2 жыл бұрын
So long story short, SPC700 go BRR? Really good video, BTW.
@guaposneeze
@guaposneeze 2 жыл бұрын
I once scratched a few vague blobs on the back of an envelope, thinking about an audio thing for an FPGA. There's no way I would have bothered doing stuff like gaussian interpolation. Let alone, with late 80's chip design tools and transistor budgets. Especially since seven year olds probably couldn't tell the difference between good and crappy interpolation while they were screaming at their kid brother during a Mario Kart race or whatever.
@renakunisaki
@renakunisaki 2 жыл бұрын
They were also probably playing on a cheap TV with one crummy speaker. But, these chips were made for stereo systems, so they had to sound great.
@davecool42
@davecool42 2 жыл бұрын
2:10 Yes! A lollipop chart!
@mattb9664
@mattb9664 2 жыл бұрын
Those samples were either cold or drunk. It would be fun to hear about where .brr file extension name came from.
@Lemon_Inspector
@Lemon_Inspector 2 жыл бұрын
just watch the first 5 minutes of the video
@mattb9664
@mattb9664 2 жыл бұрын
Oh, I watched the whole video. I'm used to making acronyms for large programs that fit into the word or joke that only the develop team knows! Bless your soul and have a great day!
@sovdee
@sovdee 2 жыл бұрын
Really liked the video, but the example of how the Gaussian interpolation worked around 23:00 was pretty confusing to me. For example, the $4014 pitch counter seems like it should be calculating the point around sample 4 given the red line, but it's actually calculating the point just around sample 5, from what I can tell. To elaborate, the red line is at $4014. The 255-x sample is sample 4, on the left edge of the bell curve, the 511-x is sample 5, at the left center of the curve, and so on. This means the two most relevant samples are 5 and 6, which means the point being calculated is between 5 and 6, just to the right of sample 5 (5014), which is a full sample ahead of the pitch counter. Am I missing something? If not, is there a way you can better demonstrate this offset? It was really confusing to me why the pitch counter wasn't centered in the samples until I paused the video and worked all the points out in my head. It also makes the reasoning for the sample starting with 0s make more sense, as the notes will start being calculated at sample 1 instead of sample 0.
@RGMechEx
@RGMechEx 2 жыл бұрын
Yes, the actual implementation is slightly different than what is explained at 17:30. It's just as you said, everything is shifted by one sample, making it appear to start at sample 1 instead of 0. The reason for this is that since BRR samples are decoded immediately after the pitch counter hits a 4-sample boundary, those old samples are overwritten in the buffer. Therefore, in the interpolation step, you can't get the sample "before" the current index (index-1). So the indices of the sample points used are index+0, +1, +2, and +3, instead of -1, +0, +1, and +2. At 23:00, when the pitch counter is $4014, it's actually sample #5 that is at the peak of the bell curve, while #4 and #6 are half way, and #7 is basically zero. You can see this offset effect at the end of the decoding 27:25, since, even though the sample is stretched by a factor of 2/3, there is only a single output sample that is zero at the start, while the source BRR sample has 3 zero sample points.
@sovdee
@sovdee 2 жыл бұрын
@@RGMechEx perfect thanks for the response! It makes a lot more sense now.
@Jordan10704
@Jordan10704 2 жыл бұрын
Yeah this confused me at first as well. Thanks for the explanation.
@Jemmysponz1
@Jemmysponz1 2 жыл бұрын
I understood a surprising amount of this! Thanks!
@ChaunceyGardener
@ChaunceyGardener 2 жыл бұрын
Even Koji Kondo couldn't figure this out.
@ssg-eggunner
@ssg-eggunner 5 ай бұрын
Definitely why smw sounded like ass
@Eunakria
@Eunakria 2 жыл бұрын
great video as always! have you considered adding a soundtrack to your videos, especially during long animations? this is all incredibly useful information for SNES homebrew devs and I understand that takes precedence over its role as entertainment, but it's easy to think your sound hardware has broken when a video is playing but silent
@Eunakria
@Eunakria 2 жыл бұрын
admittedly I'm citing my preexisting familiarity with channels like 3blue1brown (similar reference content to yours, about mathematical concepts, but somewhat more emotive) and Sebastian Lague (far more whimsical, but has a similar pacing structure to your videos) and I don't want to make any demands I don't have the right to make, but it's something worth considering imo
@AiOinc1
@AiOinc1 2 жыл бұрын
Interestingly this is pretty similar to what the Amiga was doing in 1985
@ssg-eggunner
@ssg-eggunner 5 ай бұрын
True except amiga paula ended up sounding better cause of better ARAM
@thatdefacer4043
@thatdefacer4043 2 жыл бұрын
Now I know why Koji Kondo said making music for the snes was a nightmare, good lord, he wasn’t kidding.
@Kafaldsbylur
@Kafaldsbylur 2 жыл бұрын
Hehe, samples go BRR
@VinsCool
@VinsCool 2 жыл бұрын
Ohh yes finally!
@VinsCool
@VinsCool 2 жыл бұрын
Being currently into audio programming lately, this has been invaluable informations, absolutely fantastic explanation! I'm surprised I actually managed to understand pretty much everything that was explained in the video. I have to admit however, the Gaussian Interpolation details were pretty confusing, but I did grasp the general idea about it, so that's fine to me. I already knew what a Linear Interpolation was about at least, so that's cool to me, at the end the principle remains the same, it's to find intermediate points to smooth out the sample during playback
@ltva8781
@ltva8781 2 жыл бұрын
You better use sinc interpolation, it's slightly better. And remember that lo-fi crunchy samples sound worse with any interpolation
@McBoccher
@McBoccher 2 жыл бұрын
holy shit the snes predicted k-on 1:12
@johneysupergd7796
@johneysupergd7796 2 ай бұрын
If it is true that the snes can only change the pitch of a sample by speeding it up or slow it down, that means that if i want to down pitch a sample but keep the same speed, then i should play that sample much shorter but if i want to up pitch a sample then i should repeat playing that sample just to get around that. But what if i want to speed up or slow down the tempo of a sample without changing it’s pitch, then i should play that sample much shorter or repeat that sample again to get around those restrictions right? Now i have heard that the snes is also able to change the pitch (through bending it up or down) of that output constructed samples without changing it’s speed or changing it’s speed without changing it’s pitch. If that’s true that would be interesting to know more about it any soon😁
@StuartCGadgetRev
@StuartCGadgetRev 2 жыл бұрын
Fascinating!
@YaveYu
@YaveYu 2 жыл бұрын
Nintendo loves 32000Hz ADPCM yeah, SNES & Wii.
@GolfinhoVoador
@GolfinhoVoador 2 жыл бұрын
oooooooo, you're back. nice
@whamer100
@whamer100 2 жыл бұрын
hell yeah, new video hype
@AnotherSeeker
@AnotherSeeker 2 жыл бұрын
What the heck! If every Directory in these things are $50 's, how the hell did they make money back then??
@oxybrightdark8765
@oxybrightdark8765 2 жыл бұрын
ah yiss i love this channel!
@lior_haddad
@lior_haddad 2 жыл бұрын
ooo a new episode
@16Kchn
@16Kchn Жыл бұрын
I was wondering if cleaner results could be achieved by drawing a “density map” (frequency shift) for each sample. Apparently, it works, but synchronization is a problem and it generates clicking noises when shifting 🤔
@ssg-eggunner
@ssg-eggunner 5 ай бұрын
Id like to see a demo Id take clicking over muffled sounds anyday
@MartinGalway
@MartinGalway 2 жыл бұрын
Love this video series 😀
@RicoElectrico
@RicoElectrico 2 жыл бұрын
If they went to the trouble of using a LUT, why not use a windowed sinc?
@kaukospots
@kaukospots 2 жыл бұрын
Probably because this is all done on silicon
@RicoElectrico
@RicoElectrico 2 жыл бұрын
@@kaukospots How does it matter if the only thing it would change is values in the lookup table?
@ltva8781
@ltva8781 2 жыл бұрын
Maybe sinc needs more calculations, and you are limited by physical chip size, you can't just put anything you want inside. Or the engineers were not qualified enough to do sinc in silicon
@RicoElectrico
@RicoElectrico 2 жыл бұрын
@@ltva8781 Maybe they didn't have expertise, although this must have been shown in signal processing books and IEEE papers by the late 80s. Hell, even Sony did resort to some interpolation tricks when making the first CD player a decade before that. The main disadvantage of Gaussian interpolation is that the Gaussian kernel is not zero-valued for source samples different than the central one. This will make it more low-pass than necessary, compared to windowed sinc or even triangle (i.e. linear). At the very least, they could have left linear interpolation as an option to get crisp sound when the pitch shift was small enough. No ROM needed to store coefficients for that 🙃
@renakunisaki
@renakunisaki 2 жыл бұрын
@@ltva8781 this was Sony in the late 80s. They definitely knew what they were doing.
@accountname1047
@accountname1047 2 жыл бұрын
your videos are legit af
@fluffycritter
@fluffycritter 2 жыл бұрын
I'm really surprised that the pitch table is done using a linear value rather than exponential.
@AftercastGames
@AftercastGames 2 жыл бұрын
Agreed. But exponential values are pretty much useless, since most hardware in this era couldn’t calculate exponents or logarithms in hardware, and resorted to a linear to exponential lookup table anyway. So, for what it’s worth, I think they made the right choice. Makes it easier in the software, and presumably harder on the hardware.
@NXTangl
@NXTangl 2 жыл бұрын
Sampled FM synthesis...nice.
@jpjokela1
@jpjokela1 2 жыл бұрын
SNES GOES BRR
@josephhall5635
@josephhall5635 2 жыл бұрын
You need to make more videos
@musicaldude9429
@musicaldude9429 5 ай бұрын
Wait just realized does BRR standfor( bit rate reduced) samples
@CoolDudeClem
@CoolDudeClem 2 жыл бұрын
Is the SNES ADPCM similar to Microsoft/IMA ADPCM? In the past I've come across several WAV files that use this.
@renakunisaki
@renakunisaki 2 жыл бұрын
ADPCM is a pretty broad concept. You'll find it in just about all digital audio processing.
@AliceErishech
@AliceErishech 2 жыл бұрын
Does that bit about pops and clicks in audio explain why emulators often have a lot of popping and clicking?
@Lemon_Inspector
@Lemon_Inspector 2 жыл бұрын
Well, do you now know why emulators often have a lot of popping and clicking?
@skipfred
@skipfred 2 жыл бұрын
I've never noticed this in an emulator, but I would guess if it happens that it's probably more related to the emulator struggling to process the audio quickly enough than anything else. Just a guess though.
@AliceErishech
@AliceErishech 2 жыл бұрын
@@Lemon_Inspector I don't know if this is the explanation or not. That's why I'm asking.
@AliceErishech
@AliceErishech 2 жыл бұрын
@@skipfred It happens on a lot of emulators and often even on powerful computers and when the emulator seems to be keeping up with the game just fine. Interestingly enough, I actually notice it less on emulators for more modern systems.
@Lemon_Inspector
@Lemon_Inspector 2 жыл бұрын
@@AliceErishech If you don't know, then it obviously didn't explain enough.
@digitalhare4516
@digitalhare4516 2 жыл бұрын
My brain is dumb, but... 11:23 Process go brr
@zoie3109
@zoie3109 2 жыл бұрын
Very cool
@johneymute
@johneymute 2 жыл бұрын
If the snes has to skip parts of a sample in order to get beyond the 32khz pitch limit to enable repitch it beyond 32khz, then how does it still sound smooth at it’s original speed and not getting sound like to be shredded???
@intron9
@intron9 2 жыл бұрын
1st) Max sound pitch is 15.999 kHz , by the Nyquist theorem. 2nd) it doesn't skip all samples in between, the interpolation process will capture some of those samples and make them weigh a bit in each output sample.
@Aquatarkus96
@Aquatarkus96 2 жыл бұрын
Why do you have 2 completely, but not entirely, identical channels lol?
@johneymute
@johneymute 2 жыл бұрын
@@Aquatarkus96 well that’s because when i bought a tablet back in 2012, i couldn’t loggin on youtube so i had to create a second account and that’s why i got 2 channels( i actually got 3 since i somehow accidentally created another account back in 2014 or so, so that’s why.
@magneticflux-
@magneticflux- 2 жыл бұрын
19:26 Just intonation instead of 12-TET? Now my SNES is out-of-tune by 2 cents!
@thezipcreator
@thezipcreator 2 жыл бұрын
it's not "out-of-tune", it's just using a different tuning system. now this is tempting me to make music for the SNES in 17edo...
@cmyk8964
@cmyk8964 2 жыл бұрын
If anything, just intonation is MORE in-tune than 12-TET as long as the piece stays in the intended key.
@bootmii98
@bootmii98 2 жыл бұрын
No 0AAE is the correct 12-TET value, 0AAB would be the Pythagorean (just) fifth
@ricarleite
@ricarleite 6 ай бұрын
How did they architecture all of this in less than 2 years?
@thewhitefalcon8539
@thewhitefalcon8539 2 жыл бұрын
Alternate title: sound chip go BRR
@jco997
@jco997 2 жыл бұрын
Unrelated but, how could someone implement a N-point gaussian interpolation on a 1 bit (DSD) signal? Imagine I have a 1 bit sample and I need to change its pitch rate. I assume that any method, either explicit or internally, converts that signal into a N-bit PCM signal, and then perform the interpolation.
@Aquatarkus96
@Aquatarkus96 2 жыл бұрын
You're perhaps more right than you know AFAIK, there is no way to natively change *anything* about a DSD stream, not the the pitch or even the gain, without conversion to PCM. Theres like one DAC that claims to be able to do it, but they don't disclose their methods and I don't understand mathematically how they could change anything about that stream without some demodulation....
@MaNameizJeff
@MaNameizJeff 2 жыл бұрын
no doubt an amazing trove of information. I do miss though that in the past you used plenty of actual game sprites and animation to visually show what you are describing. I find the lack of using any ongoing audio sample examples just makes the video far less entertaining.
@dreamywise8818
@dreamywise8818 2 жыл бұрын
brr samples goes brrrrr
@alejandroalzatesanchez
@alejandroalzatesanchez 2 жыл бұрын
Finally :D
@jansenart0
@jansenart0 2 жыл бұрын
PCM go BRR
@redstonewarrior0152
@redstonewarrior0152 2 жыл бұрын
SNES sound chip go BRR
@elinimitable8932
@elinimitable8932 2 жыл бұрын
we know SPC700 is the heart of SNES, but we all dream of a SNES with Yamaha FM synthesis pure sounds chip built-in like the Genesis that has like a Sound Blaster inside
@ssg-eggunner
@ssg-eggunner 5 ай бұрын
You can simply sample fm patches if adsr values deconstructed are reconstructed The issue is ARAM
@johneygd
@johneygd 2 жыл бұрын
So the snes does contain 3 filter modes ? Also i wonder that if the snes has to play a sample faster or slower to change a pitch, then how could it maintain the same speed of a sound sample?? Or what if you want to play a sample slower or faster, then how does the snes maintain it’s original pitch???? BTW i tout that 32khz more has to do with sample rate but not with pitch , And if the snes can only reach a full chromatical scale of all the pitches by skipping those parts inside a sample in order to get past that 32khz limit if needed,then how could it still play those samples at full length’s??? It just sounds all weird to me with no logical sense,all the hard things they tried to get around things just to be enable cut corners wherever they could,just unbelievible.
@renakunisaki
@renakunisaki 2 жыл бұрын
You can't play a sample at a different speed but the same pitch, without some kind of complex "stretching" algorithm. What you _can_ do is play the samples at the same speed but for different amounts of time, to get music in a different tempo with the same pitch. Each sample is a very short recording of something like a single note played on an instrument, so changing the tempo is like playing the instrument faster or slower. You still play the same notes but you switch between them faster.
@johneygd
@johneygd 2 жыл бұрын
@@renakunisaki so in other words, the snes cannot change the pitch of a sample without speeding it up or slow it down and the snes can also not changing the speed of a sample without changing it’s pitch right?? If so then that means that for a full chromatical scale of pitches for each instrument, that means that each instrument needs to be recorded at a different pitch wich would only take extra space on the cartride wich i consider very very dummy especially for 1990 when memory was expensive plus back then they couldn’t yet swap samples in & out of the 64KB audio wich means that they had to store all those wanted samples per song into that 64KB ram including those instructions and optional echo ,what were they thinking?,why could they not have just made the snes soundchip just more flexible with more audio ram,sure costs played also a big role in this but they could,ve saved on cartride space instead if the snes soundchip just was a bit more flexible☹️☹️☹️
@3dmarth
@3dmarth 2 жыл бұрын
@@johneygd From the listener's perspective, it doesn't usually matter much whether the samples are speeding up and slowing down, as opposed to a fancy time-stretch solution. Aside from certain percussion and sound effects, it's rarely noticeable. Yes, to properly represent the full scale, and to have it sound _really_ good, a separate recording would need to be made for every note- but that's only for high-end stuff, and you're not going to come across that in video games, especially not games from 30 years ago. SNES games just change the speed (or maybe use one sample for high notes and another for low notes, in a few cases), which works fine. As a listener, I imagine you'll notice the limitations of small ROM sizes and over-reliance on cheesy stock samples, long before any oddities from speed-shifted samples start to bother you. Considering how old the SNES is, I think its sound hardware is impressive, and it would've been hard to improve it much without raising the cost (though I seem to remember someone pointing out that the Sega CD's Ricoh chip was cheaper, and did most of the same stuff). But there's only so much that could have been done. The only thing I'd really criticize is the CPU. The manufacturing costs of all those enhancement chips (which Nintendo already started to use from day 1) must have significantly outweighed the cost savings of using a weak CPU.
@dimitribottjen2495
@dimitribottjen2495 2 жыл бұрын
Yeah, the super Nintendo really does make sounds
@LeviathanRX
@LeviathanRX 2 жыл бұрын
Hehe K-On! register makes SNES sound samples go BRR
@CraftMine1000
@CraftMine1000 2 жыл бұрын
Samples go brrrr
@heterodoxagnostic8070
@heterodoxagnostic8070 2 жыл бұрын
SNES go Brrrrrr.
@JamesLewis2
@JamesLewis2 2 жыл бұрын
SPC700 go BRR
@CoderQC
@CoderQC 2 жыл бұрын
By the way, hearting and pinning comments increase likelihood of more new people watching your video.
@crushermach3263
@crushermach3263 2 жыл бұрын
Who here misread the title and thought this was a creepypasta about an abandoned factory with moving graffiti at first? lol
The SPC700 DSP Pipeline Explained - SPC700 Series pt. 4
17:05
Retro Game Mechanics Explained
Рет қаралды 27 М.
Data Redundancy Errors Explained
22:42
Retro Game Mechanics Explained
Рет қаралды 278 М.
Disrespect or Respect 💔❤️
00:27
Thiago Productions
Рет қаралды 41 МЛН
Молодой боец приземлил легенду!
01:02
МИНУС БАЛЛ
Рет қаралды 1,7 МЛН
ТВОИ РОДИТЕЛИ И ЧЕЛОВЕК ПАУК 😂#shorts
00:59
BATEK_OFFICIAL
Рет қаралды 5 МЛН
The Sound Capabilities of the SNES
7:42
GST Channel
Рет қаралды 68 М.
Atari's Quadrascan Explained
20:57
Retro Game Mechanics Explained
Рет қаралды 191 М.
Why build an entire computer on breadboards?
28:43
Ben Eater
Рет қаралды 3,1 МЛН
Hardware interrupts
27:36
Ben Eater
Рет қаралды 601 М.
Racing the Beam Explained - Atari 2600 CPU vs. CRT Television
38:26
Retro Game Mechanics Explained
Рет қаралды 285 М.
SPC700 & ARAM - Super Nintendo Entertainment System Features Pt. 10
15:06
Retro Game Mechanics Explained
Рет қаралды 72 М.
Using Lakitu's Cloud to Defeat Bowser Quickly
1:12:55
Retro Game Mechanics Explained
Рет қаралды 336 М.
All About Frequency Synthesis
36:06
maxim integrated
Рет қаралды 73 М.