Contents Previous Next

4 The Studio

Now that you have a general idea how Rosegarden works, now is a good time to think about telling Rosegarden something about the MIDI equipment you wish to use. People who intend to use Rosegarden purely for audio work are free to skip this chapter entirely.

Before we get started, some of you might need some basic background information so that you can dive into this with some understanding of the concepts I am about to explain. If you are new to MIDI, or if anything in this chapter leaves you scratching your head, you might want to read through my MIDI Primer in Appendix A.

4.1 What is a Studio?

Every native Rosegarden composition (.rg) file contains a studio definition in addition to all the nuts and bolts stuff of music. The studio is a definition of every MIDI device Rosegarden can detect during the course of editing the composition. (Everything that was there at the start, plus any new devices that become available during the course of editing; as when starting something like ZynAddSubFX in the middle of working on a composition, for example.) It comprises information about the device itself, and about how data is routed into or out of it.

4.1.1 What is a Connection?

Rosegarden has an integrated MIDI router to manage the flow of raw MIDI events into and out of ports provided by the underlying ALSA infrastructure. You can think of this as something like the sort of router often used to share a broadband internet connection. Unlike ethernet, however, MIDI is not bidirectional over the same cable. As a consequence of this, all connections in Rosegarden are unidrectional; even if both connections belong to the same physical piece of hardware. Connections will be displayed as one of "read," "write," or "duplex." In this diagram, connections are represented by black arrows that point in the direction data will flow through them. Rosegarden's MIDI router allows you to rearrange these connections as you require, to change what is connected where.

4.1.2 What is a Device?

A device is a sort of virtual model of an individual piece of MIDI equipment. Equipment, in this sense, can be full-fledged external MIDI hardware, internal hardware like the Sound Blaster Live!, or virtual hardware like QSynth or VKeybd. Each device encapsulates information about the capabilities of a piece of equipment, and allows you to make use of those capabilities from within Rosegarden. In effect, the better the job you do of describing a particular device in Rosegarden, the better control you will have over that device.

For example, if you have a nice keyboard attached to your computer, but you accept Rosegarden's default General MIDI device definition for it, you will be unable to make use of any of the keyboard's advanced features from within Rosegarden until you make your device definition more accurate. Conversely, telling Rosegarden you have a Roland JV-88 does not make it so, and if you assign any instruments to programs that are not actually available on the connected equipment, you will hear no sound. (More about instruments in the next chapter.)

A device like the following is typical of either QSynth or a Sound Blaster Live! after loading an uncomplicated soundfont. It includes a basic set of controllers (which are dependent on the capabilities of either QSynth or the Sound Blaster, both of which do support a limited number of controllers, and actually have nothing to do with the soundfont per se), a set of standard General MIDI programs loaded into bank 0 0, and a set of Roland GS-style extra drum kits loaded into bank 1 0.

4.1.3 Putting Connections and Devices Together

A studio can consist of just one device, and perhaps for many of you that is all the complexity you will ever need. The real power, however, lies with Rosegarden's ability to manage numerous devices simultaneously. A studio is, in effect, a collection of device descriptions and a routing table ensuring that the right devices are connected to the right MIDI equipment on the other end.

4.1.3.1 A Simple Sound Blaster Live! Studio

Even on the comparatively simple and very inexpensive end of the hardware spectrum, it is quite possible to have more than one device to manage. The Sound Blaster Live! falls into this category, with four separate write connections available, and four separate play devices. (Actually, there are five write connections once you include the duplex external MIDI port, but that is not depicted here.) They all share the same soundfont on the hardware side, but Rosegarden doesn't know that until you configure the studio that way, by loading programs out of the soundfont into each of the four play devices. (More on that last point in a moment.)

4.1.3.2 A Typical QSynth Studio

Another typical, simple setup involves using QSynth for MIDI playback and VKeybd for input. You can start either of these after starting Rosegarden, and Rosegarden will detect them and make a play connection and a record connection available, along with an empty play device.

4.1.3.3 A More Complex Studio

This is what my own studio looks like when I have QSynth, Hydrogen, and ZynAddSubFX running, along with my Roland Sound Canvas and my Sound Blaster Live!. It looks horribly complex on paper, and it would look even worse if I drew out every single bank of GS variations, and did a better job of representing the fact that, while the same soundfont happens to be loaded into both the Sound Blaster and QSynth, that doesn't have to be the case. No matter how it looks, this is actually quite simple to use day to day, believe it or not. Rosegarden makes this easy.

