This is the original Pro Tracker v3.x module, an AY music editor for ZX Spectrum. A project started by Nikolay Khudentsov (Nick), and subsequently refined for many years by enthusiasts.
The story began with Pro Tracker 1.1 (see the description of the PT1 and PT2 formats).
Main changes have occurred in samples: masks and frequency offsets have been added for envelopes; accumulations have been implemented for tone, noise and amplitude. Also, information about the version and the note table number has been added to the format, the author's line is divided into two parts: the title and the author. For version PT 3.7 onwards, Dmitry Bystrov (Alone Coder) added Turbo Sound (TS) support to the format: half of the patterns are played through the first chip, the second half through the second.
In Pro Tracker, from the first versions, the note and volume tables are stored into native players, and are not calculated by formula or algorithmically. This is wasteful and not universal, since the same player cannot be used with different modules without replacing the tables. This drawback is eliminated in the players for the ZX Spectrum from Vortex Tracker II, in which all the tables are calculated according to the module version, and at the same time the players are also more compact than the original ones.
One of the weaknesses of the new format is note tables. The corresponding field stores the table number for this module: a value from 0 to 3. There are no perfect tables in early versions of Pro Tracker.
Table 1 (internal name "SoundTracker") has been unchanged since the first versions of PT 1.xx. It is redesigned from the Sound Tracker table. But even in it a mistake is made. Compared to the ideal scale for 1773400 Hz chip frequency (original ZX Spectrum), is shifted almost exactly one tone down. In addition, the 24th note is out of tune (in the editor it is designated as B-2, because of the shift in one tone it should sound like A-2).
The rest of the tables changed or appeared as the project progressed. Even though the format provides the editor version number in which the module was created, there is some uncertainty for tables 0, 2 and 3.
The turning point was the appearance of Pro Tracker 3.4r. It has two new tables are 2 and 3. The same version of the editor defined the tradition with the names of the tables.
Table 0 with the name "ProTracker" does not fit any standard frequency. It is not uniquely determined for all versions specified in the module header. For example, if the module has version 3.3 or lower, the old variant of the table is used; and if 3.5 and higher, the modified one. But there is a conflict with version 3.4: if the module is written in 3.4r version, you need to use the old variant, if in all other 3.4 versions, the modified one. It is not clear to me why the version number of PT 3.4 was not changed to 3.5 after such serious changes. But it is obvious that this created a serious problem in the end. If it was possible to determine that the module was written in version 3.4r, I would recommend changing the version number in the module header from 3.4 to 3.3 in order to resolve this conflict at least for this particular module.
Table 2 appeared in PT 3.4r under the name "ASMorPSC". It is a modification of the ASM (PSC) note table without the first two notes and exactly matches for the frequency of 1773400 Hz. Unfortunately, such a useful table in other 3.4 versions was replaced with a table for the frequency of 1750000 Hz (and also perfectly calculated). Thus, a collision similar to the one described above was generated, and the same method of resolving it for a particular module can be recommended.
Table 3 also appeared in PT 3.4r under the name "RealSound". The table is a modification of table 0 and is offset from it by a semitone down. Accordingly, it also does not fit any standard AY frequency. In other 3.4 versions, this table has changed, that is, there is the same version collision as with tables 0 and 2.
Thus, in modern PT3-editors, only two tables are of interest: 1 (for a frequency of 1.7734 MHz with a shift of 1 tone) and 2 (for a frequency of 1.75 MHz).
The collision between the versions of Pro Tracker 3.4r and the rest of Pro Tracker 3.4x cannot be resolved programmatically. Therefore, players (such as Ay_Emul and used when exporting from Vortex Tracker II) use new note tables for modules of versions 3.4 onwards, and old ones for modules up to version 3.4. Therefore, if you have modules that use tables 0, 2 or 3, and it is known for sure that they are written in version 3.4r, then the most correct ways are either to fix version 3.4 to 3.3 in the modules header, or to play them with the native Pro Tracker 3.4r player.
PT3 uses a not very rational method of volume control: using a large table of experimental (or calculated by formula) values of 16 volume levels of each of the 16 amplitudes, despite the fact that PT3 does not provide the possibility of setting the volume to 0.
The table occupies 256 bytes and does not give any advantages at the same time, because it is fixed, i.e. it does not take into account that the sound chip on different computers are connected differently, that AY-3-8910/12 and YM2149F differ, including in the analog part (and there may be differences even between the same marked chips).
In addition, these differences do not even make much sense to take into account: there are many of them, and there are only 16 levels in the amplitude registers. The correct approach in such limited conditions is implemented in the PSM, STP, SQT and GTR editors: based on the fact that the output characteristic is close to the logarithmic, the value (15-volume) is simply subtracted from the sample amplitude.
In Pro Tracker (starting from 1.xx) the so-called symmetrical volume table is used, which can be calculated using the formula Amp(i,j)=(i*j+7) div 15.
In 3.1x-3.4x versions uses a slightly different table, starting with 3.5 version, the old one has returned. Thanks to this, it is possible to uniquely determine which of the two volume tables to use according to the module version.
The format contains features that are not supported for various reasons in the native ZX Spectrum editor, but are supported in its own player. Of course, as the project develops, some of these features are periodically activated. But Vortex Tracker II has advanced the furthest in this sense, since it is cross-platform, so it is not constrained by some limitations of the native ZX Spectrum platform for PT3.
Vortex Tracker II, within the capabilities of the PT3 format and its native players, pushes the limitations of the ZX Spectrum editors. Vortex Tracker II allows:
Therefore, before trying to load the Vortex Tracker II module into a ZX Spectrum editor, make sure that it fits into its limitations (sometimes change from version to version).
The structure of the module is well described in the ptdoc.p file from the Pro Tracker 3.72 package from Dmitry Bystrov. I suggest reading slightly edited excerpts from this document.
---------------------------cut here-------------------
Extension .m or .pt3.
The offsets to the areas in the module and their length in bytes (decimal numbers) are specified.
+0 (13) | "ProTracker 3." – identification string. Missed in the modules from Vortex Tracker! | ||
+13 (17) | "7" (or "6","5","4", or even "3" ) – subversion number. It should be noted that for PTv3.4x modules and below a different, "asymmetric" volume table is used, and in PTv3.3x modules an alternative frequency table "Pro Tracker" is used, which does not coincide with the modern one of the same name! | ||
+14 (16) | " compilation of " (optional – any text of this length). | ||
+30 (32) | module name (ASCII, lat, unused characters are filled with spaces). | ||
+62 (4) | " by " (optional – any 4 characters) | ||
+66 (32) | author's name (ASCII, lat, unused characters are filled with spaces). | ||
(that is, the first 98 bytes of the module form the corresponding string) | |||
+98 (1) | For ordinary AY musics: code #20. If TS is used: the number of patterns is N (in the current version it should be #30). The patterns of the first AY are numbered N-1,N-2,... The patterns of the second AY are numbered 0,1,2,... In the list of positions there are patterns N-1,N-2,... | ||
+99 (1) | frequency table number: 0=Pro Tracker (aka 1625000), 1=Sound Tracker, 2=1750000 (another name that does not correspond to the content is ASM or PSC), 3=RealSound (aka 1625000+, a bad attempt to move Table 0 under 1.75MHz). The table occupies 192 bytes and contains the values of the frequency dividers for 96 notes, starting from C-1 (C of the first octave). The frequency divider is the value placed in the corresponding AY registers. The lower bytes (here and below, with one exception to be specified) are stored first. The PT3 compiler (current versions of PT3 are assembled without a compiler) stores the table corresponding to the module into the player body at the relative address 512. It stores the volume table in the same player body at the relative address 256. | ||
+100 (1) | tempo value. | ||
+101 (1) | song end (1=there is only one position in the module) – not used in the player. | ||
+102 (1) | song loop (0=looping to the beginning). | ||
+103 (2) | Psa_chn=offset from the beginning of the module to the pattern table. | ||
+105 (32*2) | offsets from the beginning of the module to the samples, starting from the zero sample. Two bytes per sample. The zero sample is not used in the current versions of the editor. The offset is zero for all unused samples. | ||
+169 (16*2) | offsets from the beginning of the module to the ornaments, starting from zero. Two bytes per ornament. The zero ornament is the absence of an ornament, so the data of this ornament (see below) contains 0,1,0 (you can use this ornament at your discretion, BUT then you will not be able to use samples without ornaments in the song). The offset is zero for all unused ornaments. | ||
+201 (?) | list of positions (order). Contains pattern numbers (0...84) multiplied by 3. The table ends with the code #ff. Pro Tracker v3.3x-v3.5x does not support more than 42 patterns. Pro Tracker v3.6x does not support more than 46 patterns. Pro Tracker v3.69x, v3.7x does not support more than 48 patterns. | ||
+Psa_chn (?*6) | pattern pointers. Contains offsets for each of the available patterns: ++0 (2) to the channel A data block (track) ++2 (2) to the channel B data block (track) ++4 (2) to the channel C data block (track). The noise offset data (a separate column in the editor) is compiled into channel B. | ||
+? (?*?) | blocks of channel data, i.e. tracks. |
The track contains the following data:
================================================================
NB: The effects parameters (#0x) are not immediately after the effect number code, but AFTER the END OF THE LINE!!! If several effects are used on one note (in fact, this does not happen), then the parameters of the ultimate effect stored first, then the penultimate one, and so on...
================================================================
+? (?*(?*4+2)) | – samples. ++0 (1) – loop ++1 (1) – end (1=one-line sample) ++2 (?*4) – data: +++0 (1) sv +- N4 N3 N2 N1 N0 Em +++1 (1) Nm ts ns Tm V3 V2 V1 V0 sv=1 – is a sign of a shifting in volume, +- =1 corresponds to its increase; N4–0 is the frequency of noise OR the displacement of the envelope (depends on the presence of a noise mask): envelope offset 0–15 for down, 16–31 for up (N4 is interpreted as a sign); V3–0 is volume; Tn, Nm, Em are masks of tone, noise and envelope, respectively, and if the mask is equal to one, then the corresponding sound element is turned off; ts, ns=1 are signs that the current the offset of the tone or noise/envelope will be remembered. +++2 (2) offset of the tone period (positive for up, negative for down). |
+? (?*(?+2)) | – ornaments. ++0 (1) – loop ++1 (1) – end (1=one-line ornament) ++2 (?) – data: offsets in semitones (0=no offset, positive offset for up, negative offset for down). |
---------------------------cut here-------------------