ChanServ changed the topic of ##yamahasynths to: Channel dedicated to questions and discussion of Yamaha FM Synthesizer internals and corresponding REing. Discussion of synthesis methods similar to the Yamaha line of chips, Sound Blasters + clones, PCM chips like RF5C68, and CD theory of operation are also on-topic. Channel logs: https://freenode.irclog.whitequark.org/~h~yamahasynths
<cr1901_modern>
>freezer type things for the msx
<cr1901_modern>
?
<cr1901_modern>
Why would you want to make your msx cold?
samlittlewood has joined ##yamahasynths
<cr1901_modern>
cc: ValleyBell if you're awake
<cr1901_modern>
samlittlewood is the person who bought the CM32P for dumping :)
<Foone>
the argonaut Sam Littlewood?
<cr1901_modern>
Indeed
<cr1901_modern>
(He was in #nmigen and I asked him to stop by)
<Foone>
small world. I've bugged them about argonaut stuff in the past, because I do a lot of work in BRender reversing
<samlittlewood>
hi, yup - ah yes!
<samlittlewood>
sorry I didn’t have any of the sdks etc :(
<Foone>
that's okay! I wasn't really expecting anybody to still have them, I was just trying to cover all the bases
<cr1901_modern>
Foone: Indeed it's a very small world. Carl Graham (one of the SuperFX architects) uses solvespace sometimes and I'm like "that's an interesting amount of crossover in my circles"
<samlittlewood>
and i belevee you were talking to DanP a bit ago?
<Foone>
yeah! I talked to them as well. I think I met them too, at one of the Vintage Computer Festivals
<cr1901_modern>
What years did you work for argonaut?
<cr1901_modern>
I know Carl was there till ~2004 b/c he mentioned developing Catwoman: The Game (wow)
<samlittlewood>
1990 to 1997 iirc - i joined just after sg2 shipped to do pc ports, and stayed until arc split off. I think Carl joined just before me - I shared offices with for for a fair amount of that!
<samlittlewood>
He and Pete Warners were working on the orignal NESGlider when i joined them - fairly wild wireframe rendering on nes.
<samlittlewood>
(Warnes)
<cr1901_modern>
The 3d editor for NESGlider was on the NES itself, correct?
<samlittlewood>
err, sort of - there was a visualiser, but mostly Danny Emmett would work on paper and just type coords in.
<samlittlewood>
this was tbe kinda bytecode style renderer, so each model was (roughly) an handwritten program (esp, if it involved animaiton)
<cr1901_modern>
Is postscript language a decent analogy?
<samlittlewood>
(hmm, i think danny also had an ST with a basic viewer he wrote as well,
<cr1901_modern>
If your model is symmetrical about the z-axis, I could see myself doing models on paper
<samlittlewood>
well, waaaay simpler, it started with a bunch of ops to generate the vertices - you could just submit n * xyz, but usually, there were operations for symettry, repetition etc.
<samlittlewood>
and short forms where you could just pull vectors out of the matrix for cubes etc.
<samlittlewood>
animation was (again iirc) an op that did peicewise lerp between a set of points, based on a value from the object block
<cr1901_modern>
what do you mean by "pull vectors out of the matrix for cubes"?
<samlittlewood>
yup - any sort of symmetry was exploited to the max (and the model design maigh be tweaked to maximize that)
<cr1901_modern>
(also admittedly Idk much about brender, but if Foone is interested in it, I imagine it's a good piece of history to preserve)
<Lord_Nightmare>
byuu was interested in doing a high level high-res reimplementation of the rasterizer from the superfx argonaut 3d games
<samlittlewood>
given the 3x3 rotation part of the model matrix, you can just just the rows as a unit vector in x, y and z - a bit of shifting and anding can get you a few points sutiable for making a simple object (bush, bullet, explosion etc.) without the full vector * matrix work (kinda think of it as optimsed multiples)
<samlittlewood>
.. just use the ...
<cr1901_modern>
ahhh hmmm, I'll have to play w/ that
<samlittlewood>
that’s be really cool if there was an hle style renderer for those games!
<cr1901_modern>
The patent has enough information for how the rasterizer works
<cr1901_modern>
I asked Carl if he still had any internal SuperFX docs a while back- he said no. Pete Warnes doesn't have an online presence, and Ben Cheese, well, has been dead for a while :(...
<samlittlewood>
well, I think ‘Formal Process’ and ‘Documentaiton Trail’ were things that really never happend on that project - more like downhill skiing whist trying to invent skis iirc.
<Lord_Nightmare>
there's a rumor that the 'original' leak of the beta star fox 2 was actually really a leak of source code and the psyq compiler, which someone managed to (mostly) build (except the multiplayer part) and then aeon genesis translated it
<samlittlewood>
Ben was very good - he and Rob designed the whole thing in schematic cap. (orcad iirc)
<cr1901_modern>
Rob?
<Lord_Nightmare>
the final star fox 2 build (which finally got released on the snes classic) was almost a year newer than the beta build, I think
<cr1901_modern>
And yes, "more like downhill skiing whist trying to invent skis iirc" matches what I heared
<samlittlewood>
Rob Cranmer-Gordon - Ben’s assistant.
<Lord_Nightmare>
so if that rumor is true, the superfx rasterizer source code is probably still out there, at least for star fox 2
<cr1901_modern>
Lord_Nightmare: Yea a few ppl have the Star Fox 2 source code
* cr1901_modern
does not
<cr1901_modern>
Ack re: assisstant
<Lord_Nightmare>
I don't either. I know someone who claimed to, but I had no idea if they were pulling my leg or not
<Lord_Nightmare>
I guess they were not
<samlittlewood>
jeez - i remeber when sfx2 got canned - iirc Dylan being very very * e6 pissed.
<cr1901_modern>
e6?
<cr1901_modern>
ahhh
<cr1901_modern>
exponent
<Lord_Nightmare>
*10^6
<samlittlewood>
Um, from waht i remeber it was not super legible at the best of time
<cr1901_modern>
? But Dylan writes great code always :P
<cr1901_modern>
(if he ever sees this msg... hi)
<samlittlewood>
*cough* great games
<cr1901_modern>
lol
<cr1901_modern>
Carl told me the SuperFX was not a fun or smooth project and by the end everyone was just ready to move on by the time it was ready. Perhaps ditto with Far Stocls
<Lord_Nightmare>
I think I have copies of all but one or two of the superfx games
<Lord_Nightmare>
there's a rumor that the superfx was supposed to ship on the final snescd (sony?) version, on the cartridge
<Lord_Nightmare>
and after nintendo canned that, on the snescd (philips) version
<Lord_Nightmare>
i have no idea whether either is true
<cr1901_modern>
SuperFX was also supposed to have multiplexing w/ the ROM bus such that the SNES CPU and the SuperFX could run at the same time while both taking turns accessing the ROM
<cr1901_modern>
at the cost of half speed*
<samlittlewood>
um, from very distant memory “sort of” - Argonaut was very keen to sell it in, and I think some level of approval within Nintendo, bit I don’t think it was a final deal (or at least the while thing went to crap before it was all finalised)
<Lord_Nightmare>
I also had no idea that neil baldwin did music for some of the argonaut games (at least for the unreleased 'death track' for gameboy, which hiddenpalace recently found a very early beta of)
<samlittlewood>
We went on to hawk the hardware around to a whole bunch of customers (incl. philips), improving it with each iteration
<Lord_Nightmare>
I know neil baldwin's music from the (also unreleased) heroquest for nes, and a bunch of other games
<samlittlewood>
cripes - not that is a name i have not heard for a while - yes - that sounds right
<samlittlewood>
(tho music and sfx those days was very much “crap - 2 weeks to launch, we need some music”
<cr1901_modern>
hah...
<cr1901_modern>
Was brender used for the Star Fox models or was that still the NESGlider phase of 3d modelling?
<Lord_Nightmare>
death track was also called 'trail blazer' at some point
<samlittlewood>
also been in more than one late stage game meeting where we were over memory budget, and somebody goes “yeah - easy, just halve the audio sample rate and drop to 8 bit” - everybody else goes “Cool!”, and you see the light fade out of the sound guy’s eyes.
<cr1901_modern>
:(
<samlittlewood>
brender was well after starfox - iirc, sfx used my bsp shape compiler from the pc renderer
<cr1901_modern>
Sounds about right- I learned about BSP- and a computer gfx presentation on the topic- just so I could grok the Star Fox models.
<samlittlewood>
brender (q3d was it’s internal name) was kinda a reaction to the hand wrangled bsp renderers written in asm
<cr1901_modern>
an intro to computer gfx*
<Lord_Nightmare>
I can definitely see that. b. heineman has said that they had some major issues getting the 'another world' port working on snes; at first they used a hand-reverse-engineered superfx cart, but were told by their boss that they couldn't use that for cost reasons, then moved to a cart with sram for double buffering, again nixed for cost reasons, then to a fastROM cart, again nixed for 5 cents per cart savings, and finally they had
<Lord_Nightmare>
to resort to some clever hacks executing code out of the ppu registers to get the max snes cpu speed
<cr1901_modern>
samlittlewood: Re: sound, I supposed even simple compression in real time wasn't feasible?
<samlittlewood>
cr1901_modern: not my expertise, but i suspect if someone had actually cared, then yes, maybe. I remember the sony audio part being seen as just this black box, and just taking audio blobs from the sfx and music guys. We did have somebody - Martin Simpson, who was starting to do more aggressive audio programming.
<cr1901_modern>
On the SNES at least, samples are already inherently compressed due to highly proprietary Bit Rate Reduction (tm) technology
<samlittlewood>
I think he started to make a difference with king arthur’s world - things like dolby encoding.
<cr1901_modern>
I was thinking maybe you were cutting NES samples down to 8-bit
<cr1901_modern>
(Also I didn't know the SNES sound chip could work w/ 16-bit samples... I thought 8-bit samples were a Sega CD thing)
<cr1901_modern>
w/ 8-bit samples*
<samlittlewood>
ah the cases i remember were later pc games - before cds, and it wasn’t so much about the absolute size, more that you were about to bust over to another disk, and the duplicators/artwork had already been booked :(
<Lord_Nightmare>
there's been some debate about what encoders were used for the sony BRR(SB-ADPCM) format on snes games
<cr1901_modern>
Isn't BRR "just" a linear prediction filter?
<cr1901_modern>
(whose error is minimized over the squares of samples of some test function?)
<Lord_Nightmare>
I know from one of the EA Tiburon (NHL94 etc) programmers that they wrote their own encoder, which worked similarly to the encoder Kode54 wrote about 15 years ago for the homebrew snes scene (encode each block 4 times using the 4 different filters, using least squared error and find whichever version has the lowest error)
<Lord_Nightmare>
the Sony encoder (which I think came on a floppy disk or disks with the "SNES EMULATOR SE" early devkits) works differently using some sort of shaped-noise error feedback mess, which is described both in a patent, and in the CD-I green book and CD-XA yellow book annex, as both of those formats are also block sub-band adpcm codecs closely related to the SNES BRR scheme
* cr1901_modern
files that away for later as "beyond his current skillset"
<Lord_Nightmare>
the gamecube's ".dsp" format is ALSO a sub-band adpcm codec, as is the sony playstation's SPU codec
<Lord_Nightmare>
but they're the simplest possible sub-band codec, with effectively "two" bands, one "band" being the range/filter setting for the block, and the other "band" being the block data itself
<kode54>
actually
<kode54>
I encode each block 4 * 12 times
<Lord_Nightmare>
its not 'really' a sub-band codec
<kode54>
to also find the best scale factor
<Lord_Nightmare>
but its close enough to one to be considered one
<kode54>
it was based on an MS ADPCM encoder from SoX, which used brute force and least mean square error scoring
<cr1901_modern>
kode54: When I'm ready to tackle it, I'll ask you more about the encoding if that's okay? I don't currently have the spoons to parse everything LN and you are talking about right now lol
<Lord_Nightmare>
atrac3 and g.726 are REAL sub-band codecs with multiple bands
<kode54>
I later added a method to weigh in the history samples from the block preceding your requested loop start, so it can attempt to smoothly loop into that as well
<Lord_Nightmare>
kode54 interesting!
<Lord_Nightmare>
that's very neat, I may need to ask you about that later
<kode54>
a trick I had to learn from the ADX encoder, but now know:
<Lord_Nightmare>
I'm eventually going to try to implement a 'reference' brr codec based on the sony patent thing
<kode54>
the reason you sometimes get files that are "44099"HZ
<Lord_Nightmare>
just to compare to a 'best possible' codec like the one you did
<kode54>
to make the file an even number of sample blocks, they'll shrink the file to fit, using a resampler
<kode54>
then scale the file sample rate
<Lord_Nightmare>
also did you do any sort of sample lookahead type deal where you encode samples in '3 sample blocks' and try to minimize total error even if the local error for this sample is slightly larger than it would otherwise be?
<Lord_Nightmare>
this only works if filter is 1,2 or 3
<kode54>
no, didn't consider that
<Lord_Nightmare>
filter 0 would always have a fixed error regardless of prior samples
<kode54>
it worked only on a block-by-block basis
<Lord_Nightmare>
since it ignores prior samples
<kode54>
apparently, Yamaha's ADPCM encoder works in a similar way
<kode54>
pure brute force, block-by-block
<kode54>
also neat
<kode54>
all the antivirus vendors are conspiring together to find the most viruses in all my newly released software
<kode54>
apparently, my totally fresh VM only installed with official software packages direct from their respective vendors
<kode54>
is the one way ticket to a dozen detections on literally everything I ever publish now
<kode54>
the only thing that doesn't detect it is the Microsoft Windows Defender that's running on the VM
<cr1901_modern>
One day I hope ReactOS can replace XP w/ the newer APIs but still run on XP-only hardware
<kode54>
so throw out all new instruction sets, or make everything that uses them completely optional with runtime detection
<cr1901_modern>
Are there any other metrics besides least squares that can be/were used to optimized BRR samples? Perhaps metrics that make the samples sound well less... compressed?
<cr1901_modern>
If you listen to DKC soundtrack remasters compared to the SNES, there is absolutely a noticeable difference
<kode54>
that's only because the DKC soundtrack used an awful lot of low sample rate samples
<kode54>
about the only thing you can do to make so many samples fit into 64KB, and still have room for an echo buffer, player code, and sequence data
<kode54>
remove the memory limitations, and you don't need to downsample anything
<cr1901_modern>
ahhh and here I thought the lossy compression of BRR made a noticable difference in sound quality.
<kode54>
not really
<kode54>
no more than IMA or MS ADPCM
<cr1901_modern>
TIL :P
<kode54>
but you're still feeding the output through a gaussian filter function
<kode54>
mainly because almost everything needs to be upsampled
<kode54>
early SNES emulators sounded TERRIBLE because they had nearest / zero order hold resampling
<kode54>
no interpolation, and everything sounds even worse
<cr1901_modern>
DarkenZero's Chrono Trigger vid for early ZSNES is a good example of how bad things used to be
<cr1901_modern>
16-bit => 8-bit also makes a difference in sound quality? I was under the impression _that_ was the problem w/ Sega CD/Sonic CD
<Foone>
god. I remember the first time I played chrono was on that old zsnes, where it couldn't do transparency yet
<Foone>
so if I was in a place with clouds, they were opaques, so I had to toggle that layer off
<cr1901_modern>
since Salad Plain past sounds fine, but Palmtree Panic past sounds muffled.
<cr1901_modern>
It's hilarious in retrospect though just how bad it was :P
<cr1901_modern>
It's a good example of why accuracy matters
<Lord_Nightmare>
as for yamaha adpcm vs ima and oki adpcm, the algorithms are actually quite similar, both based on jayant's 1973 paper
<Lord_Nightmare>
yamaha adpcm uses a single multiply by one of 5 step size scaling factors per sample (0.9, 1.2, 1.6, 2.0, 2.4), while oki and ima use a ROM holding a table of floor(16 * (pow(1.1, i)))
<Lord_Nightmare>
and oki and ima move forward or backward indices through that table by -1, 2, 4, 6, 8 corresponding to 0.9, 1.2, 1.6, 2.0, 2.4
<Lord_Nightmare>
but its not a 1:1 equivalency
<Lord_Nightmare>
yamaha used an oki-like adpcm format for certain channels (ADPCM_A) on the ym2608 and ym2610 chips, and there they used an oki-like system, except it used the index changes of -1, 2, 5, 7, 9, which is actually MUCH CLOSER to the 0.9, 1.2, 1.6, 2.0, 2.4 thing than the oki/ima version is, only 2.5% error max
<Lord_Nightmare>
ima adpcm is the same as oki, except instead of using a 12-bit accumulator and a 49-entry lookup table with i starting at 0 for entry 0, they use a 16-bit accumulator and an 88-entry lookup table with i starting at -8 for entry 0
<Lord_Nightmare>
otherwise its the same as oki
<Lord_Nightmare>
so this means common adpcm formats boil down to 4 types: jayant-derived with a multiply (yamaha adpcm), jayant derived with a lookup log table (oki, ima/dvi), primitive sub-band block formats with a filter and range (SNES BRR, CD-XA, CD-I, Sony SPU, Gamecube DSP, Sunplus ADPCM36), and true sub-band formats (G.726, ATRAC/ATRAC3, SBC)
* cr1901_modern
files this away for later
<cr1901_modern>
should help me tackle ADPCM if I can recognize subtypes
<Lord_Nightmare>
there's also CVSD which can be thought of as a degenerate case of 1-bit jayant adpcm, except separating the actual data and sign requires two analog or digital filters from the one bit, otherwise its basically just delta modulation
<Lord_Nightmare>
oh, there's one more codec, which kode54 mentioned: MSADPCM; this is a hybrid codec: it has an optional IIR filter like primitive sub-band adpcm formats, but otherwise uses a 4-bit jayant codec closely related to yamaha adpcm except the nybbles are 2's complement instead of sign-magnitude like every other jayant-derived format is
<Lord_Nightmare>
so it has some advatages of both codecs
<Lord_Nightmare>
Foone: krick got back to me and said "That's awesome news. My driver disk was actually stolen from my u-haul when I was robbed during a cross-country move and I was wondering if one would ever turn up as I don't think they were that many Action Replay PC units made/sold. The Action Replay PC was a straight-up donation to the cause. It's yours now. I don't need or want it back. Do with it whatever you guys need to do in order to
<Lord_Nightmare>
reverse engineer it. I don't think my participation would add anything."
<kode54>
what the fuck
<kode54>
who the fuck holds up a moving truck
<kode54>
literally highway robbery
<cr1901_modern>
huh...
<cr1901_modern>
Lord_Nightmare: Well krick is still welcome to join here if they want.
andlabs has quit [Read error: Connection reset by peer]
andlabs has joined ##yamahasynths
andlabs has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
andlabs has joined ##yamahasynths
andlabs has quit [Ping timeout: 240 seconds]
andlabs has joined ##yamahasynths
Xyz_39809 has quit [Ping timeout: 268 seconds]
andlabs has quit [Read error: Connection reset by peer]