Notice that I have controllers for the Sound Blaster, for QSynth, and for the Roland (the "External MIDI GS Synth"), but I do not have any controllers defined for Hydrogen or ZynAddSubFX. That's because, to the best of my knowledge, neither of those soft synths knows how to do anything with controllers. They both have their own control panels that must be twiddled manually, and that sort of thing can't be automated from within Rosegarden.

4.2 Enough Theory Already! How Do I Configure MY Studio?

I'm glad you asked. The first step in this process is to open the main Studio dialog. Composition -> Studio -> Manage MIDI Devices...

or by clicking on the icon.

You'll be presented with a dialog that resembles this one, except, of course, that this one has already largely been configured to suit my own default studio. It is divided into two sections; one for play devices, and one for record devices, and their associated connections. It also shows you how each of these devices is connected to internal, external, and software synths. In this example, I have a device named "Roland SC-33" connected to "64:0 EMU101K MPU-401 (UART) (duplex)" and four "SB Live (?)" devices connected to each of 65:0 through 65:3, which are the four output ports on my SB Live!, with their associated write connections. I also have three generic spots reserved for soft synths, named "Soft Synth 1" through "Soft Synth 3", one of which is currently connected to KAMix, an ALSA mixer client that can be controlled via MIDI. These are empty devices that I created with the New button.

4.2.1 Connections

The reality of Rosegarden's MIDI router is a bit less intuitive than the diagram I presented earlier. Here is that same diagram with the ALSA port numbers included.

NOTE: The diagram does not exactly represent the same set of devices and connections depicted in the dialog box snapshot above.



You might wonder about the strange names and numbers. ALSA assigns numbers to ports in three ranges. 64: means it is an external MIDI port on the first soundcard, which might be connected to a MIDI keyboard, sound module, or other noise producing gadget through some sort of cable. 65: means it is a virtual port with a supported internal synth such as the Sound Blaster Live! on the other side. Software synths like Hydrogen, ZynAddSubFX and the like will take numbers at the time they're started, on a first-come, first served basis starting at 128:. In addition to the number, most of these will have some kind of vaguely descriptive text component, such as "Emu10k1 Port 0 (write)." These names are provided by the underlying kernel driver, and don't always make a lot of sense. That's why Rosegarden allows you give your devices a proper name.

4.2.2 Record Devices

Record devices are MIDI keyboards, virtual keyboards, MIDI guitars and the like. As record devices are rather less complicated, I will cover them first. With a record device, you have no capabilities to describe. The only thing Rosegarden can do is read data from it, or not. You may name these if you wish, but the Record devices section of this dialog is the only place where you will see the names, and I never bother to name mine.

Rosegarden can record from any number of inputs simultaneously. It will create a record device for every read connection it detects. Each of these can be set to be an active record device by toggling the associated checkbox. Rosegarden keeps track of which port the recorded data came from, and what channel was used to transmit the data, but it does not currently do anything with this information.

In this example, I have both a hardware record device and a software record device. These devices were created spontaneously when Rosegarden detected the associated duplex read and virtual read connections. I have marked both of them "Current" and I can record events from either one of them, or both of them at the same time.

NOTE: Rosegarden does not always automatically mark a record device as "Current." If you have a keyboard or similar device, and Rosegarden isn't recording anything, this dialog is the first place to look for troubleshooting the problem.

4.2.3 Play Devices

Play devices are where all the fun, and all the complexity is. As I have mentioned elsewhere, they can be MIDI keyboards, sound modules, software synths, samplers, and pretty well anything else that can take MIDI input, such as KAMix. (Synth plugins are somewhat different. There is a single synth plugin device into which any and all plugins are plugged, and it is not a MIDI play device. I will cover synth plugins in the next chapter.)

4.2.3.1 The Easy Road (General MIDI Only)

If you have only one play device, and it only uses straight General MIDI programs, then you are probably ready to go out of the box. If you start Rosegarden with no file to open, it opens a default blank document, called autoload.rg. Initially, this will be the system default that was installed with Rosegarden. It will load a set of basic General MIDI programs and controllers, and will route output from this device to the first available play connection. The device a the top of the list is always the default device.

