Re: jack.plumbing-like capabilities for alsa midi?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 28, 2006 at 09:46:51AM -0000, Rui Nuno Capela wrote:
> On Thu, December 28, 2006 07:53, Ken Restivo wrote:
> >
> > qjackctl and jack.plumbing will *only* save and restore the state of
> > audio routing, and not of midi routing. This seems moderately useless to
> > me since it's the midi routing that gets the most tangled up and botched
> > (i.e., whenever loading a new rosegarden file).
> >
> 
> Qjackctl does NOT save connections, either audio or MIDI. What it saves,
> through its Patchbay feature, is a set of rules for automatic connection,
> whenever the clients/ports appears up and running on the screen. And that
> applies both to audio (JACK) and MIDI (ALSA sequencer).
>

What I meant to say is that the "New" or "Snapshot" feature does not capture the state of MIDI connections. It captures only the state of audio connections, but what I need are the MIDI connections.

> Try it out. You've almost sure missed some point, which is not that rare
> anyway, due to aging lack of documentation for that QjackCtl/Patchbay
> feature.

I tried it out several times, weeks ago, then gave up.  Obviously I'm still missing something.

Attached is a sample XML file. It was created by spending an evening getting my whole studio set up properly for a song, then clicking "new" to save the state of it so I could recover it later. You'll notice that all the plugs and sockets are there, but the only "cables" at the end of the file are those for audio. *None* for MIDI. And that's why I assumed patchbay didn't support MIDI.

> 
> Here you can find some notes, as once spelled out on the jack-devel maillist:

Thanks! Very complete.

However, I tried to manually create/connect plugs and sockets using the patchbay GUI, a couple weeks ago, but found it so painful that I stopped. Dragging connections over in the main qjackctl connections window was a lot more useful, especially since they took effect immediately so I could listen to assure that they were correct. I hoped to then click "new" to "capture" them in the patchbay and then "save" to actually save them to disk. (Though, I'd find it a lot more intuitive if there were no "patchbay" window, and there was instead just "save" and "load" buttons in the regular connection window).

What I'm looking for is not a GUI, anyway, but something I can edit in emacs. I'll try hand-editing the patchbay XML file to add the proper "cables" and see how that goes. That file format looks pretty complete; if it works, it could be exactly what I need.

> 
> [...]
> 
> All of these suggestions are perfectly valid, I'm sure. And the good news
> are that you can implement most of those using the infamous QjackCtl
> patchbay featuritis.
> 
> There's only persistence as long you keep a patchbay definition file (you
> can call it a patchnay preset if you like) activated. You can select and
> load individual patchbbay files, that you maintain on your file system, as
> once previously saved (activated). Qjackctl even maintains and presents a
> MRU patchbay file list that you can select and load as seen convenient. To
> perform the actual connections you must activate the slected/loaded
> patchbay file, of course.

Heh, and qjackctl makes me click an OK button every time I launch it, because I had the temerity one day to move one of the XML files to a different directory, and qjackctl has never forgiven me for it, and now it complains about it everytime I launch it. I've gotten used to it.

> 
> I think what is most confusing on QjackCtl's patchbay design is it's
> logical structure and model. Application clients are mapped as "sockets".
> Respective ports are "plugs". Note that this was my own naming choice and
> that is just like so for distinguishing from the actual "physical"
> counter-parts as seen on the Connections window.

That's fine. "Device" or "JACK client" might be more intuitive than "socket". And "ports" seems to be the convention that ALSA and JACK both use instead of "plugs". But, it became clear soon enough.

> 
> A patchbay socket refers to an application client instance, described by
> its client name, which can be entered as a regular expression for broader
> name resolution (e.g. some applications do insist using its PID on the
> client name). Furthermore, a socket is an ordered set (group) of plugs,
> that are ports. You probably know by now that "plugs" maps to regular
> client-ports in a one-to-one fashion.
> 
> It is important to note that sockets are an _ordered_ set of plugs/ports,
> because when you connect two sockets under the patchbay you're just
> declaring that you want those plugs/ports on either side connected
> one-by-one in that order. Remember, the actual connections are only
> executed when the patchbay definition file is saved and activated.
> 
> You can add sockets and plugs at will. There can be more than one socket
> mapping to a given client application. The client application must not be
> running at one time, but helps in getting those plug/port names right. A

