Deprecated: mysql_connect(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in /storage/content/49/145849/famitracker.com/public_html/forum/classes/dbHandler.php on line 29
I've been working on proper FDS modulation for the NSF importer, and I discovered that the way FDS modulation sounds in FamiTracker is very different from other players.
I've attached an example, which is taken from track 19 of the FDS Zelda 2. If you play it in FamiTracker it sounds very different than if you export the NSF and listen to it with a different player.
I tried NotSoFatso, NSFPlug, VirtuaNES, and Nestopia, with the original NSF and the one exported from this FTM, and they give a consistent sound. FamiTracker seems to be the odd one out. (The NSF import and export process seems to be fine, since I get the same values in if I import the exported NSF, and it sounds just like the Zelda 2 original in the exported NSF.)
One thing I've noticed is if I draw a square shape in the mod table, it doesn't sound like a square at all, it rises and falls smoothly. Is this what it's supposed to do? (I'm not super familiar with how it's supposed to work yet.)
BTW, for FM, you're not using the I0x Jxx commands properly.
Re: mod shape
It's basically the modulator wave of FM. Except that instead of choosing only between the default sine and the rectified sine, you can draw your own wave (in modular synth terms, this means a custom LFO!)
Your carrier wave's frequency would only drop if the grid is asymmetrical. Kinda like a |1 1 -1 pitch macro will keep rising. Keep in mind that the blue position resets the freq back to the normal carrier wave's freq.
So, for example, you have the note A-4 440hz playing and if your table looks like a solid green line at position +3 with the very last value being the blue value, then for every cycle of the modulator wave, the freq should rise and rise to something like 1000hz until it reaches the end of the cycle, at which it'll reset back to 440hz. And then it'll repeat the cycle of those freqs.
I don't know exactly how the mod depth works though. But it's always nice to leave the instrument's mod rate definition blank so you can control it with a value of IJJ (only the last digit of Ixx is valid, since FDS can only go up to freq FFF)
Another example from Zelda 2 FDS. This time track 21. Compare how the attached file plays in famitracker to its exported NSF in other players, and here's a video of a real FDS making that sound:
XYZ, I'm not sure what you're getting at. My post is about how the FDS in FamiTracker sounds very different from a real FDS and many emulators. What are you addressing with your comment?
I did attempt FM synthesis in FamiTracker in an earlier post, but that has nothing to do with what I've just posted in this thread. These are real world FDS usage examples taken from Zelda 2. (How am I using these effects wrong? That seems a bizarre thing to say about this.)
I was addressing this
"One thing I've noticed is if I draw a square shape in the mod table, it doesn't sound like a square at all, it rises and falls smoothly. Is this what it's supposed to do? (I'm not super familiar with how it's supposed to work yet.)"
Here's an example. This is a square wave mod table. The pitch rises and falls smoothly. Additionally, the central pitch is well above the specified pitch, which is not what you'd expect. If you export to NSF and play back with one of the emulators I mentioned, you get much sharper changes of pitch, and also it remains centred as I would expect.
After reading Disch's documentation, the mod table doesn't directly control a pitch offset, but controls a counter (which kind of integrates the mod table) which in turn directly controls the pitch offset.
If you write an unbalanced table (e.g. more up than down) the counter will eventually overflow, and you get a saw-wave kind of effect. (You can also make the counter jump to 0 with the reset value at the bottom row of the mod table grid.)
So anyhow... a square wave mod table shouldn't be a square vibrato, per say, because of that integration, but I think the changes should still be fairly sharp. FamiTracker only produces a very smooth change.
The reason I choosed nezplug's FDS code was because it sounded better with some NSFs and then I also assumed it was more accurate, but I haven't compared with real FDS recordings. I actually used my own code earlier which was based on Disch's document. This was in my NSF player, before FDS was available in Famitracker.
Anyway this clearly indicates some problem with the emulation and I'm not that familiar with the FDS code so I'm not sure where to start looking, if you have any ideas then I'd be grateful. The only thing I can think of at the moment is that the modulation counter is reset after each complete cycle, I don't know if that is correct. I'll also try to switch back to my old code and see if it works better.
Yeah, I was quickly kind of confused by the code in there. A lot I didn't expect to see, like all the logarithm conversions, FM_DEPTH, not sure what FDS_DYNAMIC_BIAS means because in this implementation the .bias member doesn't seem to change unless you write it via 4085. There's a bunch of #if 0 code where I'm not sure why one version is used over another, and there's no comments...
As far as I can tell it tries to calculate the offset counter when you write new entries to the mod table, rather than doing it as it cycles through the table, which as you've mentioned resets the counter each cycle (doesn't seem like the right thing to do, since there's two ways to explicitly reset it).
I'll try fixing the modulation counter, and I'll let you know how it turns out. If that doesn't work, maybe a rewrite is in order.
My old code didn't work better so there might also be something else going on. I also tried some emulators but the only one that seemed somewhat correct was Nestopia, did you notice that too?
Btw, I own an FDS unit so I can probably run some tests if necessary.
Okay, so I rewrote the modulator code for FDSSound.cpp to match Disch's document, and the results now sound very much like what I hear in the other emulators. (WAV output attached.)
I can check this in to the SVN repo if you like. Otherwise, I've attached the changed file for reference.
I tested it in my NSF player and did some research (finding more videos with recordings of FDS games) and this indeed seems more accurate than nezplug's implementation after all, so it should be all ok to check in.