Typically this play connection will be routed to the correct destination for your MIDI data. If not, all you should have to do is adjust the routing table by dialing appropriate connections into the associated combo boxes. For example, if Rosegarden defaults to routing your output to "64:0 (duplex)" and you do not have any external equipment attached to your computer, you probably want to change this to point to either 65:0 or something like 128:0 as appropriate.

4.2.3.2 The Harder Road (Loading Device Definitions from the Library)

If you have some need beyond the simplest one-device, only-General MIDI scenario, you will have to use the bank editor; even if you do not intend to edit any banks directly. To load or create a device click on the Banks... button to pop up the bank editor dialog.

In this example, you can see that I have already imported some programs from the soundfont I use on my SB Live!, and I have named the four devices "SB Live! (1)" through "SB Live! (4)" for my own convenience. This soundfont has programs available in four banks, which are displayed as the branches of the tree. The LSB column is not visible in this snapshot, but the bank names tell most of the tale. I named the last one "Percussion" to set it apart, because that is where this soundfont stores the drum kits.

You can also see that I have a device called "Soft Synth 2" highlighted, and I'm looking at the empty list of programs that make up Rosegarden's virtual model for this device. Unlike internal and external MIDI equipment, Rosegarden assigns connections to soft synths on a first-come, first serve basis, based on the order in which the applications are started. It is very easy to wind up with something named "Hydrogen" that is actually connected to QSynth. I find I prefer to give these things generic names and assign the connections manually as required, because I start and stop soft synths as I need them.

4.2.3.3 Loading a Device from the Library

If you're lucky, the growing Rosegarden Library already contains a set of bank and program definitions to suit your hardware. To try your luck, click the Import... button. You will initially be presented with a list of .rgd files from the Library, which was installed along with Rosegarden itself, but you can, of course, browse to other locations. You can import banks from both regular Rosegarden Composition (.rg) files, and from Rosegarden Device (.rgd) files. If you don't find anything suitable, you will probably have to start from scratch, as I will explain later on.

4.2.3.4 Turning a SoundFont into a Device

"Soft Synth 2" in the above example is a soundfont based card or soft synth. The simplest, most accurate way to define a device model for a synth of this type is to load the banks of program names directly out of the soundfont's .sf2 file itself. Simply set the "Filter:" to "Soundfont" and browse to the location of the soundfont you've loaded into your synth.

NOTE: Defining a device by loading programs out of a soundfont is in no way related to actually loading that soundfont into either a Sound Blaster Live! or into QSynth. You are merely reading the directory inside the .sf2 file that describes how the various samples are arranged into banks, and importing that textual information into Rosegarden. It saves a great deal of typing, and delivers fast, accurate results.

4.2.3.5 Once You've Made Your Choice

Regardless of whether you elected to load a stock device from the Library, or loaded the programs out of a .sf2 file, you will need to make a few decisions how to procede.

If the file contains models of more than one device, you can choose which one to import. You also have various choices about which bits to import, and whether to merge new banks into existing ones or replace them completely. Everything should be self-evident after a little experimentation.

4.2.3.6 The Hardest Road: Creating a List of Programs from Scratch

If none of the device models in the library are suitable, and you can't turn the program names from a soundfont into a device, then you will need to get to work creating your own. You can use an existing file from the library as a starting point, or you can create a new device definition completely from scratch.

Even if you have no real need to start from scratch, you may wish to read through this material anyway, in order to better understand how some of the devices in the Library are put together.

4.2.3.6.1 Naming the Device

So that you can avoid confusion, you probably want to replace Rosegarden's default "Anonymous MIDI Device 3" type name with something more meaningful. Simply double click on the existing name and give your virtual model a more descriptive one.

Now that your "Anonymous External Device" has become a "Roland SC-33" or what have you, you probably want add a description of its available programs and controllers to Rosegarden's model.

4.2.3.6.2 Why Name Programs and Controllers?

Depending on the capabilities of this device, it might not matter whether you define named program changes or not. However, if you do intend to transmit programs, bank changes or controllers to the equipment--even if you only want to use numbers--you need to define something here. Rosegarden's model of your equipment will only include what you define here, and anything you leave empty will not be available for your use. If you don't let Rosegarden know that program number 97 can play something, it will never allow you set a track to use that program number.

4.2.3.6.3 Gathering Information

