[PD-dev] pd041-test6 auto(connect) feedbacks MIDI.

Winfried Ritsch ritsch at iem.at
Fri Sep 7 10:32:34 CEST 2007


Hello,

> I think alsa-MIDI is only included since very recently (I got it from
> soneone else, I forget who) so it shouldn't be a problem to change the
> behavior.
>
> Do you think the correct thing would be just to open one MIDI input and
> output device?
>
Ok I try a draft for a solution:

In ALSA-MIDI can be seen as a patchbay, each program opens as many MIDI-Ports 
it needs to connect to other MIDI-Ports dedicated to devices on the system. 
Since modern Computer can ave a lot of virtual MIDI devices (one of them is 
ALSA MIDIThrough by default nowadays on new ALSA-Driver) or sequencer, 
synthis and external MIDI-Connection, its not that easy anymore to decide 
which is the right one to connect to. So in my opinion no connection should 
be made by default to do not risk feedback loud sound or something else on 
startup of patch.

OSS-MIDI is easier (especial for PD), but is not properiate for modern system 
where a lot of integration between apps and environment has to be done, and 
some devices have no OSS driver at all.

Three solution I see:

 a) just open external devices, but maybe there are more than one, which can 
be run by different PD-Instances, so not optimal.

 b) having a commandline (and maybe a GUI) to connect to other devices, like
     we had to choose one device on OSS-MIDI.

 c) let beautiful ;-) ALSA-Tools do the job. Eg.: in qjackcontrol, you can 
make templates so each puredata Port is connected automatically to defined 
group of MIDI-Ports.

The fast solution for now is just make a commandline switch which enables the 
automatic connection like it does now and default is none like in previous 
PD-versions:

in s_midi_alsa.c set

      int autoconnect = 1; -> int autoconnect = 0;


My Proposal is:
  
  lets use correctly the command line switches:
.
-midiindev ...   -- midi in device list; e.g., "1,3" for first and third
-midioutdev ...  -- midi out device list, same format
-mididev ...      -- specify -midioutdev and -midiindev together

They should connect to the specific MIDI-Device but they doesnt, instead the 
number of args means how much ports pd-creates and (funny) if you have more 
than one port it does no autoconnect to all.

PD needs an extra command line or better use the commandline arg -alsamidi 
<num> to define the number of ports to create, of course there can be 
different numbers of inputs and outputs so maybe:

-alsamidi [num[,numinputs]]  
where  num...number of ports
             numins... if number of inputs if it should be different to number 
of ouputs
if no number is given at least one MIDI-port is opened, this is different to 
now, where -alsamidi doesnt create an MIDI-Port only -mididev... does.

(comment: I dont know why we need more than one MIDI-Port if there is an 
alsapatchbay, but who knows...)

The other thing is, I used is the object [aconnect], where you can patch from 
pd, but aconnect ist not that comfortable, since it operates on numbers not 
on names, so maybe we should enhance it.

mfg winfried


> Anyway, OSS MIDI is much better API than ALSA, I don't know why anyone uses
> the latter :)
>
> M
>
> On Thu, Sep 06, 2007 at 04:44:03PM +0200, Winfried Ritsch wrote:
> > Hello !
> >
> > Since pure data just connects alle MIDI-ins and MIDI-outs to his instance
> > under alsamidi also the MIDI-Through is connected which in fact is a
> > feedback a therefore dangerous and bad.
> >
> > If this behaviour is changes all old patches using MIDI (I used aconnect
> > to connect) doesnt work anymore.
> >
> > Is there a reason for this behaviour ?
> >
> > I think on alsa midi the philosophy is that connection should be done by
> > alsa tools. There are templates and so on so that automatically the right
> > devices are connected, no need for pd to do this (as for other programms
> > which doesnt respect this).
> >
> > mfg winfried ritsch
> >
> >
> >
> > --
> > --
> > - ao.Univ.Prof. DI Winfried Ritsch
> > - ritsch at iem.at - http://iem.at/ritsch
> > - Institut fuer Elektronische Musik und Akustik
> > - University of Music and Dramatic Art Graz
> > - Tel. ++43-316-389-3510 (3170) Fax ++43-316-389-3171
> > - PGP-ID 69617A69 (see keyserver http://wwwkeys.eu.gpg.net/)
> > --
> >
> > _______________________________________________
> > PD-dev mailing list
> > PD-dev at iem.at
> > http://lists.puredata.info/listinfo/pd-dev
>
> _______________________________________________
> PD-dev mailing list
> PD-dev at iem.at
> http://lists.puredata.info/listinfo/pd-dev

-- 
--
- ao.Univ.Prof. DI Winfried Ritsch 
- ritsch at iem.at - http://iem.at/ritsch
- Institut fuer Elektronische Musik und Akustik
- University of Music and Dramatic Art Graz
- Tel. ++43-316-389-3510 (3170) Fax ++43-316-389-3171 
- PGP-ID 69617A69 (see keyserver http://wwwkeys.eu.gpg.net/)
--




More information about the Pd-dev mailing list