#1356 Wrong instrument when recording on multiple tracks/channels

Ted Felix

When recording on multiple tracks with multiple MIDI inputs on different
channels, each input will generate the same instrument sound. That being the
instrument for the track that was selected when record was pressed. It
appears that Rosegarden no longer sends out Program Changes for armed tracks
when record is pressed. However, this theory has not yet been verified.

This worked in 11.11.42. It may be that the new auto channel feature in
12.04 has somehow broken this.

Procedure to reproduce with zero additional hardware:

  • Start up your favorite soft-synth (e.g. fluidsynth)
  • Launch two instances of vmpk.
  • Configure one instance of vmpk to talk on Channel 1 and the other to talk on channel 2.
  • Launch rg.
  • Studio > Manage MIDI Devices
    • Make sure MIDI Playback is connected to your synth or soft-synth.
    • In the MIDI Recording box, make sure "MIDI input system device" is set to one of the vmpk instances.
    • Click "New" to add a second MIDI recording device and set it to the other vmpk instance.
    • Close the Manage MIDI Devices dialog
  • Now, pressing a key on either vmpk instance should produce a piano sound from your soft-synth.
  • In rg, arm tracks #1 and 2 to record.
    • Filter track 1 on channel 1.
    • Filter track 2 on channel 2.
  • Set up track 1 to talk to a piano on instrument 1. (Should be the default.)
  • Set up track 2 to talk to a flute (74) on instrument 2.
  • Select track 1 and press keys on both vmpk instances. You will hear piano.
  • Select track 2 and press keys on both vmpk instances. You will hear flute.
  • Hit record.
  • Play notes on the vmpk that is connected to channel one.
    • The notes will appear in track 1.
    • You will hear piano.
  • Play notes on the vmpk that is connected to channel two.
    • The notes will appear in track 2.
    • You will hear flute.
    • This test fails with the latest SVN. 11.11.42 works correctly.


  • Ted Felix

    Ted Felix - 2012-12-03

    It appears that SequenceManager::preparePlayback() has changed significantly from 11.11.42 to now. Before it would send out program changes. Now it does not. This is probably related to the auto-channel feature. The old behavior needs to be restored for tracks that are in record mode.

    Search on MidiProgramChange to find where program changes are sent (and received).

  • Ted Felix

    Ted Felix - 2012-12-03
    • assigned_to: Ted Felix
  • Ted Felix

    Ted Felix - 2013-03-20

    Quick update. After quite a bit of digging, I've discovered that a ChannelManager is not created for a segment that is recording. So I am going to have to look elsewhere to figure out what channel to send program changes on when we go into record. At this point I suspect that during record, the recording MIDI data goes "thru" to the MIDI out. In fact, I think I've seen that in my travels through the code. I'm going to have to spend some time getting my head around some concepts before I can think clearly enough to come up with a good solution.

    For now, I'm working on a map of the code to help me get where I need to be quickly. Will publish either on the wiki, or via doxygen in the source if I can figure that out. Here's what I have for the record path through the code:


    This is a big help. It's also nice to see the symmetry. This was probably a very nice simple design before reality set in.

  • Ted Felix

    Ted Felix - 2013-04-10

    Fixed in r13248. Added a call to StudioControl::sendChannelSetup() in SequenceManager::record().

  • Ted Felix

    Ted Felix - 2013-04-10
    • status: open --> closed

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks