#N canvas 224 22 513 695 10; #X text 11 34 MIDI in Pd is handled through the 'raw' midi devices (such as /dev/midi*). One could specify which MIDI port Pd is supposed to use through a command line switch when starting Pd \, i.e.:; #X text 35 95 pd -midiindev 1 -midioutdev 2; #X text 43 236 pd -mididev 1; #X text 17 264 This will use the first port for both MIDI input and output.; #X text 17 346 There is also a little bit of confusion about OSS midi (which uses the raw midi - /dev/midi* - devices by default) and ALSA (which is becoming very popular). ALSA uses /dev/snd/midiC*D* as their raw midi devices. The C* (* = some number) is the device number while D* (* = some number) is the port number. Normally the ALSA driver links its raw devices to the corresponding /dev/midi* automatically (i.e.: /dev/snd/midiC0d0 -> /dev/midi00 \, /dev/snd/midiC0D1 -> /dev/midi01 etc).; #X text 13 119 so \, the above will use the first MIDI device for MIDI input (it could be a MIDI controller such as a keyboard \, midi-guitar \, midi knob box etc) and the device #2 will be used for outputting the MIDI (re)generated or sent by Pd.; #X text 13 181 For using the same device for MIDI input AND output (i.e. when one uses a MIDI keyboard which is also a synthesizer) the following command line switch will do:; #X text 19 470 MIDI objects in Pd (the ones that read and write to MIDI ports) take a MIDI channel as an argument. Channels 1-16 use the first MIDI device \, 17-32 use the second MIDI device and so on. For this to work one must specify which devices Pd is supposed to use: ; #X text 39 548 -midiindev 1 \, 2 -- use devices 1 and 2 for input; #X text 39 564 -midioutdev 1 \, 2 -- use devices 1 and 2 for output ; #X text 39 580 -mididev 1 \, 2 -- use devices 1 and 2 for input and output; #X text 17 292 NOTE (Linux): Pd counts the MIDI devices starting from 1 Usually \, the operating system counts them starting with 0 (zero) so if you want to use /dev/midi00 \, Pd has to be started with -mididev 1 Always add 1 to the device number.; #X text 21 600 NOTE (Windows): -listdev command line option lists all available MIDI and audio devices.; #X text 19 627 A couple more useful command line options (related to MIDI):; #X text 21 643 -nomidiin -- do not listen to any midi input; #X text 21 655 -nomidiout -- do not send any midi output; #X text 21 667 -nomidi -- do not use any MIDI; #X obj 4 4 cnv 15 500 20 empty empty all_about_midi_flags 20 10 1 18 -233017 -66577 0; #X obj 471 5 pddp;