Setting-Up, And Using ZynAddSubFX On Your System

Since ZynAddSubFX is complicated to say (and to write), often in this document, we will refer to it as Zyn.

Since ZynAddSubFX is installed in the process of installing the Help and Tutorials (and is also included in the 'normal' and 'extras' dependencies), it should already be installed on your system. If it isn't, you could install it using either the software center, or synaptic package manager, searching for zynaddsubfx.

Since this is something you could be using a lot, it is a good idea to create a desktop launcher for it. When you create a desktop launcher for it, you can customize that launcher to take care of setting it up to run the way you want it to run. Otherwise, you have to load parameters into it from a file manually, each time you use it.

Before You Run ZynAddSubFX

If you plan to run Zyn using the JACK (qjackctl) interface (which is the interface Zyn will use by default), you first need to run qjackctl, to fire-up the JACK interface. Since JACK is more efficient than PulseAudio/ALSA, it is more likely to work (without cutting-out) on a slower machine than PulseAudio/ALSA. But if you use JACK, you have to remember to fire-up qjackctl before running Zyn.

If, on the other hand, you use PulseAudio/ALSA, you need to make sure JACK is not running before running Zyn. Also, if you are using the Java Sound (Gervill) synthesizer with the KeyMusician Keyboard, you will have to disconnect it (by setting the “MIDI Output To” drop-box (of the “F1 Help/Setup” pane) to “none”). This must be done before running ZynAddSubFX. If you are not currently using the Java Sound synthesizer (and/or KMK is not running) you don't need to worry about this.

Remember that JACK and PulseAudio are 'mortal enemies' – you can't use them both at the same time. If you try, you may hang your system! You have to use one, or the other – not both. Keep in mind that audio through your Internet browser uses PulseAudio.

If ZynAddSubFX is set up to use PulseAudio/ALSA, it will not successfully initialize when the KeyMusician Keyboard is already using the Java Sound (Gervill) synthesizer.

Starting ZynAddSubFX The First Time

The first step in setting Zyn up the way you need it for using it with the KeyMusician Keyboard, is to run it. So look for it among the other applications you have installed on your system. In Lubuntu, look for it (using the start menu) under “Sound & Video”. In UbuntuStudio, it's under “Audio Production”.

Find it in the menu, and run it by clicking on it.

A window will appear (only the first time you run it), asking if you want the Advanced, or Beginner interface. Select the “Beginner” mode. The beginner mode has a virtual keyboard you can click-on to hear the sounds you have it set up to play, so you can hear them without having the KeyMusician Keyboard already running.

After you select the “Beginner” interface mode, the ZynAddSubFX window will appear, looking something like this:


The thing we need to take care of before we use it, is to enable all 16 MIDI channels. If you don't do this, only MIDI channel 1 is used, which will not be enough.

The KeyMusician Keyboard normally uses at least two MIDI channels – one for the melody, and one for the chords. But it can easily use all 16 MIDI channels, and the configuration file (ZynAddSubFX.kmk) supplied, uses a separate MIDI channel for each performance pane.

Separate channels were used for compatibility with older versions of Zyn, where you can't change instruments via MIDI program-change messages, and have to set up the instrument (and channel) used by each performance pane, manually in Zyn.

How To Enable All 16 MIDI Channels In Zyn

Near the top of the ZynAddSubFX window (in the screenshot above), a little to the left of center, is the “Part' spin-control. Just to the right of it is the “Enabledcheck-box. You'll be using both of these controls, so take a moment to locate them in the screenshot.

In the ZynAddSubFX window running on your system, repeat the following two steps over and over, until you've enabled it to use all 16 MIDI channels (1 through 16):

  1. Click on the right “>” button of the “Partspin-control, which should increment the number visible in the spin-control by one. If the number in it was already 16, you're done.

  2. Make sure the “Enabledcheck-box (to the right of the spin-control) has a check-mark in it. If it has a check-mark, the use of the MIDI channel in the spin-control is enabled. If it has no check-mark, click on it to set its check-mark.

That probably wasn't too difficult. But we need to save the new settings we just made (so they can be re-loaded), or we would need to do this every time we run it. So here's how you save the settings:

Saving The Parameters

Click on the “File” menu (at the upper-left of the ZynAddSubFX window), and select “Save All Parameters...” from the menu that appears, as in the following screen-shot:


When you click on that menu-entry, a dialog-box will appear, looking something like the following screen-shot:


The folder being displayed in the scrollable area (to the left of the big “?”) is your home folder (“/home/aere” in my case). If you have a lot of files there, you will need to scroll down to the bottom of it (as I did above). You could put the new file in another folder, or even create a folder (using the button at the top-right of the window). But when Zyn starts running, it is looking for files in your home directory, so your home directory is probably a good place to put it.

