VOGONS


Reply 100 of 352, by FreddyV

User metadata
Rank Member
Rank
Member

Hi,

Nice !
I detected anyway a small problem thanks to your video.
The notes pitch is too low at this frequency.
When you set Mod Master at 48KHz in reality it will do 50KHz

SB Frequency
237 52631
236 50000
235 47619

If you put the player at 47600 it is playing correctly.
I do my calculation with the real replay frequency so I don't know yet what is the problem.
Probably something to do with the calculation precision.

I still have no idea about the .MOD not playing. I will have to check what is the difference between both in the replay code, but as it does not crash for me, it will be difficult to correct.

Can you try with a .MOD with 8 channels ?
When does it crash exactly ?
I may send you a version with some debug message if you want.

Reply 101 of 352, by MobyGamer

User metadata
Rank Member
Rank
Member
FreddyV wrote:
My current adlib code is this one. […]
Show full quote

My current adlib code is this one.

        MOV DX,388h
MOV AL,43h ;Porteuse de la voie 1
OUT DX,AL
IN AL,DX
IN AL,DX
IN AL,DX
IN AL,DX
IN AL,DX
IN AL,DX

INC DX
POP AX
MOV BX,OFFSET T_Adlib
XLAT ;Lire la table Log
OUT DX,AL ;AL, Niveau total

That's too much work for each sample, and isn't necessary. Once you have the adlib set up for digi (courtesy of John Ratcliff):

; PrepareToSampleOut()
;
; This routine start the oscillator whith a frequency of 250 Hz, and
; wait until 1/4 of the first period (sin). Then set the frequency to 0,
; in order to block the internal level to its maximum.
; If the voice 0 is used only for sampling, call this routine once;
; otherwise call before every time you call 'OutSample()'
;
Proc PrepareToSampleOut near
mov ax,[AdlibIO]
inc ax
mov [PORTMOD+1],ax ; Adlib port address.

mov dx,[cs:AdlibIO] ; Get the adlib board I/O address.

; set some parameters of voice-0:
mov ax, 02021H ; am= 0, vib= 0, eg-type= 1, ksr= 0, multi= 1
call OutAdlib
mov ax, 060f0H ; attack rate == MAX, decay rate = MIN
call OutAdlib
mov ax, 080f0H ; sustain level = MAX, release rate = MIN
call OutAdlib
mov ax, 0C001H ; feed-back= 0, connection = 1 (additive)
call OutAdlib
mov ax, 0E000H ; wave-select = 0 (sinus)
call OutAdlib
mov ax, 0433fH ; voice-0, slot-1 = MAX attenuation
call OutAdlib

; make sure that voice-0 is off:
mov ax, 0B001H ; voice 0, f_num = 256
call OutAdlib

; start note-on on voice-0 with freq. of 250 Hz:
mov ax, 0A000H+(F_NUM AND 0ffH) ; set 250 Hz
call OutAdlib
mov ax, 0B000H+20H+(BLOCK SHL 2)+(F_NUM SHR 8)
call OutAdlib

; disable interrupt for timing section:
cli

; Time 1/4 of period using the timer-0 of the system. The timer frequency
; is 1193180 Hz.
mov al, 00H ; latch counter-0
out TIMER_MODE, al
in al, TIMER0 ; low byte
mov bl, al
in al, TIMER0 ; high byte
mov bh, al ; count in BX

; wait until timer-2 down by DELAY_COUNT:
@@LP3: mov al, 00H ; latch counter-0
out TIMER_MODE, al
in al, TIMER0 ; low byte
mov cl, al
in al, TIMER0 ; high byte
mov ch, al ; assemble 16 bits word in DX
neg cx
add cx, bx ; start - end
Show last 27 lines
	cmp	cx, DELAY_COUNT
jb @@LP3

; time-out...
; block frequency of voice-0:
mov ax, 0B000H+20H ; set high bits of f_num and block to 0
call OutAdlib
mov ax, 0A000H ; set f_num to 0
call OutAdlib

sti

; set address register to Total-Level of oper-0, voice 0
mov al,40H
out dx,al
inc dx ; dx = port +1

