VOGONS


First post, by 8bitbubsy

User metadata
Rank Member
Rank
Member

I'm trying to port ProTracker to MS-DOS (386+, Sound Blaster 2.0/ Pro / 16).
This is just a proof of concept for now, so the only thing that works is to load a module through Disk Op, then press Play or Stop (or change the BPM).

It won't be "just another .MOD player" though, as the goal here is playback accuracy. I've ported the ProTracker replayer from 68k asm to i386 asm, and I've written a Paula (Amiga sound chip) i386 assembler mixer that kinda works like Paula in the way it handles looping and register updating (DAT/LEN). I don't think there's a single ProTracker player for MS-DOS that does "live sample-swapping" correctly, but this one does. This tecnique was used in several chiptune-styled .MODs to simulate SID PWM. The swapping shouldn't happen instantly (many players do this, it's wrong), but rather at the next "sample end" point inside the mixer.

The mixer runs at 43.5kHz (SB 2.0/Pro) or 45.5kHz (SB16). 16-bit mixing, 8-bit/16-bit output, no resampling interpolation.

Minimum system requirements:
- Intel 386DX processor @ 33MHz (486 recommended)
- At least 2MB RAM
- Sound Blaster 2.0 / Pro / 16 (earlier SB cards not supported, output rate must be >32kHz)
- NOTE: Audio might have occasional buffering issues under DOSBox

A 486+ w/ SB16 is going to give the best experience and sound quality.

Download: https://16-bits.org/etc/pt4dos.zip
Source code: https://16-bits.org/etc/pt4dos_src.zip (tabsize = 8 for the .asm files)

pt4dos.png

Last edited by 8bitbubsy on 2022-09-01, 15:24. Edited 11 times in total.

486:
- Motherboard: "SIS 486G 3.3/5V Ver:E" w/ 256kB L2 cache
- CPU: Intel 486DX2 66MHz
- RAM: 16MB 60ns FPM
- VGA: S3 Vision864 2MB VLB
- Audio: SB16 CT2800 (real OPL3)
- ISA PS/2 mouse card
- ISA USB
- MS-DOS 6.22 + WfW 3.11

Reply 2 of 12, by 8bitbubsy

User metadata
Rank Member
Rank
Member
Rawit wrote on 2022-07-12, 20:00:

Sweet! Going to give this a spin soon. How "Amiga" like does it sound?

I guess it's wrong of me to say that it sounds like Amiga. It does nearest-neighbor resampling with no interpolation, so there's a ton of aliasing in the sound. To many people, this is considered awful and lo-fi like, but at the same time, linear interpolation would make many of the lo-fi Amiga samples sound too flat and low-pass filtered.

However, it's an extremely accurate ProTracker player, so it's still worth a shot if you like to play 4 channel .MODs on MS-DOS.

486:
- Motherboard: "SIS 486G 3.3/5V Ver:E" w/ 256kB L2 cache
- CPU: Intel 486DX2 66MHz
- RAM: 16MB 60ns FPM
- VGA: S3 Vision864 2MB VLB
- Audio: SB16 CT2800 (real OPL3)
- ISA PS/2 mouse card
- ISA USB
- MS-DOS 6.22 + WfW 3.11

Reply 3 of 12, by FreddyV

User metadata
Rank Oldbie
Rank
Oldbie

Hi,

Interresting, i never heard about the live sample swap.
Do you have files using it ?

There are différent version of tracker on the amiga, with différence between them. Then I am not convinced there is only one way to play music.

Sometimes, musician use tracker bugs to do a different effect.

Reply 4 of 12, by 8bitbubsy

User metadata
Rank Member
Rank
Member
FreddyV wrote on 2022-07-13, 20:00:
Hi, […]
Show full quote

Hi,

Interresting, i never heard about the live sample swap.
Do you have files using it ?

There are différent version of tracker on the amiga, with différence between them. Then I am not convinced there is only one way to play music.

Sometimes, musician use tracker bugs to do a different effect.

Sure. Though the ProTracker replayer changed very little during the different versions. Except the ProTracker 3.x series, where they broke some things by fixing other things.

Here's an example module using sample-swapping (changing the sample without entering a note next to it): http://modland.com/pub/modules/Protracker/4-M … hymenu%2011.mod
Here's one using the EFx (invert-loop) effect, which I don't think DOS module players support either: http://modland.com/pub/modules/Protracker/Ema … i-encounter.mod
(that last tune also uses sample-swapping for the arpeggio channel)

486:
- Motherboard: "SIS 486G 3.3/5V Ver:E" w/ 256kB L2 cache
- CPU: Intel 486DX2 66MHz
- RAM: 16MB 60ns FPM
- VGA: S3 Vision864 2MB VLB
- Audio: SB16 CT2800 (real OPL3)
- ISA PS/2 mouse card
- ISA USB
- MS-DOS 6.22 + WfW 3.11

Reply 5 of 12, by FreddyV

User metadata
Rank Oldbie
Rank
Oldbie

A-mat anarche menu, I am not surprized 😀
I just released a video with one of these music.
https://youtu.be/o3Okc0zqJZU

If you check, at 1:32, it is used during vibration (Change sample name)

It spent a big amount of time trying to understand what to do when there is a sample name and no note.
I wrote on my MOD player since >30 years and never heard about it, I never found it documented somewhere.

So, I am sure that most of the PC player play it wrong, just because nobody did know this.

Regarding the invert Loop, it is an effect never supported because it is slower to mix and need aditionnal code for almost no module using it.
It is not because it is impossible.

About the GUS support in your software. Honestly, don't support GUS at all if you want to do a software mixing on it.

Reply 6 of 12, by 8bitbubsy

User metadata
Rank Member
Rank
Member

Sample swap works like this: When the current playing sample reaches its end (either loop-end or the end of the non-looping sample), it changes to the new sample. So the swap should be delayed to the end of the current sample cycle. In other words, this has to be done on a mixer level, and not in the replayer. PT4DOS gets this 100% right.

Invert loop is not as rare as you think, and it's not slow at all. You invert one sample point in the effect routine itself per tick (if the invert loop counter reaches its target speed). Then the invert pointer increases by one.

EDIT: Updated PT4DOS now with some bugfixes etc. Removed GUS driver from source code, as I was not satisfied with it anyway (too many bugs and too much frametime used for DMA acknowledging, for some reason).

486:
- Motherboard: "SIS 486G 3.3/5V Ver:E" w/ 256kB L2 cache
- CPU: Intel 486DX2 66MHz
- RAM: 16MB 60ns FPM
- VGA: S3 Vision864 2MB VLB
- Audio: SB16 CT2800 (real OPL3)
- ISA PS/2 mouse card
- ISA USB
- MS-DOS 6.22 + WfW 3.11

Reply 8 of 12, by 8bitbubsy

User metadata
Rank Member
Rank
Member
Rawit wrote on 2022-07-18, 12:48:

[...] Will there be support for other codecs like WSS, ESS or PAS16?

I don't own any of these cards, so I can't write a driver for them as it needs extensive testing.

486:
- Motherboard: "SIS 486G 3.3/5V Ver:E" w/ 256kB L2 cache
- CPU: Intel 486DX2 66MHz
- RAM: 16MB 60ns FPM
- VGA: S3 Vision864 2MB VLB
- Audio: SB16 CT2800 (real OPL3)
- ISA PS/2 mouse card
- ISA USB
- MS-DOS 6.22 + WfW 3.11

Reply 9 of 12, by pan069

User metadata
Rank Oldbie
Rank
Oldbie
8bitbubsy wrote on 2022-07-18, 12:50:
Rawit wrote on 2022-07-18, 12:48:

[...] Will there be support for other codecs like WSS, ESS or PAS16?

I don't own any of these cards, so I can't write a driver for them as it needs extensive testing.

Maybe introduce a driver model, that way the community can add support for hardware you can't add yourself?

Reply 10 of 12, by 8bitbubsy

User metadata
Rank Member
Rank
Member

That's a possibility, but I don't like the feeling of having to not touch too much code because I can't test the drivers. All in all, I think Sound Blaster (and compatibles) is the most important sound card to support for now.

486:
- Motherboard: "SIS 486G 3.3/5V Ver:E" w/ 256kB L2 cache
- CPU: Intel 486DX2 66MHz
- RAM: 16MB 60ns FPM
- VGA: S3 Vision864 2MB VLB
- Audio: SB16 CT2800 (real OPL3)
- ISA PS/2 mouse card
- ISA USB
- MS-DOS 6.22 + WfW 3.11

Reply 11 of 12, by 8bitbubsy

User metadata
Rank Member
Rank
Member

Bump.

Binary + code updated (in first post).

Small optimization for pattern drawing, and the replayer has been re-ported in i386 asm instead of C, for even less overhead.
The speed difference is very small, but it's there. 😀

486:
- Motherboard: "SIS 486G 3.3/5V Ver:E" w/ 256kB L2 cache
- CPU: Intel 486DX2 66MHz
- RAM: 16MB 60ns FPM
- VGA: S3 Vision864 2MB VLB
- Audio: SB16 CT2800 (real OPL3)
- ISA PS/2 mouse card
- ISA USB
- MS-DOS 6.22 + WfW 3.11

Reply 12 of 12, by 8bitbubsy

User metadata
Rank Member
Rank
Member

Bump (again), new test version.

* PT4DOS now runs at 320x240 60Hz (UI redesigned, looks more like original ProTracker)
* Fixed weird behavior/crashes on some systems (was trashing some memory by accident)
* Fixed potential lock-up on exit when using certain non-Creative Sound Blaster compatibles (Crystal)
* Disk Op. now lists disk drives
* You can now press F12 to change tempo mode between CIA (BPM based) and VBL (fixed at ~49.92Hz, some modules need this. Also changes Fxx effect behavior.)
* Fixed rare clicks/pops in the audio (buffering issues)
* Fixed possible stuck ctrl/shift/alt states after exiting to DOS
* PT4DOS can now run without a sound card (pointless right now, but useful after the tracker is fully implemented)
* Other minor bugfixes

Binary + source code updated (links are in first post).
Keep in mind that this is just a player for now, the tracker is lacking almost all of its features!

486:
- Motherboard: "SIS 486G 3.3/5V Ver:E" w/ 256kB L2 cache
- CPU: Intel 486DX2 66MHz
- RAM: 16MB 60ns FPM
- VGA: S3 Vision864 2MB VLB
- Audio: SB16 CT2800 (real OPL3)
- ISA PS/2 mouse card
- ISA USB
- MS-DOS 6.22 + WfW 3.11