From: D. M. M. <ros...@gm...> - 2009-03-21 16:23:52
|
On Saturday 21 March 2009, Chris Fryer wrote: > The relevant signals are, however, blocked in slotUpdateInstrument() > which is called during the MIDIMixerWindow constructor. > This is done using blockSignals(true) - took a lot of head scratching to > find that ... slot is connected, signal is emitted, slot isn't called > ... erm ... > > They are left blocked because, when trying to read values from the > instruments, the relevant controls (eg Reverb - MIDIByte 91 and Chorus - > MIDIByte 93) are not found in the instrument. > > MIDIMixerWindow thinks the controls should be there as it got them from > the MIDIDevice using getIPBControlParameters(). If we're talking about a bare bones scenario with only the factory autoload, using "General MIDI Device" for everything, then these controllers SHOULD be there. > I don't know how the MIDIDevice gets setup with one set of controls but > it's instruments have another (or rather in this case NO controls at > all). This appears to be the root cause. Interesting. Very interesting. > I'm running the app without having started JACK. Does anyone know where > the General MIDI device is created? "General MIDI Device" is supplied for the first available MIDI playback device, and it's defined in the factory default autoload.rg file. This gets loaded and set up at RosegardenDocument::performAutoload() which calls GzipFile::readFromFile() which calls xmlParse() which calls QXmlSimpleReader() with RoseXmlHandler() as its handler. I'm not quite sure from there exactly where the controllers are getting loaded out of the autoload file, as the logic of all of this is a bit confusing at a glance. I hacked the autoload file to force visible and obvious changes confirming this is where the controllers are coming from though. Delete reverb and chorus from the autoload, and they disappear. Volume too, though there's still a fader in the MIDI mixer. We won't worry about that, since deleting pan and volume is a bad idea. Now it gets interesting. We detect all available ALSA MIDI writeable ports and create devices for them on the fly (which behavior is debatable, but for now that's how it works) as needed. The first of these spontaneously-created devices for me is "MIDI soundcard synth 2" (with "General MIDI Device" having an implied 1.) These on-the-fly devices 2..n all have volume, pan, chorus and reverb controllers, and I can't for the life of me figure out where they're coming from. There has to be some code somewhere that defines these four as a minimum for otherwise empty devices, and I sense that might hold a key to unravelling the larger problem here, but I can't find it. -- D. Michael McIntyre |