; small delay...
in al, dx
in al, dx
in al, dx
in al, dx
in al, dx

ret
endp

...all you need is OUT DX,AL to send a sample, same as covox. No delay needed. Same with PC speaker (OUT 42h, AL).

Reply 102 of 352, by root42

User metadata
Rank Oldbie
Rank
Oldbie

Hm, your code has the same delay as the one from FreddyV...?

YouTube and Bonus
80386DX@25 MHz, 8 MiB RAM, Tseng ET4000 1 MiB, SnarkBarker & BlasterBoard, PC MIDI Card + SC55 + MT32, XT CF Lite, OSSC

Reply 103 of 352, by root42

User metadata
Rank Oldbie
Rank
Oldbie
FreddyV wrote:
I still have no idea about the .MOD not playing. I will have to check what is the difference between both in the replay code, bu […]
Show full quote

I still have no idea about the .MOD not playing. I will have to check what is the difference between both in the replay code, but as it does not crash for me, it will be difficult to correct.

Can you try with a .MOD with 8 channels ?
When does it crash exactly ?
I may send you a version with some debug message if you want.

It does not crash, but says it failed to load the file. I think I attached a screenshot earlier. I need to find a MOD with 8 channels, then I'll try.

EDIT: found one, doesn't work https://youtu.be/5LasI46cDls

YouTube and Bonus
80386DX@25 MHz, 8 MiB RAM, Tseng ET4000 1 MiB, SnarkBarker & BlasterBoard, PC MIDI Card + SC55 + MT32, XT CF Lite, OSSC

Reply 104 of 352, by MobyGamer

User metadata
Rank Member
Rank
Member
root42 wrote:

Hm, your code has the same delay as the one from FreddyV...?

The delay is for setting up the adlib for digi output only. Freddyv is doing the delay on every output sample which isn't necessary and takes a ton of time. Once the setup is done, all you need is XLAT/OUT DX,AL for each sample.

The port response for sending samples to Adlib is actually faster than doing PIO DAC writes to a Sound Blaster. The Adlib returns immediately whereas the Sound Blaster delays a bus cycle.

root42 wrote:

It does not crash, but says it failed to load the file. I think I attached a screenshot earlier. I need to find a MOD with 8 channels, then I'll try.

Try booting your 386 without EMS/EMM386/UMBs and see if it works better. I tested v4 last night on an 8086 (no EMS) and was able to load and play 4- and 6-channel .MOD and a 9-channel .S3M. Links to my test files are earlier in this thread. Freddyv himself has said the code is not bug-free 😀 so maybe it's in the memory handling.

Also, provide a link to that METEOR.MOD you're using for testing. I can't find it online anywhere and it's not on modarchive either.

Reply 105 of 352, by root42

User metadata
Rank Oldbie
Rank
Oldbie

Here you go: https://demozoo.org/music/141591/

I will test without emm386 in a minute!

EDIT: nope, doesn't make a difference. Even without emm386 and no EMS/UMB it does not work.

YouTube and Bonus
80386DX@25 MHz, 8 MiB RAM, Tseng ET4000 1 MiB, SnarkBarker & BlasterBoard, PC MIDI Card + SC55 + MT32, XT CF Lite, OSSC

Reply 106 of 352, by 640K!enough

User metadata
Rank Oldbie
Rank
Oldbie

If you pay attention, do you have an off-by-one error when you draw the sample list and channel numbers (to tell which sample is playing on which channel)? I had a quick look, and it doesn't seem quite right. If I remember, the channel number is displayed one row lower than the sample that is being played.

Reply 107 of 352, by FreddyV

User metadata
Rank Member
Rank
Member

Hi,

@root42: In this release, I added the error code display. The problem is simply in the File Open DOs function, it does not return 0...
Can you send me the full code ?

