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.
- 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.
- 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.