VOGONS


GLX Player the only XT player ? Check Mod Master...

Topic actions

First post, by FreddyV

User metadata
Rank Oldbie
Rank
Oldbie

Hi,

I Just finished to downgrade the code of my .MOD Player to run on a 8086 CPU in CGA.

Currently, it can Mix 4 Channels at 22KHz and 8 at 10KHz. I still can optimize it, I was focussed on having it working 😀

Mod Master play .MOD, .STM, .S3M files (and various other 4 Channels format)

I can't release it for now, I need to correct some bugs and I would like to optimize it a little.

If there are some MOD players expert around, I also developed USMPlay in 1997. 😎

https://www.youtube.com/watch?v=s_4U_h4bSqw

Last Release Available : Beta 27, Page 39 ( August 22, 2021)
My Blog: https://freddyv.over-blog.com/

FreddyV

Last edited by FreddyV on 2021-12-21, 14:06. Edited 7 times in total.

Reply 1 of 929, by Scali

User metadata
Rank l33t
Rank
l33t

That's pretty neat!
Galaxy Player was famous for using self-modifying code to generate optimized unrolled mixing loops (and cut some corners with precision for extra speed).
How did you get your mixer this fast?

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 2 of 929, by FreddyV

User metadata
Rank Oldbie
Rank
Oldbie

Galaxy player is doing 15KHz with 8 channels where mod master start to have some glitches a 11KHz.

No self modified / Generated code is used so far, not needed.
Mod Master is doing unrolled mixing as well, but not fully unrolled as we need to extend the samples too far.
(Mixing is done by block of 64 samples, then loop to finish the rest)
If we set the buffer size to multiple of 64, It is faster.
I can still optimized it, this is the code originally done for a 486.

With mod master, we have a full interface, with playlist. the GLX version available is a trial, where we are obliged to restart the player for each module.

I can improve it a lot, with more calculation buffer, automatic frequency adjustment.

Regarding the mixing precision, I am quite sure we use the same, Go to 16 bit precision mixing may reduce the speed by 20%. I try to increase the speed with this precision first.

Reply 3 of 929, by FreddyV

User metadata
Rank Oldbie
Rank
Oldbie

Hi again,

Somebody asked me the Tandy 1000 DMA DAC support and I see a project for a Covox Sound Master in the forum.
I believe Mod Master must support Sound Master 😀

Can anybody help me to have documentation and to test it ?

I checked after I posted it, Mod MAster support Sound Master with Direct I/O on port 388h, but not DMA

Reply 4 of 929, by dr.zeissler

User metadata
Rank l33t
Rank
l33t

That was me, but I think it will work as it does with "setdac" and glx, but I have not tested it. (my t1000 is currently not available)

Last edited by dr.zeissler on 2019-04-09, 20:50. Edited 1 time in total.

Retro-Gamer 😀 ...on different machines

Reply 5 of 929, by FreddyV

User metadata
Rank Oldbie
Rank
Oldbie

I checked what is SETDAC
It seems it change the I/O for Parallel port in the BIOS variables.

Yes, Mod Master read the LPT address in the BIOS Variable, so it will work.

But The Tandy DAC is working in DMA as well, I was more thinking about supporting the DMA mode, then be much faster.

Reply 6 of 929, by matze79

User metadata
Rank l33t
Rank
l33t

Would you also like to add support for IBM PS/1 DAC ? ;D

Is SETDAC only possible on Tandy or will it also allow to modify Bios Table on Standard PC ?

https://www.retrokits.de - blog, retro projects, hdd clicker, diy soundcards etc
https://www.retroianer.de - german retro computer board

Reply 7 of 929, by Scali

User metadata
Rank l33t
Rank
l33t
matze79 wrote:

Is SETDAC only possible on Tandy or will it also allow to modify Bios Table on Standard PC ?

If it indeed just changes the value that the BIOS stores for the LPT1 address, then it should work on any PC or compatible machine. It's a standard BIOS feature.

http://scalibq.wordpress.com/just-keeping-it- … ro-programming/

Reply 8 of 929, by SirNickity

User metadata
Rank Oldbie
Rank
Oldbie

This is the kind of crazy stuff that makes me want to start coding a MOD player for an ATmega with a Covox-style ladder-DAC, just to hear some Future Crew S3Ms playing from a breadboard. Man I wish I had more free time.

Reply 9 of 929, by FreddyV

