Some games do a Zxx at the start of every DPCM sample (Akumajou Densetsu, TMNT2), though I personally feel this is bad practice; better to let the output level float and clip the first peak than introduce a pop.
So that explains why the importer automatically inserts an F-# 00 0 V00 in the noise channel & a note stop next to the initial Zxx command of the DPCM channel. I thought this was a bug at first, but then I realized that it's your way of correcting what you feel is a bad practice. Yet, (at least) two games existing/proprietary games used this technique in their original work.
I use that technique to control the triangle volume in my 2nd & 3rd WIP OST, but one thing I've noticed is that the clip in the 2nd frame of my MMC5 example sounds much louder than the actual pop that would have otherwise occurred without your correction (or so I've heard when playing around with the track).
Now, my question is this; if other more proper techniques for triangle volume control aren't readily available in FamiTracker (other than your recently-released DPCM volume control instrument), wouldn't it be better for users to select whether or not they want the importer to block out the first Zxx effect when importing NSFs? And wouldn't it be a bit better to import an NSF & analyze it with all its original flaws?
And why insert a note in the noise channel with 0 volume if the note stop is sufficient enough to negate the Zxx effect?
Here's the attached file; pardon the file name, as I initially though it was a real bug at first.
_______________________
Technology: the one thing that's hated & cursed at by all engineers, technologists, scientists & technicians!
The noise channel on the first frame is just whatever its state/pitch is on the first frame. I'm reading that stuff every frame, I just hide it if it's the same on subsequent frames.
The DPCM Z00 and stop are generally just part of the initialization routine of the NSF. If a DPCM sample gets played on the first frame, these might be different. I haven't written anything to "correct" bad practice; I'm not trying to subversively fix other games' NSFs. (Interestingly, some NSF players have an option to ignore DMC volume writes to suppress the popping.) I'm not really interested in providing options to turn off arbitrary parts of the NSF logging; I just want an accurate representation of what's in the NSF.
In order to use Zxx to control the triangle volume, you also have to not use DPCM samples (i.e. DPCM playback is just a hardware-automated form of Zxx). So far I have not seen any game that does this.
There is another weird thing that famitracker does, the note halt on DPCM is the only way to turn off the DMC (which is the event the importer is capturing), but FamiTracker also has an implicit Z00 in it. There's a config option to turn this off, though it doesn't seem to be working... In the NES code, halting the DMC does not implicitly Z00, so I have a problem representing this accurately in the import (unless you turn on the config option... which doesn't work right now unfortunately).
Also, for the record, I'm not aware of any techniques better than what we can already do in FamiTracker to control the triangle volume. Zxx or a ramp sample (well, if looping worked properly :P) is as good as it gets, I'd say.
Interesting; I also read that note on the if statement in JSR's code that's preventing the config option from working right.
As for the MMC5 file I've posted above, would it be safe to assume that the negating of the first Zxx effect of frame 00 (as played without a DMC sample) is a bug? I really didn't expect the importer to negate my DPCM ZFF when no DMC sample is played. I've also checked this with a VRC6 track that uses no samples whatsoever; check the attachments (vrc6_test.ftm & vrc6_test.nsf are the source files, while vrc6_test_negated_Zxx.ftm is the output).
_______________________
Technology: the one thing that's hated & cursed at by all engineers, technologists, scientists & technicians!
The importer isn't negating it at all; your Zxx is right there on the first row.
What's negating it is FamiTracker's note halt (---) with its implied Z00. Delete the halt and it'll work as expected. (Or fix FamiTracker and turn on the option to not do that.)
By the way the maximum value for Zxx is 7F, which is why it's not coming back up as ZFF.
The note halt's negating of the Zxx command was what I was talking about. I'm glad we've established that now.
As for the ZFF command being rendered as a Z7F, I know that's not a bug; once you go from Z00 to Z7F, the next value above (Z80) will be a repeat of the pattern.
In other words, Z00 to ZFF is exactly the same as Z80 to ZFF. That's also why, on some FTMs, you may see people alternating between Z80 & Z7F, instead of Z00 & Z7F (or they may even use Z00 & ZFF, or Z80 & ZFF).
_______________________
Technology: the one thing that's hated & cursed at by all engineers, technologists, scientists & technicians!
Edit: By "no", I mean that I will not answer questions about when a new version is going to be released.
Oh, fine then.
rainwarrior wrote:
Also, the new version (0.2) is released. See first post.
Thanks! I've already found some interesting stuff. I don't know if anybody else was aware of this - though judging from all the 100% accurate covers people made, I'm guessing probably not - but the SMB1 soundtrack uses the delta counter in every tune; sometimes it ramps from Z30 to Z00 during the first 30 frames, sometimes it's static at Z30 throughout the whole track. I've imported the entire soundtrack, here it is incase anybody wants to have a look for themself.
EDIT: re-uploaded because I had forgotten to remove a duty cycle envelope on the blank instrument.
I really like the option to choose the pattern length in advance. Thanks for implementing that!
I find that it makes it much easier to follow along. If you take the time to identify how many rows make up something like a 16th note (in the case of Silver Surfer track 1- 6), you can just multiply that number by 16* and now every pattern ( "frame" ) = 1 measure.
jrlepage that is really interesting. I never even bothered to look at SMB1, but there you go, that's the first time I've ever seen a game look like it's using Zxx for triangle volume control.
I suspect that in the real game with transitions between tracks, it would ramp back up to 30 at the beginning of the tracks that are showing a steady 30. (Whatever software counter is controlling it probably initializes to 30 on reset.)
However, very good job, rainwarrior. Altough I do not like the possibility of helping the thieves with this program, I must admit that it is very well done. :D
Any determined thief would use any method to extract anything they want, Delek. I mean; you've even proven to me that XM, MOD, IT & other chiptune files are actually firmware files to generate audio for specific chips (i.e.: MOD files are firmware files to generate audio for Amiga Paula sound chips). Yet, there are many tracker programs for different OSes that can open, edit & copy data from them directly.
And even without trackers, anyone can record WAV or MP3 files of any chiptune & plagiarize it regardless. In other words, even though your concern for copyright is well founded:
A. The whole chiptune & NES scene was founded on piracy (i.e.: reverse-engineering specifications that are otherwise a video game manufacturer's company secrets, as well as ripping music from already-existing games whose copyrights have never expired).
B. A plethora of devices & applications are founded on the need to save & copy information (such as optical disk drives, optical disk recording software & even audio/video tape recorders). You can't just do like Nintendo & tell companies like Panasonic & Nero that their products are illegal because they can be used for illegal deeds (especially when there's no legislation against it). Imagine if Nintendo & the ESA sued Panasonic & Nero for producing DVD burners & burning software; wouldn't that be ridiculous? Just because a DVD drive & recording software can be used to copy a GameCube disk/ISO, it doesn't make either product illegal; only the act of copying a game you're licensed to use for a purpose other than an own, personal backup is illegal.
C. The fact remains that there's no such thing as 100% security on any computer system of any kind; just as long as someone forges a lock, someone else will be tempted to forge their own key & eventually succeed. I feel that rainwarrior, JSR, 4chan's very own Anonymous & even the British Army (with respect to decoding scrambled Nazi messages from Enigma & Lorenz cipher macines) have proven time & time again that anything can be decompiled, reversed & hacked. It's just the fact that many computer users don't realize this & always expect 100% security out of 0% secure technologies.
Now, if there were some kind of a programming library to embed NSFs into EXEs that works like uFMOD, then you can create a PE executable with the NSF & pack it. That means the determined hacker will have to contend with decompressing/unscrambling obfuscated code before he can reverse it; that still doesn't mean that the compressed executable is unbreakable (the hacker can just reverse the PE executable packer's compression algorithm & create an unpacker).
_______________________
Technology: the one thing that's hated & cursed at by all engineers, technologists, scientists & technicians!