Play Up To 16 Instruments Simultaneously With jSynth

Have you ever been inspired by the sound of many different instruments in a symphony orchestra playing a tune in unison?

Perhaps you've never heard such a sound, not normally listening to that kind of music.

Here's a quick sample you can listen to, by clicking the links below:

O Fortuna, from Carmina Burana, by Carl Orff

Mars, from The Planets, by Gustav Holtz

In the world of MIDI music, with synthesizers, it should be easy to play a tune using up to 16 different instrument sounds, simultaneously. Yet it turns out to be surprisingly hard to do, or even set up to do. But jSynth makes it easy!

MIDI synthesizers allow up to 16 different instrument sounds to be played simultaneously, so why can't you hook up a MIDI keyboard to play all 16 MIDI channels simultaneously? After all, you don't have to press the keys any harder to play 16 instruments, than to play one instrument.

Normally to do this, you would use a MIDI Router, which would take the notes played on your keyboard, and send them to whatever MIDI channels, on the MIDI synthesizer you choose, possibly filtering-out notes not within the range of each specific instrument.

But that can be a lot of work.

To make it easy for you to experiment with playing this sort of sound, I created jSynth, which provides code allowing you to play the Java Sound (Gervill) Synthesizer, or it can even work as a MIDI router, by sending its output on the various MIDI channels of a MIDI interface, connecting to a synthesizer of your choice.

What kind of music can you play using jSynth? I provided the link below to let you listen to a piece I improvised, using the KeyMusician Keyboard to play jSynth.

In this piece, I work my way through the various performance panes, using the Piano, Electric Piano, Steel String Guitar, French Horn, Oboe, Aah-Choir, Flute, Cello, Choir Pad, and Trumpet sounds (also using String Ensemble 1 for the chords, when played on the numeric keypad), all played simultaneously along with the String Ensemble 1, Aah-Choir, and Metal Pad sounds in the background. Click the link below to listen, and see what you think.

jSynth Improvisation, With Up To 5 Simultaneous Instruments

If you like what you heard, and would like to experiment playing choirs of instrument-sounds simultaneously, this is your lucky day. There is a link toward the end of the article where you can install jSynth, and start using it yourself, at no financial cost.

But first, it will be helpful to learn a little bit more about jSynth.

I originally wrote this so that people could use the Java Sound Synthesizer, using MIDI keyboards and sequence-editors. Where it is written in Java, it is available on Windows, Mac OS X, Linux, and possibly other operating systems.

Yet there are drawbacks I encountered during the development process, that dampened my enthusiasm for the project. Although jSynth is still a useful tool in the world of MIDI music, the drawbacks should be considered:

What Is jSynth?

JavaSynth is a Java application using the Java Sound Synthesizer (which is a part of Java), exposing it to the user as a software synthesizer. It can also act as a MIDI router, sending its output on a MIDI interface connected to an external synthesizer.

It makes use of sound-fonts (.sf2 files) to provide the sounds of various instruments. The default sound-font is a set of instruments adhering to the General-MIDI (GM) standard. Sound-fonts loaded don’t necessarily need to conform to the General-MIDI standard.

The synthesizer implements other aspects of the General-MIDI standard, such as using MIDI channel 10 for percussion (drums), for example.

It is intended for use by connecting a MIDI keyboard to it, and playing the synthesizer. It provides an easy means of changing instruments and volume, when used with MIDI keyboards not providing an easy way of changing instruments. You can play it very well with the KeyMusician Keyboard, connecting to it with a MIDI interface (software, or hardware).

You can set up all 16 MIDI channels to your liking, and it will remember all settings the next time it is run.

It also provides a means of doing layered voices (sounds), or simultaneously playing up to 16 different instruments, and you can use it in this capacity to play external synthesizers using a MIDI interface.

Limitations

The Java Sound Synthesizer makes use of ordinary audio device drivers (rather than high-efficiency device drivers, such as ASIO on Windows, or JACK on Linux), and therefore has a noticeable amount of latency (delay between hitting a key and hearing its sound). On Mac OS X and Linux, this latency is not too bad, but on Windows, it is barely tolerable.

Using normal audio device drivers at the same time as high-efficiency audio device drivers (such as ASIO or JACK), may cause your system to hang, so do not attempt to use the Java Sound Synthesizer component of jSynth while you are using VST instruments (which use ASIO), or synthesizers that use JACK.

When used on machines with lower than 2 gigahertz speed on a single-core processor, or 1.6 gigahertz on a dual core processor, audio may cut-out occasionally. In some cases, such cut-outs may disappear after playing it for 30 seconds or more. It may not work at all on single-core processor machines slower than 1.8 gigahertz.

