KungFuFurby wrote:I'd be doubly happy with noise generation and pitch modulation (as well as the type of muting that allows pitch modulation to pass through). I've especially been a fan of pitch modulation lately, since I hacked SNESMod to add both noise and pitch modulation features for some of my songs.
Nice! I've been meaning to look into this whole pitch modulation stuff. Any plans to release your changes to SNESMod?
I have the binary on hand, although my method of implementation would require a hex editor to test .spc files. I just simply copy the binary to its predefined location (where the SPC700 code is loaded), then put in a #$03 into #$01F4, and a #$01 into #$01F5. If you want to start anywhere other than order number zero, just modify #$01F7 to be your desired order number.
It's also not completely safe for video games because there aren't any checks for the sound effects on the last two channels (it's especially bad if noise were to be on those two channels... although pitch modulation can allow for some unusual effects to the music through the SFX if you want really unusual magic.). Technically I could make it public, but it would come with a few caveats... one of them being global volume should always be maximum, or else your pitch modulation might be weak. Technically the binary is already rippable if you look up my SPC files that use them. Just copy the data from #$0500-#$1AF6 in the SPC file and paste them into your own compiled copy (or save it for SNES ROM use) and there you go, your own SNESMod with pitch modulation and noise. But for everyone else's convenience, I'll just put the binary up here:
Get SNESMod with Pitch Modulation (.bin format)
The amount of bytes this takes up is dangerously close to where the module file starts (at #$1B00 in the .spc file)... a mere 10 bytes left. Thus, I would have to update the source code for the converter if I were to make additional modifications to account for pointer modifications to the module (and I can't build Windows or Intel Mac binaries from here because I have XCode 2.0... yeah...).
You need your instructions for how to apply pitch modulation to your modules and all you need are these brand new effects (not used by Impulse Tracker):
S05 ~ Turn on pitch modulation for one channel
S06 ~ Turn off pitch modulation for one channel
S07 ~ Turn on pitch modulation for all channels
S08 ~ Turn off pitch modulation for all channels
S09 ~ Turn on noise generation for one channel
S0A ~ Turn off noise generation for one channel
S0B ~ Turn on noise generation for all channels
S0C ~ Turn off noise generation for all channels
S1x-S2x ~ Noise frequency (take away 10h to get your frequency)
Warning: Noise frequency applies to all channels that have noise on
S92 ~ Mute channel (but still give it an output for pitch modulation)
S93 ~ Unmute channel
These might overlap with unofficial add-on effects that have been applied since the original Impulse Tracker... but SNESMod doesn't support those effects in the first place. Thus, I use them for the bonus features instead. They might affect playback when you're originally making the song in an unintended fashion, just to note.
I am able to get away with this for pitch modulation and noise generation because of the DSP register setup, which means I simply recycle the echo code with some parameter modifications. Since SNESMod uses gain to fool around with the volume, I can simply zero out the actual volume to perform the channel mute that allows pitch modulation to pass through.
I end up doing many more builds when using pitch modulation and noise because I have to double check and make sure they're not accidentally carrying over to other channels (plus, I have to make sure they sound good). I actually have a very good sine wave on hand if anyone wants it in either .brr format or in an .it module (it uses a non-zero loop point because I couldn't get a proper sine wave with a loop point at the start of the sample). I also have my own set of pulse waves that I use for my SNESMod songs that I manually created through creating them in a hex editor then saving as .txt and raw importing them into Schism Tracker.