While working with Assault Suit Leynos 2, I've discovered that it makes a very good test case for properly emulating the SCSP's FM synthesis capabilities. Quite a few tracks use it with clearly defined carrier and modulator layers.

Here's a patch against AO SDK 1.1.6 with my interpretation of the SCSP manual's overly confusing FM section:

Patch currently withdrawn, see EDIT

The patch will definitely need testing against actual Saturn output (I myself haven't yet played enough of Leynos 2 to get to any stages that use FM-synth). Here's a test track from Leynos 2 that uses FM: http://h1.ripway.com/kingshriek/leynos2_modulation_test.zip. In the archive are two ssfs - one is the full track and the other is the FM voice only (a full modulation level of MDL=0xF is used).

Also in the patch is a small fix to the sampler step calculation. High OCT values (such as in pdz_11.ssf) were causing the calculation to roll over, so I changed UINT32 to UINT64.

-Updated modulation code, taking into account MDL (needs testing against actual hardware output)
-Changed frequency-step calculation to use UINT64 to fix rollover problems caused by large OCT values

Last edited by kingshriek; 12/16/07 05:08 PM. Reason: Discovered that Shinobi X makes a lot more use of FM - going to do some more testing