User metadata
Rank Oldbie
Rank
Oldbie

Hi,

Before adding support for something else, I continue to improve / Optimize the code using SB Autoinit DMA.

I successfully added the support for multiple buffers and If the mixing is too slow, it does not play the last channels.
Doing this, It is able to play some 8 channels modules at more than 15KHz correctly, on my Amstrad PC1640. (4 Buffers)

Something else interesting: Mod Master does not crash, whatever the frequency we ask for the mixing.
When compared with GXL Player, GLX Does not support more than 22KHz on a SB 2.0 Sound card (Probably supported on SB Pro only)
and GLX Does Crack or crash the PC if the frequency is too high.

I also corrected some replay bugs.

So, 8 Channels, 15KHz and it is still possible to optimize the code. (I Can speedup the partition read a lot, the mixing code and other stuff)

If I push the player to the limit (Few replay artifacts), It can play Crystal Dream 2 Part 1 at 18KHz and Enigma.mod at 30KHz 😀

Reply 12 of 929, by FreddyV

User metadata
Rank Oldbie
Rank
Oldbie

Hi,

I would not like to release a version with too many bugs and currently, when I change something I add bugs somewhere else.
My progress to stabilize it is Slow.

The current version is not so bad, but support only Covox on 0388h and Sound Blaster in DMA Auto Init mode.

Is there a place where I can put it ?

I can put Mod Master 2.2, 2.3 and a pre version of 2.2 XT

