MSS (Modular Soft Synth)

Change Log

MSS version Date Changes
MSS v0.74 2002-04-20 First version
MSS v0.75 2002-04-27 + Space for huge wave table allocated on the heap instead of on the stack in waveTableGen
+ Midi input revised. Input from /dev/ttySxx should now work (tested with Technics KN501 keyboard), 
   possibly also input from /dev/midi (not tested)
+ The DSP device is reset when all notes are off (this helped getting rid of an annoying clicking noise in the right channel on my system)
+ More info output by default
+ Added option -mididebug
+ Documentation update
MSS v0.75.1  2002-05-02 Bug fix (setting of midiDevice via synthconfig file)
MSS v0.75.2 2002-05-10 + Midi input handling has been redesigned to more accurately follow the Midi protocol spec
+ Bug fix in the GUI (contents of the control window should now resize with the window)
MSS v0.76 2002-05-25 + Envelope generator cleanup, Log-Lin-Exp envelopes implemented plus performance enhancements
+ Velocity sense implemented for envelope generators, i.e the sensitivity to pressed key velocity is controlled per Adsr instance
+ Envelope time is now absolute (unit is seconds) instead of the previously used control interval unit. Previously saved MSS configurations will sound quite different because of this change in envelope time unit
+ pitch wheel input via Midi implemented
MSS v0.76.1 2002-06-02 + setuid privileges now dropped before calling gtk_init (required by GTK+-1.2.9 and later)
MSS v0.76.2 2002-06-22 + some optimizations implemented

Overview

MSS is an advanced software synthesizer for Linux, i.e it is a program that can synthesize very complex waveforms and play them through the sound cards D/A converter (for more info about hardware and software requirements, see System requirements). It is a real time synthesizer that can be played either via the builtin keyboard (a GUI widget that is played via the mouse), or via an external MIDI keyboard. The "real time" means that any adjustments you do while playing (e.g change of filter settings) are immediately audible.

MSS is a modular synthesizer, i.e the synthesizer module configuration (in terms of the number and type of synthesizer modules, and how they are interconnected) is not fixed. MSS includes a set of synthesizer module types like different kinds of oscillators, filters, envelope generators and so forth (the available module types are described in  Module reference ). The synthesizer configuration can in principle be any set of module instances selected from the available module types. New module instances may be added and interconnected via menu choices. It is possible to setup very complex configurations in this way. The limiting factor is in practise probably the available computer resources (CPU speed), and maybe your own imagination in creating complex configurations.

MSS is just a synthesizer. It does not provide any sequencing or recording functionality at all, i.e you can only play it yourself and you can't save your performance. It is simply just an instrument.

The module configuration (including the parameter settings in each module) can be loaded from or written to file. MSS includes a small set of example module configurations, see Module configuration examples.

The MSS GUI

The MSS GUI is rather primitive. It does allow you to add/delete/change/browse properties of synthesiser modules, but it is far from user friendly. The priority during MSS development has been to develop a sophisticated synthesizer that offers a lot of possibilities to create interesting sounds, not to develop a synthesizer with a flashy look-and-feel.