The key to success here is having as much information about the equipment as possible. You need to know what programs it can use, and how the banks are numbered. If you have no idea, you may have to try loading "raw-numbers.rgd" from the Library, which I created as a way of providing a generic everything to everyone placeholder just to fill up the slots and allow program changes to be transmitted. Beyond the essential fact that you must understand your equipment to describe it, there are really only two special cases worth mentioning here.

4.2.3.6.4 Variations

Some equipment uses a method of sorting programs into banks in such a way that the programs in bank 0 0 are the standard General MIDI instruments, and the programs in the remaining banks are variations on those instruments. Roland's GS standard is a prime example of this. Bank 0 0, program 1 is "Piano 1" and bank 0 8, program 1 is "Piano 1w." In order to make it easy to take advantage of this relationship, Rosegarden offers the ability to display programs in secondary banks as variations. You may choose to enable this, and to show the variation list based on either the LSB or MSB value.

4.2.3.6.5 The Percussion Checkbox

Finally, you may have noticed that Rosegarden only allows you one set of program changes per bank address. The exception to this rule is that you may define a parallel set of program changes if the [x] Percussion box is checked. For example, if you have a synth that interprets standard program changes in bank 0 0 on channel 10 as drum kit changes (like GS) then you can tell Rosegarden how to use them.

The process is a bit fiddly. First you have to use the Add button to create a new, empty bank. It will take a number other than 0 0 because 0 0 is already in use. Check the [x] Percussion box for this new bank, and then dial its LSB and MSB values back down to 0 0 (or wherever they need to be for your implementation) and enter the names of drum kits as programs.

4.2.3.6.6 Send in Your Device Descriptions

Once you've defined the names for your program changes, you can save the device definition to disk with the Export... button.

If you think anyone else might benefit from having the instrument definition, you can mail it to me at dmmcintyr@users.sourceforge.net and I will add it to our growing collection of user contributions.

New contributions are most welcome. We pioneers must do all the work so that future generations can be lazy. Just remember that I had to do the SC-33 device from scratch too, and it was very tedious and time-consuming. Especially since this stuff was a lot more buggy and incomprehensible back then. ;)

4.3 Custom Controllers

Rosegarden should create a few basic default controllers for you. If you have special requirements, or if some of these controllers don't function on the piece of equipment for which you're defining the device, you may wish to edit these defaults by clicking the Control Events button.

If your equipment can't use any of these controllers, you probably want to delete them. If there are controllers missing, you can add them one by one. Use the Add button. This will create a new entry using default values. Double click it, and you should be presented with a dialog similar to this one.

Most of these parameters should be obvious to you based on the particular needs of the equipment you're describing, but the last two bear special mention. The Color: parameter is the color this controller's knob will have on the Instrument Parameters box in the main window, and the position: determines whether this controller will show up, and how it will be arranged relative to the other controllers.

4.4 Default Document Properties

Before you make this document your default, you might want to have a look at some other document-specific settings. These aren't a part of the Studio, but they're saved in autoload.rg, and any new documents you create will start life with these defaults. To edit them, use Composition -> Edit -> Document Properties.

4.4.1 Lilypond Headers

The About tab starts off with some default properties. You can modify or delete these, and you can add new properties. The four defaults will be translated into Lilypond during an export. If you wish to use any other strings in your Lilypond headers, you can add them here by creating properties of that name, then binding your custom strings with them.. For example, "instrument," "dedication," or "poet."

4.4.2 Audio Directory

From the Audio tab, you can configure a new directory for audio files. Rosegarden will use this path for recording new files, and it's the first place it will look when you import audio segments. By default, this is ~/rosegarden. If this path doesn't exist, you won't be able to record audio, so either create that directory or configure Rosegarden to look somewhere else here.

You should get in the habit of creating a new audio directory for each document you create in which you intend to use audio segments, as I will detail in another chapter.

4.4.3 Custom Colors

Rosegarden can colorize segments and controllers. Custom colors are defined here.

4.5 Saving Your Studio as the Default

Now that you've gotten your studio configured, you'll want to make it your default, so that you can avoid having to go through this entire ordeal every time you start a new composition.

Composition -> Studio -> Save Current Document as Default Studio will save the current document as your local autoload.rg file. This becomes the default for all new documents you create, but it will have no effect on documents that you've already created, or documents you load from other sources. The studio belongs to each individual composition.

This default studio is just like any ordinary .rg file, and that means any segments, track labels, instrument assignments, etc. that you have in the current document will be saved, and will subsequently be loaded each time you create a new document.


Contents Previous Next