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.
FreddyV wrote:My current adlib code is this one. […] Show full quote
My current adlib code is this one.
1 MOV DX,388h 2 MOV AL,43h ;Porteuse de la voie 1 3 OUT DX,AL 4 IN AL,DX 5 IN AL,DX 6 IN AL,DX 7 IN AL,DX 8 IN AL,DX 9 IN AL,DX 10 11 INC DX 12 POP AX 13 MOV BX,OFFSET T_Adlib 14 XLAT ;Lire la table Log 15 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):
1; PrepareToSampleOut() 2; 3; This routine start the oscillator whith a frequency of 250 Hz, and 4; wait until 1/4 of the first period (sin). Then set the frequency to 0, 5; in order to block the internal level to its maximum. 6; If the voice 0 is used only for sampling, call this routine once; 7; otherwise call before every time you call 'OutSample()' 8; 9Proc PrepareToSampleOut near 10 mov ax,[AdlibIO] 11 inc ax 12 mov [PORTMOD+1],ax ; Adlib port address. 13 14 mov dx,[cs:AdlibIO] ; Get the adlib board I/O address. 15 16; set some parameters of voice-0: 17 mov ax, 02021H ; am= 0, vib= 0, eg-type= 1, ksr= 0, multi= 1 18 call OutAdlib 19 mov ax, 060f0H ; attack rate == MAX, decay rate = MIN 20 call OutAdlib 21 mov ax, 080f0H ; sustain level = MAX, release rate = MIN 22 call OutAdlib 23 mov ax, 0C001H ; feed-back= 0, connection = 1 (additive) 24 call OutAdlib 25 mov ax, 0E000H ; wave-select = 0 (sinus) 26 call OutAdlib 27 mov ax, 0433fH ; voice-0, slot-1 = MAX attenuation 28 call OutAdlib 29 30; make sure that voice-0 is off: 31 mov ax, 0B001H ; voice 0, f_num = 256 32 call OutAdlib 33 34; start note-on on voice-0 with freq. of 250 Hz: 35 mov ax, 0A000H+(F_NUM AND 0ffH) ; set 250 Hz 36 call OutAdlib 37 mov ax, 0B000H+20H+(BLOCK SHL 2)+(F_NUM SHR 8) 38 call OutAdlib 39 40; disable interrupt for timing section: 41 cli 42 43; Time 1/4 of period using the timer-0 of the system. The timer frequency 44; is 1193180 Hz. 45 mov al, 00H ; latch counter-0 46 out TIMER_MODE, al 47 in al, TIMER0 ; low byte 48 mov bl, al 49 in al, TIMER0 ; high byte 50 mov bh, al ; count in BX 51 52; wait until timer-2 down by DELAY_COUNT: 53@@LP3: mov al, 00H ; latch counter-0 54 out TIMER_MODE, al 55 in al, TIMER0 ; low byte 56 mov cl, al 57 in al, TIMER0 ; high byte 58 mov ch, al ; assemble 16 bits word in DX 59 neg cx 60 add cx, bx ; start - end
…Show last 27 lines
61 cmp cx, DELAY_COUNT 62 jb @@LP3 63 64; time-out... 65; block frequency of voice-0: 66 mov ax, 0B000H+20H ; set high bits of f_num and block to 0 67 call OutAdlib 68 mov ax, 0A000H ; set f_num to 0 69 call OutAdlib 70 71 sti 72 73; set address register to Total-Level of oper-0, voice 0 74 mov al,40H 75 out dx,al 76 inc dx ; dx = port +1 77 78; small delay... 79 in al, dx 80 in al, dx 81 in al, dx 82 in al, dx 83 in al, dx 84 85 ret 86 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).
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.
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.
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.
@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.
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.
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.
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?
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.
@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
80486DX@33 MHz, 16 MiB RAM, Tseng ET4000 1 MiB, SnarkBarker & GUSar Lite, PC MIDI Card+X2+SC55+MT32, OSSC
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 ?
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
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.