The GUI is distributed on two windows, a nice keyboard window and a not-so-nice control window. The keyboard window is very much inspired from the Ultramaster Juno-6 keyboard (see http://www.ultramaster.com/juno6/index.html). Any credit for the keyboard design goes to Ultramaster. The control window can be blamed on me. The control window contains all the synthesizer modules. It simply groups all synthesizer modules according to module type, i.e oscillators together, ADSR envelope generators together etc. All synthesizer modules have simple sliders/radio buttons to control the synthesizer module parameters.

The most annoying aspect of the control window GUI is probably that the connectivity among different modules is not directly visible in the GUI. You have to open the pop-up menu on a particular module to see what other modules are connected to its inputs. This makes it possible to get a grasp of the module interconnectivity, but it is far from user friendly.

System requirements

Hardware requirements

Software synthesis is a very CPU demanding task. Complex waveforms are generated sample by sample in real time (the sample rate is typically around 44 kHz), and the stream of samples is then shaped by filtering etc. The amount of CPU power needed depends on the number of notes being played simultaneously, the number and type of synthesizer modules used in the synthesizer configuration, as well as the parameter settings used in the modules.

An example: On my Pentium II 450 MHz around 28 % of the CPU is needed to play 4 simultaneous notes (using 2 oscillators, 2 filters, 4 envelope generators and 1 LFO). The load on the CPU increases if I play more notes or if I increase the number of modules in the configuration.

So there is no precise recommendation on how fast a CPU is needed to play this synth. The faster the better is the general recommendation, since you can then use more modules (giving more possibilities to create interesting sounds) in the configuration without running out of CPU cycles.

Software requirements

You need an OSS driver for your soundcard supporting at least DSP (/dev/dsp) output. If you also want to use MIDI input from an external keyboard you might need driver support for MIDI input (e.g for /dev/midi). If you want to use MIDI input via the serial port no special driver is needed.

Software requirements is basically Linux plus GTK+ version 1.2 (available via http://www.gtk.org/). If you want to build MSS from the sources you need GTK+, libpthread and libgthread. If you download the statically linked executable you don't need to have any of these installed. MSS is implemented in C++, so you'll need g++ to build it from the sources.

MSS has been developed and tested only on Red Hat Linux 7.0 running on a Pentium II with GTK+ version 1.2 and an ESS Maestro-2 based soundcard. MIDI input from an external keybord has been tested only with a Technics KN501 MIDI keyboard connected via the serial port. In principle, MSS should compile and run without problems on any x86 Linux with an adequate OSS driver.

MIDI input limitations

MIDI input handling has been redesigned to accurately parse any MIDI protocol messages. All MIDI messages should be recognized, although only the "NOTE ON" , "NOTE OFF" and "PITCH WHEEL CONTROL"  messages are actually implemented. All other MIDI messages are ignored. For further info regarding midi debugging, see Debugging & bug reporting .

Installation

For a source installation you need to download the file mss-<version>-src.tar.gz, where <version> indicates a particular version of MSS.
  1. unpack mss-<version>-src.tar.gz. The command 'tar zxpf mss-<version>-src.tar.gz' will create the mss<version> directory containing the MSS source distribution in your current directory.
  2. cd into the mss<version> directory.
  3. configure the synth as needed according to chapter Configuration.
  4. build the synth from sources (command 'make')
  5. install the synth (command 'make install'). If possible, you should install MSS as root (see  Real time aspects)
  6. run the synth by issuing the command './runsynth.sh' in the installation directory.
For a binary installation you need to download the file mss-<version>-bin.tar.gz. The only difference between the source and the binary distributions is that the binary distribution does not require any build from source, and it does not not require GTK+ to be installed on your system.
  1. unpack mss-<version>-bin.tar.gz. The command 'tar zxpf mss-<version>-bin.tar.gz' will create the mss<version> directory containing the MSS binary distribution in your current directory.
  2. cd into the mss<version> directory.
  3. configure the synth as needed according to chapter Configuration.
  4. generate the wave tables (command 'make -C tools tables'). This step is not absolutely necessary, but it will reduce MSS startup time.
  5. install the synth (command 'make install'). If possible, you should install MSS as root (see  Real time aspects)
  6. run the synth by issuing the command './runsynth.sh' in the installation directory.

Configuration

MSS may be configured as follows: The synthconfig file contains a number of settings for MIDI and DSP output:


These are the default settings in the synthconfig file:

midiDevice            /dev/ttyS0
dspOutput_sampleRate  44100
dspOutput_controlRate 1000
dspOutput_channels    2
dspOutput_bits        16
dspOutput_numFrags    3
dspOutput_fragSize    1024
dspOutput_deviceName  /dev/dsp

If you change the sample rate to anything else than the default 44100 Hz, you should be aware of an optimization done in MSS in order to reduce startup time: At startup MSS tries to open two big wave table files (parabolaTable and sawTable in the tools directory). If the wave table files are found, they are expected to hold valid wave tables for the currently configured sample rate. If they are not found, internal wave tables are constructed each time MSS is started.

The wave table files are automatically created when MSS is built from source. If you need to regenerate the wave table files for a different sample rate, edit the Makefile in the tools directory and then run make in that directory.

Basic principles

MSS is a kind of hybrid synthesizer design. On the one hand we have a set of synthesizer modules typically found in old analog subtractive synthesizers, e.g oscillators, filters and envelope generators. On the other hand we also have wave table driven oscillators where wave forms are synthesized in an additive manner. And we also have the ability to employ FM synthesis, i.e one oscillator is frequency modulated by one or more other oscillators in order to generate a complex wave form. And there are also granular synthesis and physical modelling oscillators provided.

The overall goal of MSS was to create a very flexible synthesizer. The supplied synthesizer module types (different kinds of oscillators, filters, envelope generators etc), plus the ability to create and interconnect arbitrary instances, plus the fact that each module type in itself has a number of parameters that can be independently adjusted gives you immense flexibility in creating complex sounds.

The following module types are available:


For performance reasons, MSS makes a clear distinction between sample rate modules (sampled at a relatively high rate, typically 44100 Hz) and control rate modules (sampled at a lower rate, typically around 1000 Hz). Both sample rate and control rate are configurable, see  Configuration . Sample rate modules like oscillators, filters and noise generators typically work on the stream of samples output to the D/A converter.
Control rate modules are used for modulation of sample rate modules. Sample rate oscillators is a special case, they may be used either for producing the sample stream (as generators) or for frequency modulation in FM synthesis (as modulators).

The sample rate limits the maximum frequency that may be generated in the output to half the sampling frequency. The control rate limits the time resolution of the control signals generated by control rate modules. A control rate of 1000 Hz means that e.g Adsr envelopes have a resolution equal to 1 ms.

For more info about synthesizers in general, filter algorithms etc, see Links.

Using the synth

Getting started

MSS is started by changing directory to the installation directory and typing './runsynth.sh'

Two windows will appear, one control window and one keyboard window. The control window shows the default synthesizer configuration (read from file moduleconfig).

The synth may be played either on the built-in GUI keyboard, or on an external MIDI keyboard. Module parameters in the current synthesizer configuration may be changed directly in the synth control window. The current synthesizer configuration (including the module configuration) may be saved to file, or changed by reading a new configuration from file.

The current synthesizer configuration may be changed by interactively creating/deleting synthesizer modules, or change their properties. Put the cursor on top of an existing module and use the popup dialog to add/delete modules or change their properties. The controllable parameters (see Module reference  for a listing of the controllable parameters for each module) may be changed directly in the control window GUI.

Real time aspects

If possible, you should install MSS as the root user. It is possible to install as a non-root user, but MSS will then not be able to adjust the real time priority for optimal performance (at startup MSS tries to SUID to root in order to set real time scheduling priority). This attempt to set real time scheduling priority will succeed only if MSS was installed as a SUID root executable. If unsuccessfull, MSS will continue to run, but the real time characteristics are likely to suffer: Processing demands from other processes are more likely to disturb MSS in the sense that sound quality is affected, audible drop-outs etc. Also note that installing MSS as the root user doesn't guarantee that you won't get e.g audible dropouts during heavy disk activity by other processes, but the dropouts will be less likely to occur.

Because of the real time scheduling, MSS also has a very brutal mechanism for load control built-in. The current CPU load is continuously monitored, and when the load becomes too high MSS simply stops all sample processing until the CPU load decreases. This will cause long dropouts every other second or so. You then have to release some notes or stop adjusting parameters furiously (or whatever you are doing) in order to be able to play new notes. This simple mechanism is just a safety thing that prevents the real time scheduled process from completely starving all other processes on your system, including the MSS GUI. If you play MSS via the GUI you want the GUI to respond when you try to release notes.

Module parameter settings & intermodule dependencies

MSS offers a lot of flexibility in setting module parameters and interconnecting modules. There is nothing that stops you from setting things up in such a way that either no sound at all is produced, e.g extreme oscillator tunings or filter frequency settings. Or setting things up so that very weird sounds are produced, e.g most non-harmonic oscillator tunings or overloaded inputs because of too high gain settings.

These are the only restrictions imposed by MSS:

Module configuration examples

In the sounds/ directory there are a few configuration examples that gives a hint of what kinds of sounds can be produced by MSS, and how to produce them. These few examples serve no other purpose than being a starting point for your own experimentation ! Bear in mind that the few examples provided here by no means exploit the full potential of MSS, they are just simple examples.

Module reference

The module types listed below are available. Module types in general have a set of controllable parameters and a set of inputs. A controllable parameter is something that may be changed via a GUI control, e.g the tuning of an oscillator. As long as you don't change the value of a controllable parameter via the GUI it remains constant. Inputs, on the other hand, receive time-varying values. An example is the gain of an oscillator: Oscillator amplitude may be given a time-varying value via e.g an Adsr module, i.e the gain may vary over time.

WTOscillator

This is a wave table driven oscillator where the generated wave form is constructed additively by adding together partials with controllable amplitude and phase. A WTOscillator instance may be frequency modulated by both low frequency oscillators (for vibrato) and tone frequency oscillators (for FM synthesis). The tuning of a WTOscillator instance may be set freely as a product of a parameter and the frequency of the triggering note, e.g 2.0 times the frequency of the triggering note. The gain of a WTOscillator instance may be envelope controlled.

The WTOscillator has the following controllable parameters:

The WTOscillator has the following inputs:

WaveTable

The wave table constructs a wave form additively by adding together a number of partials with controllable amplitude and phase.

The WaveTable has the following controllable parameters for each partial:

The WaveTable has no inputs.

PlainOscillator

This is an oscillator that produces any of the wave forms parabola, variable slope triangle, saw, and variable width pulse. A PlainOscillator instance may be frequency modulated only by low frequency oscillators (for vibrato). Otherwise, frequency and gain control is the same as for the WTOscillator. The tuning of a PlainOscillator instance may be set freely as a product of a parameter and the frequency of the triggering note, e.g 2.0 times the frequency of the triggering note. The gain of a PlainOscillator instance may be envelope controlled.

The PlainOscillator has the following controllable parameters:

The PlainOscillator has the following inputs:

WaveGuideOscillator

This is an oscillator that physically models a plucked string. Otherwise, frequency and gain control is the same as for the WTOscillator. The tuning of a PlainOscillator instance may be set freely as a product of a parameter and the frequency of the triggering note, e.g 2.0 times the frequency of the triggering note. The gain of a WaveGuideOscillator instance may be envelope controlled.

The WaveGuideOscillator has the following controllable parameters:

The WaveGuideOscillator has the following inputs:

AGOscillator

This is an asynchronous granular oscillator that produces waveforms made up from individual sonic grains (short bursts of sound). An AGOscillator instance may be frequency modulated only by low frequency oscillators (for vibrato). Otherwise, frequency and gain control is the same as for the WTOscillator. The tuning of an AGOscillator instance may be set freely as a product of a parameter and the frequency of the triggering note, e.g 2.0 times the frequency of the triggering note. The gain of an AGOscillator instance may be envelope controlled.

The AGOscillator has the following controllable parameters:

The AGOscillator has the following inputs:

Filter

This is a second order filter with selectable filter type (low pass, high pass, band pass, band stop) and controllable relative cutoff frequency and damping. The filter cutoff frequency may be envelope controlled. The cutoff frequency of a Filter instance may be set freely as a product of a parameter and the frequency of the triggering note, e.g 2.0 times the frequency of the triggering note.

The Filter has the following controllable parameters:

The Filter has the following inputs:

SimFilter

This is a first order non-resonant filter with selectable number of filter sections in cascade and controllable relative cutoff frequency. The only supported filter type is low pass.  The filter cutoff frequency may be envelope controlled. The cutoff frequency of a Filter instance may be set freely as a product of a parameter and the frequency of the triggering note, e.g 2.0 times the frequency of the triggering note.

The SimFilter has the following controllable parameters:

The SimFilter has the following inputs:

MFilter

This is a fourth order low pass filter with controllable relative cutoff frequency and resonance. The filter cutoff frequency may be envelope controlled. The cutoff frequency of a MFilter instance may be set freely as a product of a parameter and the frequency of the triggering note, e.g 2.0 times the frequency of the triggering note.

The MFilter has the following controllable parameters:

The MFilter has the following inputs:

BiquadFilter

This is a second order filter with selectable filter type (low pass, high pass, band pass, notch, peaking EQ, low shelf) and controllable relative cutoff frequency and Q value. The filter cutoff frequency may be envelope controlled. The cutoff frequency of a BiquadFilter instance may be set freely as a product of a parameter and the frequency of the triggering note, e.g 2.0 times the frequency of the triggering note.

The BiquadFilter has the following controllable parameters:

The BiquadFilter has the following inputs:

AllPassFilter

This is an all pass filter with controllable gain and delay.

The AllPassFilter has the following controllable parameters:

The AllPassFilter has the following inputs:

MultiDelay

This is a 4 tap delay line with controllable gain and delay for each tap. The delay may be envelope controlled.

The MultiDelay has the following controllable parameters:

The MultiDelay has the following inputs:

LFOscillator

This is a low frequency sine wave oscillator intended for modulation of other synthesizer modules. The LFO may be used for modulating the frequency of a WTOscillator or a PlainOscillator, or the pulse width of a PlainOscillator generating a pulse wave form, or the cutoff frequency of any of the filters.

The LFOscillator has the following controllable parameters:

The LFOscillator has the following inputs:

Adsr

This is an envelope generator that may be used for envelope control of many module parameters, e.g filter frequencies and oscillator gain.

The Adsr has the following controllable parameters:

The Adsr has no inputs.

PinkNoise

This is a source of pink noise with controllable gain.
This is a low frequency sine wave oscillator intended for modulation of other synthesizer modules. The LFO may be used for modulating the frequency of a WTOscillator or a PlainOscillator, or the pulse width of a PlainOscillator generating a pulse wave form, or the cutoff frequency of any of the filters.

The PinkNoise module has no controllable parameters.

The PinkNoise module has the following inputs:

Comments & questions

If you have comments, questions or suggestions regarding MSS, you can contact mats.olsson@chello.se.

I have worked on MSS now and then over a rather long period of time just for the fun of it. Implementing a powerful software synthesizer is a great challenge, it certainly demands knowledge in some diverse areas: Sound synthesis algorithms (how to generate sounds), software architecture and design (how to design a sufficiently flexible and efficient software system), GUI design (how to present a usable interface) and, last but not least, efficient implementation of real-time software.

Is there anybody out there interested in improving e.g the GUI ?

Debugging & bug reporting

If you have problems building MSS from the sources, then please check the System requirements to verify that you have the necessary libraries installed. Then try building with 'make > mylog' and send me a mail including the resulting log file 'mylog'.

MSS provides some debugging options that may help in identifying problems running MSS.

Using the option -mididebug gives a printout of each MIDI message received via the MIDI input port. All messages are printed, although only the "NOTE ON", "NOTE OFF" and "PITCH WHEEL CONTROL" messages are actually implemented. If you have a problem using your external MIDI keyboard with MSS, please start MSS with the command './runsynth -mididebug > mylog', then hit a few keys on the keyboard and send me a mail including the resulting log file 'mylog'.

Using the option -debug gives a verbose printout of MSS internal information. If you have a problem using the builtin keyboard (the keyboard window) with MSS, please start MSS with the command './runsynth -debug > mylog', then hit a few keys in the keyboard window and send me a mail including the resulting log file 'mylog'.

If you think you have discovered a bug in MSS, please notify me via mail to mats.olsson@chello.se.

Links

OSS for Linux
http://www.gtk.org/
Sound & MIDI Software For Linux
http://www.harmony-central.com/Computer/Programming/
http://www2.hku.nl/~peter4/granindex.html
http://www-ccrma.stanford.edu/~jos/wg.html
http://www.ultramaster.com/juno6/index.html