If you have a slower machine, playing layered voices may result in cut-outs in the audio (sound).

Unfortunately, we have been unable to make the same Java code work on 64-bit Mac OS X systems. So it is not fully supported on Mac OS X.

You may run into the multiple-sound limitations of the Java Sound Synthesizer, or other synthesizers you connect it to (acting as a MIDI router). If you play a new note, but the new note doesn't play, or if some other held-out note disappears when you play the new note, you are running up against the polyphony limits of the synthesizer, and you will need to use less simultaneous instruments, or play fewer simultaneous notes.

When you first start playing it, sound may cut-out briefly while Java does garbage-collection (consolidation of RAM storage. It may happen briefly another time a while later, but it will usually stop happening after that. So practice awhile before you do a performance or recording.

How To Set It Up The Way You Want It

With the “One” radio-button selected, select each of the 16 MIDI channels (one at a time), and specify the “Instrument” drop-box (and possible also the “Bank” drop-box) to select the instrument sound you want for each MIDI channel. You can also set the “Volume” slider to an initial volume.

This will give you 16 different instruments (hopefully your favorite choices), all set up the way you want them.

It will save these settings when you exit, so you don't have to do this again.

With this done, when you start jSynth, it's already set up the way you want it, and all you have to do to change instruments, is to change MIDI channels. This comes in handy when playing it with a MIDI keyboard having few controls.

jSynth's Main Window

Here is a screen-shot of the main window, with text-callout boxes identifying the various controls. Each text-callout box starts with a letter, which appears below the screen-shot, giving additional information about the control. Notice that the title-bar identifies the configuration file currently being used (of which, “PriorConfig.jvs” is the default).


Here are more details on each of the controls:

A: The “Input Active” radio-button is selected when MIDI messages are coming in from the selected MIDI input device. Remember that there is a “Note-On” message, and later a “Note-Off” message for each note.

B: When the “Volume” slider is dragged left or right, MIDI volume-control messages are sent to the current channel. The slider is disabled if no MIDI channels are selected, or if more than one channel is selected.

C: The “Soundfont” drop-box shows the sound-font file currently loaded into the synthesizer, affecting all 16 MIDI channels. A value of “(none)” indicates the default sound-font is loaded. The “FluidR3_GM.sf2” sound-font (distributed with the KeyMusician Keyboard) is recommended, but any sound-font can be used.

D: The “Bank” drop-box shows which bank of instruments is currently selected for the current-selected MIDI channel. Different banks hold different sets of instruments, so this affects the instruments available in the “Instrument” drop-box. This drop-box is disabled if more than one MIDI channel is selected, or if no channel is selected.

E: The “Instrument” drop-box selects which instrument-sound is selected for the current MIDI channel. This drop-box is disabled if more than one MIDI channel is selected, or if no channel is selected.

F: The “MIDI Input” drop-box specifies which MIDI input device (such as a MIDI keyboard) or MIDI interface the Java Synthesizer ‘listens’ for input on. The entries that appear here are limited to hardware or software MIDI devices connected to the system. If (while the application is running), you plug-in an additional device (into a USB port), you need to click the “Refresh” button for it to appear in this drop-box. On Linux, ALSA devices, though visible to Linux, will not appear in this list.

G: Click the “Panic” button in those rare cases where a note is left sounding. Sometimes (rarely) with MIDI devices, a Note-On message may be received, but the Note-Off message that comes after it, is somehow missed, or perhaps a sustain-pedal control is left set. This will turn-off all notes on all 16 MIDI channels, without changing any parameters.

H: When the “Send” button is clicked, the configured Bank, Instrument, and Volume settings previously specified for each MIDI channel, are sent out on each MIDI channel (not just the channels selected). Remember that although you can set the Volume, Bank and Instrument of only one channel at a time, the values you have previously selected for other channels are remembered, and sent. For channels you have not yet specified a Volume, Bank or Instrument for, the default value of Volume=100, Bank 0 (General-MIDI), and Instrument 0 (Grand Piano) are sent. Channel 10 (the percussion channel) is set to Bank 128 (Percussion), and Instrument 0 (Standard Drum Set), if you haven’t yet changed it.

I: When the “Defaults” button is clicked, the Bank, Instrument, and Volume settings for each MIDI channel are set to default values (Bank 0, Instrument 0, and volume 100). The default values for channel 10 (Percussion) are different: Bank 128, Instrument 0, and Volume 100. This will also set the “MIDI Input” and “Soundfont” drop-boxes to “(none)”. This means you’ll have to specify a new MIDI input device.

J: When the “Help” button is clicked, your system’s Internet browser is activated, displaying the “Help.html” file in the application’s folder (JavaSynth).

K: These check-boxes show which MIDI channels are currently selected. If the “One” radio-button is selected, when you click one of the non-selected check-boxes, the prior check-box is un-selected, and the new one is selected. If you click an already-selected check-box, it is un-selected. If the “All” radio-button is selected, all of the check-boxes are selected, and if you then clear the selection of one of them, the “Selected” radio-button will then be selected (rather than “All”). In order to specify a Volume, Bank, or Instrument, only one channel can be selected.

L: If you click the “One” radio-button when multiple channel check-boxes are selected, only the lowest selected check-box will remain selected. If you un-select the one selected channel, no channels will be selected, and the “Selected” radio-button will be selected. If you click the “All” radio-button, all of the MIDI channel check-boxes will be selected.

M: If you click the “Refresh” button, the items in the “MIDI Input” and “MIDI Output” drop-boxes will be re-loaded, depending on what is currently connected to the system. If the formerly selected value is found, it will remain connected. If it isn’t found, that MIDI device will no longer be connected.

N: When the “Exit” button is clicked (or the close window button in the title-bar is clicked), the Java Synthesizer application will exit. As it exits, it will write the current settings to a file called: “PriorConfig.jvs” (or the configuration file that was initially used). If this isn’t the first time the application is run, a dialog box will appear, allowing you to specify a different configuration file name, or you can click the “Cancel” button, in which case the current settings will not be saved to a file. If there is more than one “.jvs” file in the JavaSynth folder when the application is started, a dialog box will appear, letting you choose which configuration file to use.

O: When the “Forward” check-box is selected, input MIDI events are not only sent on the same channel they came-in on, but are also forwarded to other MIDI channels currently selected. This allows you to play up to 16 different instruments at the same time with the same keyboard input. This allows you to be your own Big Band, or Ensemble. It also allows you to play layered voices, which otherwise would require you to use VST instruments. You can do the same thing with the Java Sound Synthesizer, or another ordinary synthesizer connected to a MIDI interface (or plugged-into a USB port).

P: When the “Filter” check-box is selected (along with the “Forward” check-box), everything but note events is filtered-out of the MIDI input before it is forwarded to other MIDI channels. This is useful where you have input forwarded to a background-sound instrument (playing at a lower volume level), and don't want volume or expression controls to go to the (softer) background instrument, keeping it playing at the same lower volume. Also for layered voices, where the background sound is a sustained sound (like string ensemble), if sustain-pedal control events were forwarded to it, it would blur the sound together in an unpleasant way. It also keeps changes in the forground instrument from also changing the background instruments.

Q: The “MIDI Output” drop-box allows you to send the MIDI output to an external (or other software) synthesizer over a MIDI interface, rather than using the Java Sound (Gervill) synthesizer which is normally used. This lets you play multiple MIDI channels on other synthesizers, rather than having to use only the Java Sound Synthesizer (which is the default selection of this drop-box).

The JavaSynth Folder

This folder is where information used by the Java Synthesizer application is stored. All (or any) of the configuration files you have saved when the application terminates, are saved in this folder.

The file “FluidR3_GM.sid” in this folder specifies the available bank and instrument definitions. If you create other “.sid” files in this folder, you will be given a choice of which one to use when the application initializes next time you use it.

When you Export Instruments (of a sound-font), using the KeyMusician Keyboard, it creates a “.sid” file. But you can create your own “.sid” file using a text editor, if you need. Each line of the “.sid” file specifies a bank number, an instrument number, and the instrument name (in that order). A space separates the three fields, and the instrument name can contain spaces.

The “Help.html” file in the folder contains the help information you are now viewing. The pictures that appear in this document are also in the folder.

The software license you agreed-to is also in the folder.

Layered Sounds, or Simultaneous Instrument Sounds

A layered sound is something like Piano/Strings, available on VST instruments, or high-end synthesizers. In the case of Piano/Strings, the main sound is Piano, but there is something like a string ensemble playing the same notes in the background.

When you play only the Piano sound, the very high notes are not very useful, because they fade away quickly. But with the layered sound Piano/Strings, those ethereal high notes (though the Piano part of the sound fades quickly) are sustained by the Violin (Strings) sound in the background, so the very high notes become much more useful, and beautiful.

Though String Ensemble is a background sound commonly used, other sounds, such as Aah-Choir, Metal Pad, and Halo Pad also work well for this. This is just a suggestion – you can try anything you like.

You play layered sounds on JavaSynth, by first setting up (in less commonly-used MIDI channels, perhaps starting with channel 16, and working downward), background-sound instruments, such as 48-Strings, 52-Ahh Choir (or 54-Synth Voice), 93-Metal Pad, or 94-Halo Pad. For these channels, you also set the volume slider lower, such as in the middle (64), or even lower. But of course, this is just a suggestion - they can be any volume-level you want.

Then, you select a primary instrument sound to play (such as Grand Piano), in the lower MIDI channels, using a higher volume setting.

Then click the “Selected” radio-button (allowing you to have multiple channels selected), and select one or more of the background sound instrument channels, along with the primary instrument sound.

Now that the instruments you want to play simultaneously are selected, click the “Forward” check-box, so that the MIDI messages from the keyboard you play, are also forwarded to the other selected MIDI channels.

Note: You don't have to select the primary instrument voice. It will play the sound of any MIDI channel it receives on. Selecting one or more channels just identifies the MIDI channels to forward the same notes to (for the background, or other voice).

Here is a screen-shot after having done this, setting it up to play layered voices:


In this case, I'm playing channel 4, which I've set up as 25-Steel String Guitar, and my background voices I've previously set up as channel 13, using the 94-Halo Pad sound, along with channel 16, which I've previously set up with the 48-Strings sound. Both of the background instrument channels have been previously set up with a volume level of 64, so they're softer than the primary instrument sound, whose volume level is 100.

I've also selected the “Filter” check-box, so that the sustain-pedal (essential to playing Piano) isn't forwarded to the “Strings” or “Halo Pad” instruments, which would blur their sounds together in an unpleasant way.

Notice that the Bank, Instrument, and Volume controls are grayed-out when multiple channels are selected. You can only use them when a single channel is selected.

With this done, any note (or notes) you play on your input MIDI keyboard are simultaneously played on all of the selected MIDI channels.

You can use this technique for doing your own Big-Band sound, simultaneously playing all of the instruments of a big-band. In this case, in setting up the various instruments, you would set the volume levels so the instruments blend together well.

Since there is a lot of setting-up to do in this case, it is nice to know that the setup you did is saved for next time when you exit. You can also save different file-names of setup information for various combinations you like to use. In doing this, the next time you start JavaSynth, you will be allowed to choose which setup ('.jvs') file you want to use.

You can use this layered-sounds technique playing other external synthesizers, by specifying in the “MIDI Output” drop-box, a MIDI interface going to the external synthesizer. In the screen-shot above, I'm using the default Java Sound Synthesizer.

Connecting Software MIDI Applications To The Java Synthesizer

It is often the case, that useful MIDI software is unaware of the MIDI interfaces presented by Java, and likewise, the Java MIDI interface is unaware of specific MIDI software packages available on the system.

Fortunately, MIDI hardware, such as MIDI keyboards that plug into a USB port, are available to Java. MIDI software, such as sequence editors, on the other hand, may not be.

You can get around this problem by using a hardware MIDI interface, such as the MIO iConnect USB MIDI interface (and other similar interfaces). This works because both Java, and the various MIDI software packages, all recognize and support hardware MIDI interfaces.

These interfaces plug into your computer via a USB port, and present standard MIDI cable plug-ins to the outside world. Typically, these MIDI cables connect your computer to an external synthesizer, but they can also be used to connect your computer back-to itself, via MIDI.

To use one of these interfaces for connecting to a software package in your computer, simply connect the input cable (or plug-in) to the output cable (or plug in), as illustrated in the pictures below (you can get MIDI cables & plugs at a music store, such as Guitar Center):


Connecting the MIDI output cable to its input cable


A 2 x 2 MIDI Interface, each with its input plug connected to its output plug, 1 cable each

You can also use a software MIDI interface, such as LoopBe1 (on Windows). On Mac OS X, the quickest, easiest, and least-expensive way, is to turn-on the “IAC Driver” software MIDI interface already on your machine (but turned-off by default). Learn how to do that by reading the Improving Your Windows System pages, or Improving Your Mac OS X System pages, for your particular operating system. You'll need your KeyMusician Member Pages user-ID and password to access the above links.

On Linux, you’ll have to use a hardware MIDI interface connected to itself, as shown in the pictures above. Fortunately, MIDI interfaces are much less expensive than they used to be.

Installing jSynth

JSynth is supplied (for free) as auxiliary software, available with the KeyMusician Keyboard, by Laeramin LLC. It is installed using Java Web Start, on Windows, Mac OS X, and Linux.

To install it (and for installation instructions), click the following link:

Installing jSynth

I hope jSynth proves to be a useful tool for you in the world of MIDI music, and that it lets you experiment with some wonderful new sounds!



You can return to the index of newsletter articles by clicking below:

Index Of All Newsletter Articles