Little precision:
Mod Master 2.2 XT Support Playlist.
It does support XMS and EMS. Then, with a 1Mb memory card (Lo Tech), you can surely load bigger modules. (Not tested, I don't have this card)

You can change individually the Volume amplification for each module : You can then adjust the volume to the maximum (Before saturation) and increase the sound quality (8 Bit Mixing)
The volume is saved in a file, no need to change it each time.
I would like to do the same for the Frequency : Configure and save the mixing Frequency.
It is important as the max mixing frequency depends on the music.
Currently, it can play Crystal Dream 2 Part 1 module at 19KHz, but Second reality at only 15KHz (Both 8 Channels MOD)
Elysium at 30KHz, some other 4 Channels MOD at 24KHz

Here are screenshots:
Mod Master 2.3 (Version from 1998, never released) : I could not downgrade this release as the interface is too complex. The Module replay code is exactly the same as Mod Master 2.2 anyway.
Mod Master 2.2 XT : I had to "Downgrade" the interface to CGA and the x386 Code
Mod Master 2.2 : The version I used for the Downgrade

Attachments

  • MODM23.jpg
    Filename
    MODM23.jpg
    File size
    111.27 KiB
    Views
    11673 views
    File comment
    Mod Master 2.3
    File license
    Fair use/fair dealing exception
  • MODM22XT.jpg
    Filename
    MODM22XT.jpg
    File size
    114.84 KiB
    Views
    11673 views
    File comment
    Mod Master 2.2 XT
    File license
    Fair use/fair dealing exception
  • MODM22.jpg
    Filename
    MODM22.jpg
    File size
    107.3 KiB
    Views
    11673 views
    File comment
    Mod Master 2.2
    File license
    Fair use/fair dealing exception

Reply 13 of 929, by dr.zeissler

User metadata
Rank l33t
Rank
l33t

A directory-listing of your mod-archive would be helpfull and thx for that nice mod-player!
I always thought there is no better one than glx212, but I might be wrong in this.

Retro-Gamer 😀 ...on different machines

Reply 14 of 929, by FreddyV

User metadata
Rank Oldbie
Rank
Oldbie

Hi,

If somebody want to test Mod Master 2.2XT, here it is.

As it is Mod Master 2.2 Downgrade, There are of course Mod Master 2.2 functions not working anymore.
If you can tell me the config you used and the result, it can be great.

I forgot something in the attached readme: You need to Tick "DC [ ]" in the sound blaster configuration menu to activate AutoInit DMA.
And start it like this MODM /EN for English menu

I also add Mod Master 2.3 (Never released)
This one is more for a 486 computer.

Regarding my modules list, It is quite simple:
Crystal Dream 2 demo
Purple Motion and Skaven
Moby from Sanity
Rez from Eclypse
Plus classical like enigma.mod

FreddyV

Filename
MODM22XT.zip
File size
67.35 KiB
Downloads
322 downloads
File comment
Mod Master 2.2 XT (Alpha 1)
File license
Fair use/fair dealing exception
Filename
MODM230.zip
File size
792.45 KiB
Downloads
523 downloads
File comment
Mod Master 2.3
File license
Fair use/fair dealing exception

Reply 15 of 929, by MobyGamer

User metadata
Rank Member
Rank
Member

I look forward to testing this 😀

You mentioned elsewhere you use "a simple trick to mix in an higher fréquency most of the time." What trick? (Interleaving samples instead of mixing them?)

Reply 16 of 929, by FreddyV

User metadata
Rank Oldbie
Rank
Oldbie

I use 4 buffers of 1/50 of seconds. It is a simple trick used a lot....
This is enaugh to be faster than glx in some cases.

Then if it is still too slow, It do not mix the last channels and channels with a small volume during the next buffer.
At the end slow volume Channels are in pause during 1/50 of sec.
We do not hear the difference.

There is a limit in mixing speed so we need to find something else.

FreddyV

Reply 17 of 929, by bakemono

User metadata
Rank Oldbie
Rank
Oldbie

I tried this on my 8MHz 286 with ESS1868 sound card and it is working well with 4-channel MODs. Although I found some 6- and 8-channel ones don't play correctly. I've attached an example.

Coincidentally, I also wrote a MOD player recently, although it is not optimized enough to run on a 286, let alone 8086! but I can post the info I have about MOD files in case it is of use to anyone.

; mod info

; first 20 bytes: song name
;
; info for samples, 30 bytes/sample, 15 or 31 samples
; sample info:
; 22 bytes for name
; word - sample length (in words)
; byte - fine tune value as signed 4-bit (with high nibble being 0)
; byte - volume (0-64 linear, 0=silent)
; word - repeat point (number of words offset from beginning)
; word - repeat length (number of words in loop)
;
; BEWARE of weird MODs with loops that begin or end outside of the sample itself!
; (the best way to handle this seems to be shrinking/shifting the loop to fit?)

; immediately afterward at offset 950 (assuming 31 samples):
; byte - song length (1-128)
; byte - 127 (?)

; 128 bytes - song table (each byte is a pattern number, 0 is first pattern)

; offset 1080 (assuming 31 samples)
; "M.K." for 31-sample, 4-channel MODs, or "6CHN" "8CHN" for more channels
; no recognizable string = old 15-sample format

; offset 1084 (or 600 for 15-sample):
; pattern data - 1024 bytes per pattern (1536 for 6 channels, etc.)
; (number of patterns is determined by observing the
; highest pattern number appearing in the song table)
;
; each row of the pattern:
; n channels * 4 bytes each
; byte 0 - top 4 bits - sample number MSbs
; bottom 4 bits - period MSbs
; byte 1 - period LSB
; byte 2 - top 4 bits - sample number LSbs
; bottom 4 bits - effect MSbs
; byte 3 - effect LSB
;
; If both the period and sample fields are zero then no changes are made.
; (Any active effects will continue.)
;
; If the period is zero but the sample is nonzero, then the volume should be set
; back to the default for the current sample. The sample itself doesn't seem to
; change.
;
; When the period is nonzero: update period, reset sample position, cancel old
; effects, and then only if the sample is nonzero also update sample number
; and volume.

; Period should be multiplied by 1.007246412 ^ (-finetune)
; or 2 ^ finetune/12/8

; effect commands:
; 0xy - play, with optional arpeggio if x/y are nonzero
; This cycles between three pitches continuously (changes every interrupt). The first
; one is the base frequency, the second is x semitones higher frequency than the base, and
; the third is y semitones higher frequency than the base.
;
Show last 52 lines
; a way to calculate the modified period (good for fixed-point math with fraction bits):
;
; newperiod = 24 - x * baseperiod / 24
;
; 1xx - slide up - x=speed
; pitch goes up each interrupt (subtract x from period)
; 2xx - slide down - x=speed
; pitch goes down each interrupt (add x to period)
; 3xx - tone portamento - x=speed
; slide from previous note to this one ($300=reuse last rate)
; the relative values of the two notes determine whether the pitch is going up or down
; volume slides are cancelled by this command!
;
; 4xy - vibrato - x=speed, y=depth ($400=reuse last rate)
; the speed parameter results in a rate of x * (interrupts per row) / 64
;
; 5xy - tone portamento AND volume (x=volume up, y=volume down)
; 6xy - vibrato AND volume slide (x=volume up, y=volume down)
; 7xy - tremolo - x=speed, y=depth (volume modulation, ($700=reuse last rate)
; 8 - unused
; 9xx - set sample offset - x is multiplied by 256 words (or is it bytes??)
; Axy - volume slide - x=up speed, y=down speed (only one or the other!)
; Bxx - jump to song position
; Cxx - set volume - x=volume
; Dxx - pattern break - ends current pattern, x=offset (with weird mutation)
; offset=low nibble plus ( 10*higher nibble )
; (beware that redundant Dxx codes may appear in the same row)
; Exy - misc effects (see below)
; Fxx - set speed - 0-$20 is speed, $21-$FF is tempo
; speed=interrupts per pattern row (default: 6)
; tempo=125 is 50hz interrupt =default

; Misc effects:
;
; E0- Set Filter E0x : 0=on, 1=off (Amiga's low pass filter)
; E1- FineSlide Up E1x : value (only alters the pitch once)
; E2- FineSlide Down E2x : value (only alters the pitch once)
; E3- Glissando Control E3x : 0-off, 1-on (use with tonep.)
; (causes pitch slide to go half step at a time)
; E4- Set Vibrato Waveform E4x : 0-sine, 1-ramp down, 2-square (bit 2=don't retrig)
; E5- Set Loop E5x : set loop point
; or E5 is set finetune ???
; E6- Jump to Loop E6x : jump to loop, play x times
; E7- Set Tremolo Waveform E7x : 0-sine, 1-ramp down. 2-square (bit 2=don't retrig)
; E8- unused
; E9- Retrig Note E9x : restart sample every x interrupts
; EA- Fine VolumeSlide Up EAx : value (only alters the volume once)
; EB- Fine VolumeSlide Down EBx : value (only alters the volume once)
; EC- NoteCut ECx : end note after x interrupts
; ED- NoteDelay EDx : delay note x
; EE- PatternDelay EEx : delay pattern x notes
; EF- Invert Loop (?) EFx : modifies sample data somehow

edit: I noticed what is weird about this MOD file. It tries to set the volume higher than 64.

Attachments

  • Filename
    3rdboss.zip
    File size
    48.06 KiB
    Downloads
    179 downloads
    File license
    Fair use/fair dealing exception

Reply 18 of 929, by FreddyV

User metadata
Rank Oldbie
Rank
Oldbie

Hi,

Thanks for the test.

This module use 5 Octaves and Mod Master is configured to 3 by Default, Go to the options and change The Octaves from 3 to 5
I May put 5 by default

Also, this module use BPM at 255 and Tempo 2, this is the fastest possible.
I never saw this………

Reply 19 of 929, by MobyGamer

User metadata
Rank Member
Rank
Member
FreddyV wrote:

I use 4 buffers of 1/50 of seconds. It is a simple trick used a lot....

I'm sorry, but I still don't understand. How is mixing into 4 buffers faster than mixing into a single output buffer? Are the 4 buffers also output buffers, or do they need to be mixed together later? If mixed together later, then that's not faster than GLX, because there's additional overhead involved in setting up the second mixing pass, reading from memory again, etc. Sorry if I'm misunderstanding.

Then if it is still too slow, It do not mix the last channels and channels with a small volume during the next buffer.
At the end slow volume Channels are in pause during 1/50 of sec.
We do not hear the difference.

I'm not sure I understand this either, but eliminating calcs is definitely the way to go if you want to beat GLX.

GLX doesn't use volume tables IIRC. Meaning, for a 4-channel MOD, it always mixes 4 channels with fixed adjustment even if none of them are playing. This is the fastest mixing, but might be doing work it doesn't need to.
For a routine that uses volume tables, you can mix 2, 3, or 4 channels -- BUT there is overhead in translating the correct volume table for every sample.
So it's a trade-off as to which method is better. I think for 4 or less channels, GLX is faster because most of the time all 4 channels will be playing something. For 8, 12, 16-channel tunes, volume tables and partial mixing is better, because 1. Most of the time, not all channels will be playing something, and 2. You need volume tables to scale that many mixed channels into a reasonable-sounding 8-bit end result anyway.

A 16-bit mixing path to support 16-bit output might be faster than 8-bit if the instrument samples are pre-converted into 16-bit such that no shifting/tables are needed, and the end result won't overflow. However this is just a theory 😀 I haven't tested it, and not many people put 16-bit soundcards into 808x systems 😉