Here is the latest version with more improvement.
Change Log:
19/07/19
- BlasterBoard detection Ok.
- Max Frequency for BlaserBoard : 62KHz
- BlasterBoard detection corrupted the Sound Blaster: Added another DSP Init to correct.
- Correct the Sound Blaster env variable Read
- Correct the Gravis Ultrasound Volume (Used 33 values instead of 65)
- Music notes no more displayed out of the screen (Sample display mode)
- Various display bug and french text removed.
- Improve mixing speed (Again) +5% for 4 Channels MOD.

@MobyGamer: Finally, The "MOV" instead of "ADD" for the first mixed channel is here. I believe it will be really difficult to go further now.

With a new YouTube Video:
https://www.youtube.com/watch?v=bI6zXfPUoWw

Attachments

  • Filename
    MODMXT6.zip
    File size
    73.54 KiB
    Downloads
    15 downloads
    File license
    Fair use/fair dealing exception
Last edited by FreddyV on 2019-07-23, 06:59. Edited 1 time in total.

Reply 108 of 352, by MobyGamer

User metadata
Rank Member
Rank
Member
root42 wrote:

Here you go: https://demozoo.org/music/141591/
I will test without emm386 in a minute!
EDIT: nope, doesn't make a difference. Even without emm386 and no EMS/UMB it does not work.

It plays fine for me on modmxt6 on my 8086 system.

FreddyV wrote:

Hi,
- Improve mixing speed (Again) +5% for 4 Channels MOD.

Okay, testing speed:

ALBINOSE.MOD (4-channel) @ 27000 Hz and output volume 100% on an 8MHz 8086:
MODMXT4: Cnt1:4754 Cnt2: 854 Cnt: 67
MODMXT6: Cnt1:1423 Cnt2: 0 Cnt: 0

Massive improvement! I could go as high as 28400 Hz before Cnt started incrementing. So based on that, V6 performs roughly 5.1% faster with 4-channel MODs.

This is a great result and MODMXT is now the player I reach for on my 286 and lower systems 😎

