Maes
I like big butts!

Posts: 8664
Registered: 07-06 |
@Triple_sSs
Heh a missing "else" caused it not to work. I fixed it and updated the v1.5 distro file. Now you can have PC speaker sound with stereo, volume changes and pitch variations ;-) I may build in a "wav to speaker" converter so that it works for user-defined sounds, too, in the future. For anyone curious, I did use fraggle's frequency table and PC speaker research as a reference (credited in the source) but did some extensions to it (e.g. found a logaritmic formula that gives more frequencies than those in the table), and the synthesizing method used is actually original (I didn't simply copy chocolate doom's in this case).
The -clipsound and -audiolines "drivers" are intended to be more like fallback modes. David Martel's original method was similar to the current -audiolines driver, in that it uses as many threads as channels and tried to secure an independent audioline for each channel and manipulate volume, panning and pitch directly with audioline controls.
The problem with that approach is that Java doesn't guarantee that you will get any of those controls even if you ask for it -e.g. you may get no panning at all, plus on Linux in particular asking multiple audiolines is very bad practice, and soon overloads the audio system. Linux seems to be worst offender in this case, where not even getting a panning/balance control for STEREO audiolines was guaranteed.
The -clipsound driver was actually a failed attempt to work around that, but it's not that great because each Java sound Clip is actually an AudioLine in disguise, and so it's subject to the same limitations -minus the multithreading- plus a lot of limitations that affect Java Clips in general. It's in there more like a fallback to the fallback.
The default sound driver actually implements the unused soundcode found in linuxdoom (!) in Java, which also enables full control over pitch and volume, since its does its own mixing and so doesn't depend
as much on the whims of the OS. It does work, although buffering and queing may sometimes be less than perfect, but hey, I had to develop that one almost from scratch. OTOH, it could double as a MOD player...
@natt: thank finnw for that ;-)
It turned out that there's no OS-wide "MIDI device volume" control on any OS, generally speaking. The one present in the Windows mixer is more like a user-friendly courtesy which must do a similar per-note hack. E.g. starting chocolate or prboom+ and changing volume from within the game has no effect on the mixer's slider (you can get full MIDI volume in-game even if you set the external slider to almost zero). I think only if you use an older soundcard with a recordable, distinct MIDI line (e.g. like the AWE32 card) you get a genuine global synth control, otherwise what you get is a note hack. Oh well. Since there's an OPL3 emulator written in pure Java laying around, you can guess which is the next step ;-)
Edit: I forgot to document that now you can take screenshots, but it's oldschool all the way: you must use -devparm and F1, and they are in PCX format. Next time I will add PNG ;-)
Last edited by Maes on 08-01-11 at 08:51
|