In the “Filenametext-box above, I typed: “zyn-config-16” (/home/aere was already there), but you can name it anything you want. It probably needs to have “.xmz” at the end of it, identifying it as a ZynAddSubFX configuration file.

Click on the “OK” button, and a configuration file with Zyn set up to use all 16 MIDI channels will be saved. So next time, all you have to do is load that configuration file. You don't have to load it this time, because you just manually set it up to use all 16 MIDI channels.

Loading The Configuration File Manually

When you next run Zyn, it's easy to load the configuration file (the one you just saved) as follows:

In the ZynAddSubFX window, click on the “File” menu, and select “Open Parameters...” from the menu that appears, as shown in the following screen-shot:


When you click-on that menu-entry, a dialog-box will appear, looking something like the following:


Simply click-on the file you want to load (highlighting it, as above), and then click the “OK” button. Alternatively, you could just double-click on the file you want to load.

If your home directory has a lot of files and/or folders in it, you may have to scroll-down to the bottom, as I had to do in the screen-shot above.

Don't try to use it yet, because we haven't yet set up customized launchers that allow you to choose whether you use ZynAddSubFX with JACK, or PulseAudio/ALSA. Instead, terminate Zyn (by clicking its “File” menu, and choosing “Exit” from the menu that appears. Click the “Yes” button, answering the question dialog that appears, asking if you want to exit leaving unsaved data.

Setting-Up Desktop-Launchers For Zyn, Avoiding Manual Set-Up Steps

When you create a desktop launcher for ZynAddSubFX, you can customize that launcher to take care of setting it up to run the way you want it to run. Otherwise, you have to load parameters into it from a file manually, each time you use it.

This section tells you how to set up desktop launchers for ZynAddSubFX – one for using JACK, and one for using PulseAudio/ALSA. The instructions are for Lubuntu Linux (a variant of Ubuntu I recommend using), but the process will be somewhat similar for other distributions.

To create a customized desktop launcher to run ZynAddSubFX pre-configured the way we need it, first we need to create an ordinary (non-customized) desktop launcher for it.

To do that, find ZynAddSubFX using the start menu, but instead of left-clicking on it (which would just run it), right-click on it, as shown in the screen-shot below:


Then, left-click on the “Add to desktop” menu-entry that appears (shown above at bottom-right, with the cursor pointing at it).

When you do that, a desktop launcher for ZynAddSubFX will appear on your desktop. But that launcher will not be customized in any way. It will launch Zyn the same as if you just left-clicked on it in the menu.

Creating the ZynAddSubFX ALSA customized launcher

First, we'll customize it so that it loads the parameters-file we saved when we configured it above, and uses PulseAudio/ALSA for its audio output.

To do that, right-click on the “ZynAddSubFX Software Synthesizer” desktop-launcher on your desktop, and choose “Open With...”, and “Leafpad” from the pop-up menu that appears.

Here are the text lines that will appear for the desktop-launcher within the Leafpad text-editor:

[Desktop Entry]

Name=ZynAddSubFX Software Synthesizer

Name[pt]=Sintetizador por Software ZynAddSubFX

Comment=ZynAddSubFX Software Synthesizer

Exec=/usr/bin/zynaddsubfx

Terminal=false

Type=Application

Icon=/usr/share/pixmaps/zynaddsubfx.xpm

Categories=Application;AudioVideo;Audio;

In the text above, the green-background lines control the name that appears under the icon, and the yellow-background line controls the parameters passed in running the application.

As we did first for setting up Qsynth, we will create the customized desktop-launcher for running Zyn with PulseAudio/ALSA first.

The first step is to change the name of the launcher to indicate it is for using PulseAudio/ALSA. You do that by editing the two green-background lines to replace the words “Software Synthesizer” with “ALSA”.

Next, we change the yellow-background line (that actually runs the application) to tell it to load our configuration file, and to use PulseAudio/ALSA. To do that, edit the “Exec=” line to appear as follows:

Exec=/usr/bin/zynaddsubfx -O ALSA -l zyn-config-16.xmz

In the statement above, the “-O” option (upper-case O (oh – not zero)) tells it to use ALSA (implying PulseAudio) for its output. The “-l” option (lower-case l (ell – not the digit 1) tells it to load a file named “zyn-config-16.xmz” from your home folder. If you named the parameters file something different (and/or put it in a different folder), substitute the name (and folder) you specified when you created the parameters file.

So when you have finished editing, the file should look like this (assuming Zyn's configuration file is in your home folder, and is named “zyn-config-16.xmz”:

[Desktop Entry]

Name=ZynAddSubFX ALSA

Name[pt]=Sintetizador por Software ZynAddSubFX

Comment=ZynAddSubFX ALSA

Exec=/usr/bin/zynaddsubfx -O ALSA -l zyn-config-16.xmz

Terminal=false

Type=Application

Icon=/usr/share/pixmaps/zynaddsubfx.xpm

Categories=Application;AudioVideo;Audio;

Note that any spaces present in the text above must be there. If you used a different filename (and/or folder), it should be the filename and folder you used.

Now that you've checked it for errors, you need to save the new version on your desktop. To do that, click on the “File” menu of the editor (Leafpad), and choose “Save As...” from the menu that appears. Specify zynaddsubfx-ALSA.desktop for the filename (in the “Name” text-box, at the top of the “Save As” window). Basically, you're removing the characters between “zynaddsubfx” and the period (.), and replacing them with “-ALSA”.

Click the “Save” button of the “Save As” window, and the new desktop-launcher (named “ZynAddSubFX ALSA”) will appear on your desktop.

The original desktop launcher you created for Zyn (named “ZynAddSubFX Software Synthesizer”) will still be there on your desktop.

Creating the ZynAddSubFX JACK customized launcher

Now, we'll customize the standard (non-customized) launcher so that it loads the parameters-file we saved when we configured it above, and uses JACK for its audio output.

To do that, right-click on the “ZynAddSubFX Software Synthesizer” desktop-launcher on your desktop, and choose “Open With...”, and “Leafpad” from the pop-up menu that appears.

Here are the text lines that will appear for the desktop-launcher within the Leafpad text-editor:

[Desktop Entry]

Name=ZynAddSubFX Software Synthesizer

Name[pt]=Sintetizador por Software ZynAddSubFX

Comment=ZynAddSubFX Software Synthesizer

Exec=/usr/bin/zynaddsubfx

Terminal=false

Type=Application

Icon=/usr/share/pixmaps/zynaddsubfx.xpm

Categories=Application;AudioVideo;Audio;

In the text above, the green-background lines control the name that appears under the icon, and the yellow-background line controls the parameters passed in running the application.

The first step is to change the name of the launcher to indicate it is for using JACK. You do that by editing the two green-background lines to replace the words “Software Synthesizer” with “JACK”.

Next, we change the yellow-background line (that actually runs the application) to tell it to load our configuration file, and to auto-connect JACK. To do that, edit the “Exec=” line to appear as follows:

Exec=/usr/bin/zynaddsubfx -a -l zyn-config-16.xmz

In the statement above, the “-a” option (lower-case a) tells it to auto-connect to JACK for its output. The “-l” option (lower-case l (ell – not the digit 1)) tells it to load a file named “zyn-config-16.xmz” from your home folder. If you named the parameters file something different (and/or put it in a different folder), substitute the name (and folder) you specified when you created the parameters file.

So when you have finished editing, the file should look like this (assuming Zyn's configuration file is in your home folder, and is named “zyn-config-16.xmz”:

[Desktop Entry]

Name=ZynAddSubFX JACK

Name[pt]=Sintetizador por Software ZynAddSubFX

Comment=ZynAddSubFX JACK

Exec=/usr/bin/zynaddsubfx -a -l zyn-config-16.xmz

Terminal=false

Type=Application

Icon=/usr/share/pixmaps/zynaddsubfx.xpm

Categories=Application;AudioVideo;Audio;

Note that any spaces present in the text above must be there. If you used a different filename (and/or folder), it should be the filename and folder you used.

Now that you've checked it for errors, you need to save the new version on your desktop. To do that, click on the “File” menu of the editor (Leafpad), and choose “Save As...” from the menu that appears. Specify zynaddsubfx-JACK.desktop for the filename (in the “Name” text-box, at the top of the “Save As” window). Basically, you're removing the characters between “zynaddsubfx” and the period (.), and replacing them with “-JACK”.

Click the “Save” button of the “Save As” window, and the new desktop-launcher (named “ZynAddSubFX JACK”) will appear on your desktop.

The original desktop launcher you created for Zyn (named “ZynAddSubFX Software Synthesizer”) will still be there on your desktop. Right-click (on your desktop) on this original launcher, and choose “Delete” from the pop-up menu. Confirm that you want to move this original launcher to the trash can.

You should now have two launchers for launching ZynAddSubFX – one for using ALSA (PulseAudio), and the other for using JACK. When you double-click on either of them, the parameters file you saved for it should be automatically loaded (so you no longer have to do it manually).

Here is how they appear on my desktop (along with a few other launchers), for example:


You now have everything set up to easily use the ZynAddSubFX software synthesizer – either with JACK, or with PulseAudio/ALSA, and you won't need to manually load your parameters file.

Starting ZynAddSubFX Using One Of The Customized Launchers

If the KeyMusician Keyboard is already running, make sure it isn't currently using the Java Sound Synthesizer. If it is, set the “MIDI Output To” drop-box to “none” (in its “F1 (Help/Setup)” pane) to disconnect from the Java Sound Synthesizer.

If you are going to use JACK, run “QjackCtl” first to fire up the JACK interface. You should have already set it up at the end of the procedure for configuring Qsynth. If you haven't, you need to go back to that section, and configure JACK for your system.

If you are using JACK (and QjackCtl is running and started/initialized), double-click on the “ZynAddSubFX JACK” desktop-launcher icon.

If, on the other hand, you want to use PulseAudio/ALSA, make sure JACK (Qjackctl) is not running, then double-click on the “ZynAddSubFX ALSA” desktop-launcher icon.

ZynAddSubFX is now ready for use. You should be able to click on some of its keyboard-diagram keys, and hear a sound. If you can't hear a sound at this point, the problem needs to be investigated and solved before you can play Zyn using the KeyMusician Keyboard.

Starting The KeyMusician Keyboard When Using Zyn

If possible, start Zyn before running the KeyMusician Keyboard. That way, ZynAddSubFX will be visible as one of the MIDI devices in the “MIDI Output To” drop-box.

If you intend to use Zyn, and on starting the KeyMusician Keyboard, it wants to connect to the Java Sound synthesizer, tell it not to do so (because if you use it, you won't be able to run Zyn without first disconnecting it).

If, on the other hand, KMK is already running, make sure it is not currently using the Java Sound (Gervill) synthesizer. If it is, disconnect it by selecting “none” in the “MIDI Output To” drop-box. You have to do this even if you use JACK with Zyn. JACK, is a 'mortal enemy' of PulseAudio – you can't use them both at the same time. The Java Sound (Gervill) synthesizer uses PusleAudio.

If you start Zyn while the KeyMusician Keyboard is already running, you will have to click the “Refresh Devices” button of the “F1 (Help/Setup)” pane. After doing that, ZynAddSubFX will appear in the “MIDI Output To” drop-box, allowing you to play Zyn.

Playing ZynAddSubFX With The KeyMusician Keyboard

Since Zyn does not conform to the General-MIDI specification, it is important to use a configuration file specifically for Zyn (such as ZynAddSubFX.kmk, or others created by modifying that configuration file). The other configuration files supplied are for General-MIDI synthesizers, and will not work for ZynAddSubFX.

So before playing Zyn, select the “ZynAddSubFX.kmk” configuration file in the “Configuration File” drop-box of the “F1 (Help/Setup)” pane, as shown in the following screenshot:


If in specifying this configuration file, it wants to connect to the Java Sound synthesizer, tell it not to, because you can't use Zyn while using the Java Sound synthesizer.

Specifying this configuration file will also connect it to ZynAddSubFX (in the “MIDI Output To” drop-box), if it is currently visible. If you haven't started “Zyn” yet, you will have to click the “Refresh Devices” button (after starting Zyn) to make it appear in the “MIDI Output To” drop-box.

If “ZynAddSubFX” is selected in the “MIDI Output To” drop-box (and no error message appeared doing it), you are now successfully connected to Zyn.

Okay, having configured the KeyMusician Keyboard to use Zyn, and finally being connected to it, we're almost ready to go!

When you change instrument-sounds in Zyn (from one instrument to another), a lot of processing has to take place, causing sound to cut-out while it does this processing. To minimize this delay (in which sound may cut-out), you need to do the following.

Using the mouse (or function keys for most of them), click on (or activate via keystroke) each of the tabs of the main KMK window: F2, F3, F4, F5, F6, F7, F8, F9, F10, Drums, F12, and Chords. This will do the extra setup-processing required for each of the available instruments, so it has much less work to do when you change instruments while performing.

As the final step of this process, with the Chords pane selected, click-on (or hit a note key) to play a single note. If you try to play a chord, and get an unexpected, repeating note, you may have to repeat this last step (clicking on the “Chords” tab, and playing a note).

You only have to do this after you first connect to Zyn. After that, you can change performance panes at-will, even while holding a chord playing. It may still cut-out a bit if you are holding a chord while switching instruments, but not with as bad an effect as it would be if you skipped the final step above.

Everything is now ready, and you can hit the function-key of (or click-on) the performance pane you want to start playing in. Try F12 (my favorite, the “Dream of the Saw” instrument). You should be able to play this instrument, at the same time playing chords in a different (“Rhodes Strings1'”) instrument.

Enjoy!

This synthesizer has many different banks (in the “Bank” drop-box), each with many wonderful (in some cases wierd) and interesting sounds to explore. It could easily take you more than an hour to explore all of its sounds. Make sure to hold out at least some notes a fair amount of time, because some instrument sounds change as time progresses.

In the KeyMusician Keyboard performance panes, the available banks are shown in the “Bank” drop-box, and the “Instrument” drop-box shows the instrument sounds available in the currently-selected bank.

(Hit your Internet browser's “Back” button to return to where you got here from.)