- PCM audio.
cat > ADC-DAC.pd << EOF
#N canvas 596 824 450 300 10;
#X obj 117 84 adc~;
#X obj 118 113 dac~;
#X text 43 98 Left channel;
#X text 147 99 Right channel;
#X text 149 84 Read audio from the Analog-to-Digital Converter;
#X text 149 113 Write audio to the Digital-to-Analog Converter;
#X connect 0 0 1 0;
#X connect 0 1 1 1;
EOF
pd-extended ADC-DAC.pd &
# Remember to activate DSP in the Pd main window!
- MIDI. Run qjacktcl, vmpk, amsynth and connect in the ALSA Connections
facility “VMPK Output” with “Pure Data” and“Pure Data” with “amSynth”.
cat > MIDI-IO.pd << EOF
#N canvas 962 48 956 1131 10;
#X obj 33 23 notein;
#X obj 27 107 noteout;
#X text 72 85 <- MIDI channel number;
#X text 37 51 <------- Note number;
#X text 54 68 <---- Velocity;
#X text 82 23 Read note;
#X text 81 107 Write note;
#X connect 0 0 1 0;
#X connect 0 1 1 1;
#X connect 0 2 1 2;
EOF
pd-extended MIDI-IO.pd &
% Remember to select "jack" and "ALSA-MIDI" in Pd!
- Video.
cat > webcam.pd << EOF
#N canvas 92 850 450 300 10;
#X obj 117 91 gemhead;
#X msg 149 117 device 0;
#X obj 124 147 pix_video;
#X obj 230 157 gemwin;
#X obj 124 169 pix_texture;
#X obj 124 191 rectangle 6 4;
#X msg 231 134 dimen 640 480 \, create \, 1;
#X connect 0 0 2 0;
#X connect 1 0 2 0;
#X connect 2 0 4 0;
#X connect 4 0 5 0;
#X connect 6 0 3 0;
EOF
pd-extended webcam.pd &
% A window named GEN should be created with the video captured by the webcam.
- Keyboard.
cat > keyboard.pd << EOF
#N canvas 80 659 450 300 10;
#X obj 59 28 key;
#X floatatom 59 51 5 0 0 0 - - -;
#X connect 0 0 1 0;
EOF
pd-extended keyboard.pd &
% After selecting the window, push any key.
- Mouse.
cat > mouse.pd << EOF
#N canvas 82 473 450 300 10;
#X obj 135 72 cursor;
#X obj 135 54 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1
1;
#X obj 135 93 route motion;
#X obj 135 115 route x y;
#X floatatom 119 143 5 0 0 0 - - -;
#X floatatom 173 142 5 0 0 0 - - -;
#X obj 135 169 osc~;
#X obj 167 169 osc~;
#X obj 145 196 dac~;
#X text 152 141 x;
#X text 208 139 y;
#X connect 0 0 2 0;
#X connect 1 0 0 0;
#X connect 2 0 3 0;
#X connect 3 0 4 0;
#X connect 3 1 5 0;
#X connect 4 0 6 0;
#X connect 5 0 7 0;
#X connect 6 0 8 0;
#X connect 7 0 8 1;
EOF
pd-extended mouse.pd &
# Activate the patch and the DSP, and move the mouse!
- USB HID.
# Before running pd, plug the device!
cat > hid.pd << EOF
#N canvas 1396 119 176 115 10;
#X msg 90 15 print;
#X obj 51 43 hid;
#X obj 51 72 print;
#X obj 19 16 tgl 15 0 empty empty empty 17 7 0 10 -262144 -1 -1 1 1
;
#X msg 40 15 open 8;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X connect 3 0 1 0;
#X connect 4 0 1 0;
EOF
pd-extended hid.pd &
# Don’t forget to: (1) toggle on the patch, (2) send the "print" message
# to the "hid" object, (3) send the right "open" to the right device.