Bad Apple demo for SNES
Moderator: Moderators
Forum rules
- For making cartridges of your Super NES games, see Reproduction.
Re: Bad Apple demo for SNES
Then what's the impulse response of your expensive prefilter? For example, if I pass the sample [..., 0, 0, 16384, 0, 0, ...] through it, what do I get?
-
- Posts: 3197
- Joined: Wed May 19, 2010 6:12 pm
Re: Bad Apple demo for SNES
I think I'll just stick to plain vanilla 16kHz BRR for now.
Re: Bad Apple demo for SNES
...I'm really not thinking things through here. I'm chronically behind on my research, so I end up in a mild panic whenever I do anything else.tepples wrote:Then what's the impulse response of your expensive prefilter? For example, if I pass the sample [..., 0, 0, 16384, 0, 0, ...] through it, what do I get?
The impulse responses are different for different input frequencies, as I mentioned earlier. I only did 16 and 32 kHz; here are the full impulse responses at 24-bit resolution:
The 16 kHz one clipped when I used 50% amplitude as an input, so I went with 25% for both.
Since the filtering is done at the specified input sample rate, rather than at a higher rate for later resampling, the 16 kHz one should be applicable at a range of sample rates as long as they don't approach 32 kHz. If the response near 32 kHz works the way I suspect it does, it's probably not hard to come up with a differential filter that could be applied before resampling or something like that, so that the lower-rate filter would then work across the whole range, but I really have to stop this for the moment and do some work...
That's probably a good idea. In addition to complicating the sound driver, this scheme requires somebody to do a lot of fiddly sequencing; I really don't have the time right now and I can't really ask anyone else to do it. (I was hoping someone with actual SPC700 expertise would take an interest and volunteer, but...) Plus, since it doesn't require any extra CPU time, it won't disturb the video codec, meaning it shouldn't be especially hard to add in later.psycopathicteen wrote:I think I'll just stick to plain vanilla 16kHz BRR for now.
How do you plan to stream the audio?
Re: Bad Apple demo for SNES
I hesitate to bump this thread, but I don't want this stuff scattered around the forum, and anyway it's not a whole lot less relevant to the topic than it was the first time...
I've modified my 16 kHz filter slightly, adding a very narrow 1.1 dB cut at 7,860 Hz. You might not hear a difference, but it now meets the +/- 0.2 dB ripple spec right up until the plot starts to go nuts in a case-dependent fashion a little past 7.8 kHz. The IR is significantly longer than the first version, possibly because the new filter is very steep, or possibly because I ran out of filter slots in PLParEQ3 (it's in the name) and had to use a second instance, so the up- and down-sampling was done twice.
The new sample is well over a second long, with the result that the whole sample pack is now 54,468 bytes. It's not all that tough to get a half-decent-sounding loop, but I'm probably not going to try to optimize until it's clear there's a need.
Oh, and the new sample is much louder than it should be with respect to the other samples, because it was synthesized rather than lifted from the (CD version of the) track itself. My excuse is that it's better to use one's ears at mix time rather than attempting to gain-correct things a priori and getting them slightly wrong but not wrong enough to notice until it's too late...
I've modified my 16 kHz filter slightly, adding a very narrow 1.1 dB cut at 7,860 Hz. You might not hear a difference, but it now meets the +/- 0.2 dB ripple spec right up until the plot starts to go nuts in a case-dependent fashion a little past 7.8 kHz. The IR is significantly longer than the first version, possibly because the new filter is very steep, or possibly because I ran out of filter slots in PLParEQ3 (it's in the name) and had to use a second instance, so the up- and down-sampling was done twice.
Never mind; it wasn't that tough after all. A high-frequency sine wave with strong triangle LFO pitch modulation at ~18 Hz seems to work well enough, particularly with some reverb added.93143 wrote:I'd kinda like to be able to do the squiggly synth sound that sometimes accompanies the crash at the beginning of a section, but it's very difficult to isolate and I don't believe in my ability to reconstruct it from scratch (I'm not a synth guy)...
The new sample is well over a second long, with the result that the whole sample pack is now 54,468 bytes. It's not all that tough to get a half-decent-sounding loop, but I'm probably not going to try to optimize until it's clear there's a need.
Oh, and the new sample is much louder than it should be with respect to the other samples, because it was synthesized rather than lifted from the (CD version of the) track itself. My excuse is that it's better to use one's ears at mix time rather than attempting to gain-correct things a priori and getting them slightly wrong but not wrong enough to notice until it's too late...
Last edited by 93143 on Tue Mar 03, 2015 10:19 pm, edited 1 time in total.
-
- Posts: 3197
- Joined: Wed May 19, 2010 6:12 pm
Re: Bad Apple demo for SNES
Is there some kind of glitch in BSNES that doesn't allow the 65816, SPC700 and DSP to do be properly synced at the same time? I can get it to run code that alters the BRR samples in real time, and have the 65816 transfer data to the SPC700 in real time, but not both at once.
Re: Bad Apple demo for SNES
That's exactly why. The sharper the filter, the longer it takes to determine whether any given input frequency is affected or not.93143 wrote:The IR is significantly longer than the first version, possibly because the new filter is very steep
-
- Posts: 3197
- Joined: Wed May 19, 2010 6:12 pm
Re: Bad Apple demo for SNES
http://s000.tinyupload.com/index.php?fi ... 8411147693
http://www.megafileupload.com/796/BadApple.zip
I got the music working, but it doesn't use the HDMA trick.
http://www.megafileupload.com/796/BadApple.zip
I got the music working, but it doesn't use the HDMA trick.
Re: Bad Apple demo for SNES
Cool. Getting closer...
Are you just using a tight loop then? That would certainly explain the extra slowdown. The reduced pitch does make it nicer to watch through to the end, since it kind of stays in sync (it crashes to a garbage screen after finishing).
Also, there seems to be fairly regular popping in the audio, which I assume is not part of the data itself. Could it be related to bank boundaries?
How much spare CPU time do you have without the music? Did you manage to completely eliminate the slowdown? I figure it should be possible to use HDMA to get the audio overhead down to a few percent of a frame.
Are you just using a tight loop then? That would certainly explain the extra slowdown. The reduced pitch does make it nicer to watch through to the end, since it kind of stays in sync (it crashes to a garbage screen after finishing).
Also, there seems to be fairly regular popping in the audio, which I assume is not part of the data itself. Could it be related to bank boundaries?
How much spare CPU time do you have without the music? Did you manage to completely eliminate the slowdown? I figure it should be possible to use HDMA to get the audio overhead down to a few percent of a frame.
Re: Bad Apple demo for SNES
Hi guy, you have a full lz4 compressor(PC side)/decompressor for 65816 here :psycopathicteen wrote:I had difficulty programming the compression encoder, since I am not used to high level languages.Speaking of which, how's that Bad Apple demo going?
I did notice that it can be compressed a lot, just by doing RLE on 8x1 slivers in a vertical direction. Using per pixel LZSS looks a bit overkill to me.
http://www.brutaldeluxe.fr/products/crossdevtools/lz4/
All is very well explained,if it can help you .
Re: Bad Apple demo for SNES
Cool to see it happen, really close indeed, well donepsycopathicteen wrote:http://s000.tinyupload.com/index.php?fi ... 8411147693
http://www.megafileupload.com/796/BadApple.zip
I got the music working, but it doesn't use the HDMA trick.

I used No$SNS 1.5 to play it and i got some garbage in sound, i guess it comes from the emulator... which emulator is the best suited to emulate properly here ? Higan maybe ?
Re: Bad Apple demo for SNES
wahou, congrats i'am speechless, reallypsycopathicteen wrote:http://s000.tinyupload.com/index.php?fi ... 8411147693
http://www.megafileupload.com/796/BadApple.zip
I got the music working, but it doesn't use the HDMA trick.

Re: Bad Apple demo for SNES
I used higan (balanced, of course - my laptop can't keep up with accuracy core). It pops every few seconds, but nothing like the mess no$sns makes. And of course the pitch is a bit low; I assume this is a temporary measure to compensate for the slowdown.Stef wrote:I used No$SNS 1.5 to play it and i got some garbage in sound, i guess it comes from the emulator... which emulator is the best suited to emulate properly here ? Higan maybe ?
Snes9X freezes, and ZSNES doesn't even start. I can't run it on a real SNES; my Super Everdrive complains that the file is too big...
Re: Bad Apple demo for SNES
Cool thanks, i will try that on Higan then
Is there any flashcart supporting 8 MB file on SNES ?
Edit:
I guess i have my reply : viewtopic.php?f=12&t=4380&start=75

Edit:
I guess i have my reply : viewtopic.php?f=12&t=4380&start=75

Re: Bad Apple demo for SNES
SD2SNES and PowerPak can handle 8 MB or even 12 MB (the Star Ocean hack) just fine.
I should have checked more carefully; I thought the Super Everdrive could handle 8 MB, but the manual says 7 MB. Darn it...
I should have checked more carefully; I thought the Super Everdrive could handle 8 MB, but the manual says 7 MB. Darn it...
Re: Bad Apple demo for SNES
Too bad, i had the same surprise with my everdrive. I though it can handle 8 MB rom because it has 8 MB flash but it does only support 6 MB max :-/