Rosegarden uses the term Studio to refer to everything it knows about the sound systems attached to the computer. This may include MIDI and audio hardware and other sound software, and includes information about connections, configuration, MIDI patches and so on. The Studio is built-in to every composition you create with Rosegarden.
Three pieces of terminology are essential here:
A “device”, as far as Rosegarden is concerned, is simply something capable of producing sounds. This may be a MIDI or audio device. MIDI devices do not necessarily correspond directly to physical MIDI ports: they are just things with names that you can refer to, expected to work in particular ways. Configuration information such as MIDI patch maps can be attached to devices.
Each device has a number of “instruments”, each of which is assumed to make a particular sound. These are the things that you can assign tracks to in order to choose which sound they play. By default, a device contains 16 instruments, created for you at startup: if the device is a MIDI device, then these will each be initialised to one of the 16 MIDI channels. The instrument is where you set all the properties of a particular voice, such as program settings, reverb, volume etc.
While a MIDI device is simply a name and a collection of configuration information, the “connection” specifies which MIDI port it is physically attached to. This can be configured in the MIDI device manager. (Audio and synth plugin devices do not have connections in the same way.)
For example, imagine a setup consisting of a PC with two physical MIDI ports, one of which has an external synth attached to it. Here you would normally configure Rosegarden so as to have one MIDI device, corresponding to the synth. You could then configure this device with the correct name and patch map, and then specify a connection for it that corresponded to the relevant MIDI port on your soundcard. Each of the 16 default instruments on the device could then be configured with a suitable program, and you would then assign tracks to those.
In practice, Rosegarden will by default create a device for each of the available connections on startup. So in the example above, two MIDI devices will be created by default even though you only need one. You would generally then rename and apply patch maps to the first, and delete or simply not use the second. Remember that there is no way for Rosegarden to know what synths you actually have plugged in to the MIDI ports on your computer: for this reason, the devices created at startup are just intended to be a default set, and it's up to you to ensure that the devices you configure match those you are really using.
Once configured, the studio setup is stored with every Rosegarden-format file you save.