4Front Virtual Synthesizer (SoftOSS)IntroductionUntil today a special wave table soundcard has been required to play high quality MIDI music. SoftOSS by 4Front Technologies is a kernel module which permits doing the same using any inexpensive16 bit soundcard together with a sufficiently fast CPU (see the System requirements section).SoftOSS is 100% compatible with the existing wave table API of OSS which has earlier been used by the Gravis Ultra Sound (GUS) driver. This means that all Linux applications work without modification with SoftOSS. Technical BackgroundSoftOSS is a virtual wave table engine that is tightly integrated with MIDI and audio functionality of OSS. SoftOSS engine uses CPU cycles to mix prerecorded audio samples in control of MIDI information coming from any application using /dev/sequencer or /dev/music (formerly known as /dev/sequencer2) device files. The resulting 16 bit stereo audio data stream is then played using an ordinary (16 bit) soundcard (support for 8 bit soundcards will be introduced later).Since the mixing is done inside kernel it doesn't suffer from other processing activity in the system. For this reason it is possible to perform CPU intensive tasks at the same time when using SoftOSS. Sound quality is as good as in a lightly loaded system (other tasks just run slower depending on number of currently active SoftOSS voices/notes). SoftOSS is fully compatible with the sound sample loading API originally developed for the GUS driver of OSS. This means all applications which support loading samples to GUS will work with SoftOSS without any changes. OSS includes a library called OSSlib which permits "on demand" loading (aka patch caching) of wave table samples from any programs using the /dev/music (/dev/sequencer) API of OSS. Together with changes made to sys/soundcard.h this library permits adding patch caching to existing applications using /dev/sequencer and /dev/music with very minimal changes. First release of this OSSlib library will permit loading samples from .PAT format (GUS) instrument files and from standard audio files (.au, .wav). Later versions will support other patch file formats such as SoundFont (.sf2). You will need the GUS compatible patch set to run SoftOSS. A freeware version of this library has been released too to permit developing OSS compatible applications with OSS/Free. In addition the freeware library will permit using applications written for OSS to work also with OSS/Free without recompiling. Specification of new /dev/music API will be released after development of OSSlib is complete.
Applications of SoftOSS TechnologySoftOSS is mainly designed for playing MIDI music but it's well suited for some other applications too, including:
System RequirementsDue to high processing power requirements of "software mixing" SoftOSS is targeted to fast machines only. With current (rather nonoptimized) version it's possible to play 32 simultaneous voices using 32 kHz sampling frequency using a P120 machine (figures for PPro200 are not available yet). However even this is better than the sampling frequency that is possible at 32 voices using a popular wave table card (19.2 kHz). With a 100 MHz PowerPC processor (RS6000/AIX) it's possible to get almost 32 simultaneous voices at 44.1 kHz.
CPU power requirements of SoftOSS depends on concurrently playing notes (voices). You can use 44.1 kHz sampling frequency with any 486 class CPU as long as number of voices remains low. For example playing a .MOD file using gmod should be possible with any machine. Even in low end 486 class machines SoftOSS gives better MIDI playback quality than the standard FM synth. Using SoftOSS with too slow CPU is not dangerous. Playback just becomes distorted (it jumps like a broken vinyl record) and system becomes rather unresponsive. However the situation returns back to normal after playback is stopped/interrupted or number of concurrently playing notes decreases below the system dependent limit.
SoftOSS stores the instrument samples on systems (physical) RAM. This means that there must be enough "spare" RAM on the system. Current version of SoftOSS permits loading up to 8M of samples which means that using it on machines with less than 16M RAM may not produce the desired performance. It is possible to use SoftOSS on systems with less than 16M of RAM but care must be taken that too many samples are not loaded. The final 3.8 version of SoftOSS will permit configuring the maximum memory size which makes it safer to use in underconfigured machines. Limitations of SoftOSSThere are few limitations in using SoftOSS. However in most cases they are not significant:
Getting SoftOSSSoftOSS is included in the standard OSS software (currently there is no extra fee).
Getting the Sound PatchesTo use SoftOSS you will need to use a "GUS compatible" Linux application such as mplay or gmod. You can get them from the OSS Applications page.With mplay, you need to copy the public-domain MIDIA instrument files. Now uncompress and extract the MIDIA patch files as follows: tar -zxvf instruments.tar.gz and this will extract 8-9MB of music instrument patches under a directory called "instruments". You need to move the instruments directory to /usr/local/lib/midia/instruments - (you may need to create the directory by typing mkdir /usr/local/lib/midia and then type mv ./instruments /usr/local/lib/midia Configuring SoftOSSConfiguring SoftOSS is very easy. Run soundconf and you will be presented with a menu that looks something like this:Save changes and Exit If you have not added any soundcards yet (they should be listed above this menu), you should configure it first by activating the "Add new card/device". To add SoftOSS you just need to activate the "Add new card/device" function and select one of the "4Front Tech. SoftOSS (for XXX) " entries wherehe XXX matches (roughly) your CPU. If you can't decide between two or more entries, select the "highest" one. If it doesn't work (playback jumps), you can start soundconf again to remove this one and to select a lower one. After adding the SoftOSS engine and a 16 bit soundcard, save the configuration and start OSS using soundon command. Then execute cat /dev/sndstat and verify that there is at least one audio device and the SoftOSS synth listed (just like below). Audio devices: Synth devices: Now use mplay program supplied with OSS (default is /usr/lib/oss/mplay) to play MIDI files. Type mplay # midifile.mid (where # is the synth number under the Synth Devices heading in the /dev/sndstat output. Future PlansDoesn't the above sound excellent? Not exactly. This version of SoftOSS is just a preview release. It doesn't contain all features which are planned to be included in future versions. The following are some examples:Support for sample distribution formats used for distributing commercial instrument samples and sound effects. SoundFont 2 will be the first format supported. Support for streaming instruments. Streaming instruments permit playing of very large audio files or computer generated sounds together with ordinary (shorter) samples which fit completely in memory. Using streaming instruments will require some form of support by the application but most of it will be handled by OSSlib. Support for 3D voice position and various special effects (will require faster (MMX?) CPUs than the ones available this year). |