NovaSquirrel / ft2pently

Famitracker to Pently music converter
GNU General Public License v2.0
14 stars 1 forks source link

Correct vibrato translation to match 0CC-FT depths #18

Closed pinobatch closed 7 years ago

pinobatch commented 7 years ago

tl;dr: 4x1 means MP1, 4x3 means MP2, 4x5 means MP3, and 4x7 means MP4

In a Tweet on August 29, NovaSquirrel wrote that roughly seven out of eight Famicompo NSF entries used some variant of FamiTracker. Keeping effects such as vibrato more predictably consistent between FT's engine and Pently would make Pently and ft2pently more attractive to musicians in the FamiTracker community and to video game developers seeking to hire these musicians.

Since vibrato was added to Pently, its vibrato amplitudes have been 3/32, 3/16, 3/8, and 3/4 of a semitone, or 9, 19, 37, or 75 "cents" (hundredths of a semitone). Unlike in FamiTracker 0.4.6, these amplitudes are irrespective of the current note's period, and they remained so after the recent refactor to include portamento. ft2pently currently uses the low nibble of effect 4xy to determine which MPy effect to emit.

0CC-FamiTracker is a popular modification of FamiTracker made by HertzDevil, which has become popular among Windows-using community members. Its 0cc-readme.txt describes an added feature called "linear pitch", which calculates vibrato, portamento, and pitch envelopes in 1/32-semitone units rather than period units. (This is similar to XM and IT linear pitch.)

But unlike some vocal members of that community's Discord server, I'm hesitant to recommend a mass switch from "vanilla" FT 0.4.6 to 0CC-FT at this time for the sake of macOS and GNU/Linux users. Unlike vanilla, which works well in Wine once the buffer size is raised to 80 ms, 0CC-FT is garbage in at least three places. But in preparation for 0CC-FT working in Wine, I recommend adding the correct translation of amplitudes, taken from the FamiTracker vibrato depth table:

FT effect FT amplitude Pently effect Pently amplitude
400 0 MP0 0/32 st
451 3 MP1 3/32 st
453 7 MP2 6/32 st
455 13 MP3 12/32 st
457 23 MP4 24/32 st

These also happen to be correct in vanilla for notes whose periods are separated by close to 32 period units, namely those near A-2. I may file a separate issue for more accurate translation of vibrato depth in vanilla exports.