If you ever get bored, maybe I can help with the accuracy/bugs. There are still some playback bugs (some you know about, some you can't seem to hear but I can) that I'd be happy to help out with if you ever open-source the code on github. The high note of the guitar in REVELATN.S3M (at 0:09 in your video) is sharp, for example.

Reply 109 of 352, by MobyGamer

User metadata
Rank Member
Rank
Member

Discovered another bug: The timing of various instrument triggers varies with mixing speed. So if you listen to LIBERTIN.MOD at mixing at 8 KHz and only play channel 5 to isolate the drum loop at patterns 6+, you can hear it triggering just a hair too late (there is a gap between when it ends and starts). But if you change the mixing speed to 16KHz and do the same thing, now you can hear the sample retriggering just a little bit too early. This probably explains other issues I've heard. Why do you think this might be?

Reply 110 of 352, by 640K!enough

User metadata
Rank Oldbie
Rank
Oldbie
root42 wrote:

It does not crash, but says it failed to load the file. I think I attached a screenshot earlier. I need to find a MOD with 8 channels, then I'll try.

EDIT: found one, doesn't work https://youtu.be/5LasI46cDls

Might this have something to do with the file attributes? From the description, it sounds like the call to open the file itself is failing. One possible cause could be that your files are read-only, and the player tries to open them as read/write, or similar. I doubt the solution would be that simple, but it may be worth mentioning.

Reply 111 of 352, by root42

User metadata
Rank Oldbie
Rank
Oldbie
FreddyV wrote:

Hi,

@root42: In this release, I added the error code display. The problem is simply in the File Open DOs function, it does not return 1...
Can you send me the full code ?

"File open error code 5"

Does that help?

YouTube and Bonus
80386DX@25 MHz, 8 MiB RAM, Tseng ET4000 1 MiB, SnarkBarker & BlasterBoard, PC MIDI Card + SC55 + MT32, XT CF Lite, OSSC

Reply 113 of 352, by FreddyV

User metadata
Rank Member
Rank
Member

Discovered another bug: The timing of various instrument triggers varies with mixing speed.

Hi, it was the same problem as the note pitch lower at 48KHz.
It was a precision problem in the frequency divisor calculation.
Then, her is the new version so that you can play LIBERTIN.MOD again and again (Apparently, you like it 😀 )

BlasterBoard code at 62KHz should be fine as well then. (LABS, can you think about the DMA signed mode ? 😀 )

@root42: I also changed the file read code, it may fix the .MOD File open problem.
I suppose that the difference was in the Operating system you are using.

With the recent change, Mod Master starts to be more stable.
I may change its name to Mod Master XT 1.0 after Stereo support and Period/Arpeggio correction.

Up to now, Mod Master seems to be known only "Here" Does anybody know if it can be interesting for more people, and how to have it more known ?

Filename
MODMXT7.zip
File size
72.4 KiB
Downloads
14 downloads
File license
Fair use/fair dealing exception

Reply 114 of 352, by root42

User metadata
Rank Oldbie
Rank
Oldbie

It works. FYI, I am running MS DOS 5.0...

Videos will follow tomorrow. My DSL uplink is currently bog slow.

EDIT: https://youtu.be/oX8A_9vWZuE
https://youtu.be/VgX-eeC2jTA

YouTube and Bonus
80386DX@25 MHz, 8 MiB RAM, Tseng ET4000 1 MiB, SnarkBarker & BlasterBoard, PC MIDI Card + SC55 + MT32, XT CF Lite, OSSC

Reply 115 of 352, by matze79

User metadata
Rank Oldbie
Rank
Oldbie

Samples on SN76489 also sound pretty bad.. 😀

https://dosreloaded.de - The German Retro DOS PC Community
https://www.retroianer.de - under constructing since ever

Co2 - for a endless Summer

Reply 117 of 352, by matze79

User metadata
Rank Oldbie
Rank
Oldbie

TI SN76489

3 Voice Sound Generator used in Tandy and on some other Computers 😀

https://dosreloaded.de - The German Retro DOS PC Community
https://www.retroianer.de - under constructing since ever

Co2 - for a endless Summer

Reply 118 of 352, by alvaro84

User metadata
Rank Member
Rank
Member

Another one keeping an eye on you work here!

I found it last week and see how much happened since then! I'll have to transfer the newest version to the CF card I tested ModMaster 4 from .

Unfortunately I could only try it on an Am5x86 so far, which is not exactly in the intended speed range 😐 I aim to use it on 8086/88 and 286 builds too. But my test bench was occupied by this PCI 486, so...

On GUS (a Primax clone to be more exact) it worked well, it was nice and clean of course. Not so on the CT2290 SB16 but it can still easily pass as a GLX competitor 😁 I'm looking forward to do more meaningful testing with it, like on my permanent 286-20 build with GUS 3.74 and ESS 688. On that machine it has a fair chance to be the best modplayer.

Shame on us, doomed from the start
May God have mercy on our dirty little hearts

Reply 119 of 352, by MobyGamer

User metadata
Rank Member
Rank
Member
FreddyV wrote:

Then, her is the new version so that you can play LIBERTIN.MOD again and again (Apparently, you like it 😀 )

Zodiak was a friend of mine from the early days of the demoscene. And, it's a good song for testing frequency/duration issues...

...which is how it found another issue in modmxt7 😀 Sound Blaster playback divisors of 233 and below play normally, but once you select frequency 44000 (FR: 45454, F_SB: 234), the sound is garbled. You can reproduce this by setting the output rate to 44000, then playing LIBERTIN.MOD, then immediately hitting 2-3-4-5-6 to disable voices 2 through 6, leaving only voice 1. Then hit right-arrow to go to pattern 5 and you'll hear it's all "warbly" and incorrect.[/quote]

@root42: I also changed the file read code, it may fix the .MOD File open problem.

I never had problems opening files, unless I ran GLX beforehand. If GLX is started with a bad argument or something, it exits to DOS but then you can't load any files and you have to reboot. GLX has a bug!

Up to now, Mod Master seems to be known only "Here" Does anybody know if it can be interesting for more people, and how to have it more known ?

Several people have discovered it, but once it's completely finished and you won't be working on it any more, you can do a final release and post a new topic somewhere else on VOGONS and I'm sure you'll get some attention. I would also be happy to promote a final release.