pouët.net

Music in tiny intros

category: general [glöplog]
 
What kind of hardware do they need? I think I tried them in real DOS PC with SB back in time and there would be no music unless I didn't do something or didn't load some drivers.

That's one reason I never bothered to use sound in my intros, even though it seems to be making a big difference and maybe I should try it, I see even 32b intros with music sometimes and that could be few bytes. But I need to see how you work with this, what do you send where (is it the midi port 330h I think).

But is there some real hardware that is compatible with this? If I want to not just have them run in Dosbox, but also watch them on real DOS PCs, is SB not enough? What is the closest cheapest thing I can buy? Don't like to make something that only works in dosbox and not on a real PC.
added on the 2022-02-15 10:13:05 by Optimus Optimus
For MIDI via port 330 you need an MPU-401 + external synth or other hardware that emulates the MPU-401 interface, e.g. the later SB models with wavetable synthesis (AWE or SB16 with a daughterboard like the Dreamblaster).
A lot of the sound output variants are covered here: http://www.sizecoding.org/wiki/Output

But except for PC Speaker output, the others would require DOSBox. According to an example I got from Jin X you seemingly can simply output samples on the SB via
Code: mov dx,0x22C ; mov al,0xD1 ; sound on command ; out dx,al mov al,0x10 ; play sample command out dx,al ; ... calculate some sample value in the range 0..255 out dx,al ; output sample

This only works with 8b samples. The sound on command might be needed on real HW.
I checked the docs and only found DMA to be the way for 16b playback. If some reader here knows more about that, please correct me, if I'm wrong.
And before I forget ;)

BB Image
There was MegaEm, if you already happen to have a GUS lying around. I'd expect that to work fine with most tiny intros.
added on the 2022-02-15 12:26:35 by Moerder Moerder
For MIDI via port 330h, that is.
added on the 2022-02-15 12:28:43 by Moerder Moerder
@Moerder: Sounds interesting!

Here is a tiny intro using AdLib sound (src included): https://www.pouet.net/prod.php?which=5328

And HellMood once found this example for 16b playback on SB here https://stackoverflow.com/questions/41359112/playing-wav-files-on-dosboxs-sound-blaster-device
Although it's targeted at DOSBox, it might run on real HW without changes.
The topic is slightly complicated ^^

"MsDos" platform is largely undefined. It's merely the descriptor for the underlying OS, and even that changed to Freedos > DosBox > WinXP. In our dreams there is this the wonderful , really existing, pimped 486 DX machine with everything from Soundblaster with MIDI to fast VESA capable graphicscards, but almost no one really owns such a machine. We over time just assumed that DosBox would (at least closely) behave like such a machine, and that was mostly good enough.

Straight MIDI behaviour. The device should accept MIDI data on port 330h, and maybe set to "UART" mode with sending 0x3F to port 331(!)h first. That's how MIDI works at least on windows XP systems, and with the underlying NTVDM, it has been more or less accepted as "real hardware". Last time i successfully tested this was with Dragons Lair (2021)

It would be also possible to write MIDI with the soundblaster API ( linky page 78 ff ) which seem to require a few more bytes, but nothing meaningful if we talk 256b productions. In UART mode (later pages), it recommends exactly what we are doing, sending data to port 330h.

Concluding: If the Programming Guide for the Soundblaster tells us to do what we are actually already doing, and the system does not output sound, then that's a strong indicator for a faulty setup. cmr^dsr is about to build an oldschool system with real MIDI hardware these days, i'll be in exchange with him, because from time to time, i also want proof that at least *ONE* real oldschool system exists that actually works ;)
added on the 2022-02-15 14:05:11 by HellMood HellMood
Yep... as for real hardware setup: Sb16/gus with wavetable work fine.. MT-32 has different channel setup (but there are tools that allow it to accept standard midi). And there is still new hardware being made for pc/dos , sometimes via usb connection, sometimes via oldschool isa-connections.

but yeah, out 40h/61h,al / out dx,al (378 for covox, 330h for midi). Take your pick.
added on the 2022-02-15 22:35:53 by superogue superogue
Live 4K: https://www.pouet.net/prod.php?which=17402

Sources used to be available on ftp.scene.org

MIDI + MPU401
added on the 2022-02-18 21:58:30 by bdk bdk
Quote:
And HellMood once found this example for 16b playback on SB here https://stackoverflow.com/questions/41359112/playing-wav-files-on-dosboxs-sound-blaster-device


I can't find that example on that page (where is it?), but it might be possible to throw PCM bytes at a sound blaster set to direct mode using very little setup, like how some of the early PC modplayers did. This is much slower than just out dx,al though.

IMO, if size is the main concern, just make an lpt dac part of the requirements, then out dx,al.
added on the 2022-02-27 04:07:52 by trixter trixter
Quote:
it might be possible to throw PCM bytes at a sound blaster set to direct mode


That should be exactly what Dresdenboy described 8 posts above, right?

Quote:
just make an lpt dac part of the requirements, then out dx,al


Indeed. That's what some of intros from recent years are doing.
added on the 2022-02-28 13:57:13 by KeyJ KeyJ

login