FDS instrument sequences & wave envelope

Post about feature requests here.
User avatar
Posts: 475
Joined: Thu Apr 23, 2015 7:39 pm
Location: Hong Kong SAR

FDS instrument sequences & wave envelope

Postby HertzDevil » Fri Oct 16, 2015 7:59 am

Please make it so that FDS instruments work like other instruments, i.e. the FDS instruments share sequences with each other, and have access to the hi-pitch and wave sequences (like N163). I remember that the reason for not implementing wave envelopes is that FDS always resets the phase of the output upon loading a new waveform, however it should be up for the users themselves to decide whether the phase click is too loud or not; generalizing FDS instruments to share the same structure as other instruments provides better abstraction for both the user and the programmer.

Here is a proof-of-concept build of FamiTracker 0.4.6 which does exactly this, with support for NSF export; multiple FDS instruments may use the same envelope, and each holds up to 16 waveforms. The attachment contains the main executable (FDS_seq.exe), source codes in C++ and ASM, as well as two testing modules.


Notes to users
  • Phase reset occurs when issuing any note while the current instrument uses a wave sequence, or when the currently active wave sequence steps to a new value. The Vxx effect works only if the current instrument does not use any wave sequence; this is the same behaviour as N163 instruments in official builds.
  • Because this is a fork of FamiTracker 0.4.6, all FTMs compatible with version 0.4.2 can be opened and saved; doing so will save all FDS instrument data into an INSTRUMENT_FDS block and a SEQUENCE_FDS block, both separate from the main instrument chunk. As long as the official build ignores unknown file blocks (this is what makes FTMs saved from forks readable), this makes FTMs from this build compatible with the official builds, except that all FDS instruments will not be loaded.
  • FTI save/load and text import/export for FDS instruments do not work in this build, because these formats do not have per-section version values. This build uses the same registry keys as the official builds, but does not create any new ones.
  • There are no plans to add instrument sequences of other types because these are beyond the scope of this feature request. This build is not meant to be a stand-alone fork of the official build either, as it only serves to demonstrate one possible implementation of the feature request.
Notes to programmers
  • Only the modified source files are included in the download. Changes from the original source are marked with // // // or ;; ;; ;;.
  • The INSTRUMENT_FDS block is provisional; a new INSTRUMENT block version should be used in which codes from CInstrumentFDS::Load and CInstrumentFDS::LoadNew are merged. CInstrumentFDS::SaveFile and CInstrumentFDS::LoadFile should be modified to handle the new instrument format; these can be leveraged from the corresponding N163 instrument methods.
  • CInstrumentFDS::m_pVolume / m_pArpeggio / m_pPitch are deprecated, as are their respective getters. They are only here because the text importer/exporter has not been modified to incorporate the new data format. CT_FDSMACRO may be merged with other CT_MACROxxx cases, CT_INSTFDS may need some extra work to save the number of waveforms in an instrument.
  • The slightly altered waveform editor dialog has been included, which defines 4 new resource identifiers: IDC_INDEX_FDS, IDC_INDEX_FDS_SPIN, IDC_WAVES_FDS, IDC_WAVES_FDS_SPIN. Forks that have created other resources may need to add these to resource.h before opening the project in Visual Studio. I did not use the N163 waveform editor that I wrote a few months ago for the FDS editor dialog here, since that is not crucial in demonstrating the new features of the test build. IDD_INSTRUMENT_FDS_ENVELOPE is unused, and can be removed.
Known issues
  • Loading existing FDS FTI files should work, but I did not work on that.
  • Deep-cloning FDS instruments probably does not work, but one can easily write the code for it in CFamiTrackerDoc::DeepCloneInstrument.
Again, please consider adding this to the official build, maintaining at least the instrument format (most of the format is taken from the VRC6/N163 counterparts so I do not see why how one would add this feature but make it incompatible with this implementation). I could simply create a pull request if there were a public repository of the FamiTracker source code, but there isn't one, so I have to include an implementation in the request thread itself. In the case this thread is moved to General Talk, take note that it was originally posted as a feature request, and that there were threads from the old forum also requesting these same features.
(445.04 KiB) Downloaded 132 times
refactoring 0cc-famitracker

User avatar
Posts: 422
Joined: Wed Jul 08, 2015 8:19 pm
Location: Fort Wayne, IN

Re: FDS instrument sequences & wave envelope

Postby iYamWhatIYam » Fri Oct 16, 2015 1:06 pm

I think this is a fantastic feature to have. Since I don't know what the hell I'm doing with the FDS waveforms, I feel this would come in extreme handy for users like me (especially if exporting to NSF is still very much feasible). Is this feature available in 0CC-FamiTracker, by the way?
I have permanently switched to 0CC-FamiTracker. If and when JSR decides to update vanilla FamiTracker at this point is entirely out of the question for me.

User avatar
Posts: 241
Joined: Fri May 15, 2015 1:37 am
Location: Nanamori-Chuu

Re: FDS instrument sequences & wave envelope

Postby w7n » Sat Oct 17, 2015 11:16 am

While in no doubt useful, the other feature that is almost definitely required for this is the expansion of instrument space in the NSF engine. I myself have expanded the instrument space in the NSF engine by 4 times, but if this is allowed then even this much space might appear not enough. Allowing bankswitching for instruments in this case appears to be a must. (For example, Bank 3 for the engine, Bank 4 bankswitched for the instruments, Bank 5&6 bankswitched for DPCM, Bank 7 reserved for compatibility with TNS)
Then again, I still have this extravagant hope that the OP can at least show some respect for my efforts on improving these programs instead of acting as if he doesn't give a crap and quietly applying my fixes. BUT, if this extravagant hope becomes real I would probably try to put my own efforts into rewriting the NSF code.
nsf.nesbbs.com under reconstruction, better player might be available in the future.

VRC6 PWM is GAY because it has colours of the rainbow in the NSFPlay keyboard visualizer.

User avatar
Posts: 932
Joined: Mon Apr 20, 2015 8:47 pm
Location: Trapped in a 2A03

Re: FDS instrument sequences & wave envelope

Postby MiniMacro » Sat Oct 17, 2015 7:17 pm

This is a great feature. I think it would be easier to make FDS instruments this way because they'd be more exact. I also like how Hertz attaches a build with the feature implemented in each request pertaining to it.
wow this is total BS
you can see my beautiful music there~

Return to “Feature Requests”

Who is online

Users browsing this forum: No registered users and 3 guests