I'm not sure I understand what that sentence means.

> socket can have all or just a subset of the target client ports and in any
> order. You just declare which sockets you want connected. You don't need
> to connect them all at one time. Think of having one patchbay template
> file with all conceivable socket combinations and take that and
> copy/save/activate several connection particularizations. Fit to purpose.
> 
> And there's also the "exclusive" and "forward" feature bits. In short, an
> "exclusive" socket is a special one for which the patchbay should maintain
> only the connections that are explicitly declared to/from that group of
> ports/plugs, all others will be forced shut. The "forward" setting is
> applicable to writable/input sockets only and commands that any connection
> that is actually made to the forwarded socket is also issued (cloned) to
> the target one. This has been found useful, for example, to automagically
> replicate all routings on a main output device to another auxilliary one
> e.g. headphones, cue, control-room, whatever.
> 

Thanks for explaining, I didn't know it had those features.


> Feel free to ask for a solution to your specific case. The Patchbay has it
> or almost ;) Either on audio or MIDI.
> 
> 

Thank you for your very extensive reply!

-ken
<!DOCTYPE patchbay>
<patchbay version="0.2.21" name="smoebodys-jack" >
 <output-sockets>
  <socket exclusive="off" type="midi" client="AlsaModularSynth" name="AlsaModularSynth" >
   <plug>ams</plug>
  </socket>
  <socket exclusive="off" type="midi" client="JACK Rack \([0-9]+\)" name="JACK Rack (5617)" >
   <plug>Control</plug>
  </socket>
  <socket exclusive="off" type="midi" client="Keystation Pro 88" name="Keystation Pro 88" >
   <plug>Keystation Pro 88 MIDI 1</plug>
   <plug>Keystation Pro 88 MIDI 2</plug>
  </socket>
  <socket exclusive="off" type="midi" client="Midi Through" name="Midi Through" >
   <plug>Midi Through Port-0</plug>
  </socket>
  <socket exclusive="off" type="audio" client="ams_138_0" name="ams_138_0" >
   <plug>ams_out_0</plug>
   <plug>ams_out_1</plug>
  </socket>
  <socket exclusive="off" type="audio" client="ams_137_0" name="ams_137_0" >
   <plug>ams_out_0</plug>
   <plug>ams_out_1</plug>
  </socket>
  <socket exclusive="off" type="audio" client="ams_136_0" name="ams_136_0" >
   <plug>ams_out_0</plug>
   <plug>ams_out_1</plug>
  </socket>
  <socket exclusive="off" type="audio" client="Hydrogen-1" name="Hydrogen-1" >
   <plug>out_L</plug>
   <plug>out_R</plug>
  </socket>
  <socket exclusive="off" type="audio" client="rosegarden" name="rosegarden" >
   <plug>master out L</plug>
   <plug>master out R</plug>
   <plug>record monitor out L</plug>
   <plug>record monitor out R</plug>
   <plug>sync out</plug>
   <plug>external controller</plug>
   <plug>out 1 - stop this madnsss</plug>
   <plug>out 2 - MIDI external device</plug>
   <plug>out 3 - ams</plug>
   <plug>out 4 - jack rack</plug>
   <plug>out 5 - piano</plug>
   <plug>out 6 - rhodes</plug>
   <plug>out 7 - fretless</plug>
   <plug>out 8 - strings</plug>
   <plug>out 9 - yet another ams</plug>
   <plug>out 10 - MIDI soft synth 5</plug>
   <plug>out 11 - crazy meow</plug>
  </socket>
  <socket exclusive="off" type="audio" client="jack_rack_[0-9]+" name="jack_rack_5617" >
   <plug>out_1</plug>
   <plug>out_2</plug>
  </socket>
  <socket exclusive="off" type="audio" client="rhodes" name="rhodes" >
   <plug>left</plug>
   <plug>right</plug>
  </socket>
  <socket exclusive="off" type="audio" client="piano" name="piano" >
   <plug>left</plug>
   <plug>right</plug>
  </socket>
  <socket exclusive="off" type="audio" client="strings" name="strings" >
   <plug>left</plug>
   <plug>right</plug>
  </socket>
  <socket exclusive="off" type="audio" client="fretless" name="fretless" >
   <plug>left</plug>
   <plug>right</plug>
  </socket>
  <socket exclusive="off" type="audio" client="alsa_pcm" name="alsa_pcm" >
   <plug>capture_1</plug>
   <plug>capture_2</plug>
  </socket>
 </output-sockets>
 <input-sockets>
  <socket exclusive="off" type="midi" client="AlsaModularSynth" name="AlsaModularSynth" >
   <plug>ams</plug>
  </socket>
  <socket exclusive="off" type="midi" client="Hydrogen" name="Hydrogen" >
   <plug>Hydrogen Midi-In</plug>
  </socket>
  <socket exclusive="off" type="midi" client="JACK Rack \([0-9]+\)" name="JACK Rack (5617)" >
   <plug>Control</plug>
  </socket>
  <socket exclusive="off" type="midi" client="FLUID Synth \(rhodes\)" name="FLUID Synth (rhodes)" >
   <plug>Synth input port \(rhodes:0\)</plug>
  </socket>
  <socket exclusive="off" type="midi" client="FLUID Synth \(piano\)" name="FLUID Synth (piano)" >
   <plug>Synth input port \(piano:0\)</plug>
  </socket>
  <socket exclusive="off" type="midi" client="FLUID Synth \(fretless\)" name="FLUID Synth (fretless)" >
   <plug>Synth input port \(fretless:0\)</plug>
  </socket>
  <socket exclusive="off" type="midi" client="FLUID Synth \(strings\)" name="FLUID Synth (strings)" >
   <plug>Synth input port \(strings:0\)</plug>
  </socket>
  <socket exclusive="off" type="midi" client="Keystation Pro 88" name="Keystation Pro 88" >
   <plug>Keystation Pro 88 MIDI 1</plug>
  </socket>
  <socket exclusive="off" type="midi" client="Midi Through" name="Midi Through" >
   <plug>Midi Through Port-0</plug>
  </socket>
  <socket exclusive="off" type="audio" client="ams_138_0" name="ams_138_0" >
   <plug>ams_in_0</plug>
   <plug>ams_in_1</plug>
  </socket>
  <socket exclusive="off" type="audio" client="ams_137_0" name="ams_137_0" >
   <plug>ams_in_0</plug>
   <plug>ams_in_1</plug>
  </socket>
  <socket exclusive="off" type="audio" client="ams_136_0" name="ams_136_0" >
   <plug>ams_in_0</plug>
   <plug>ams_in_1</plug>
  </socket>
  <socket exclusive="off" type="audio" client="rosegarden" name="rosegarden" >
   <plug>record in 1 L</plug>
   <plug>record in 1 R</plug>
   <plug>record in 2 L</plug>
   <plug>record in 2 R</plug>
   <plug>record in</plug>
   <plug>external controller</plug>
  </socket>
  <socket exclusive="off" type="audio" client="jack_rack_[0-9]+" name="jack_rack_5617" >
   <plug>in_1</plug>
   <plug>in_2</plug>
  </socket>
  <socket exclusive="off" type="audio" client="alsa_pcm" name="alsa_pcm" >
   <plug>playback_1</plug>
   <plug>playback_2</plug>
   <plug>playback_3</plug>
   <plug>playback_4</plug>
   <plug>playback_5</plug>
   <plug>playback_6</plug>
   <plug>playback_7</plug>
   <plug>playback_8</plug>
  </socket>
 </input-sockets>
 <slots/>
 <cables>
  <cable output="alsa_pcm" input="rosegarden" />
  <cable output="fretless" input="alsa_pcm" />
  <cable output="strings" input="alsa_pcm" />
  <cable output="piano" input="alsa_pcm" />
  <cable output="rhodes" input="jack_rack_5617" />
  <cable output="jack_rack_5617" input="alsa_pcm" />
  <cable output="rosegarden" input="alsa_pcm" />
  <cable output="Hydrogen-1" input="alsa_pcm" />
  <cable output="ams_136_0" input="alsa_pcm" />
  <cable output="ams_137_0" input="alsa_pcm" />
  <cable output="ams_138_0" input="alsa_pcm" />
  <cable output="Keystation Pro 88" input="rosegarden" />
 </cables>
</patchbay>

Attachment: pgp30TAxJxhjS.pgp
Description: PGP signature

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux