Personal tools
You are here: Home members ben's Home
 
Document Actions

pd day by day (by a newbie)

by Benoît Rouits last modified 2009-01-01 09:19 PM

Here are all ben's life with pd, using an Ubuntu Linux laptop.

Using pd on an Ubuntu Hoary

linux 2.6.10-k7 (including ALSA), with an usb-midi interface (yamaha UX96)

First things to do

plug the UX96 in the usb port


ensure /dev/snd/midi**** is created :
$> ls /dev/snd/midiC1D0
/dev/snd/midiC1D0

use amidi -l to ensure UX96 is recognised
$> amidi -l
Device    Name
hw:1,0,0  UX96 MIDI 1
hw:1,0,1  UX96 MIDI 2
hw:1,0,2  UX96 MIDI 3
hw:1,0,3  UX96 MIDI 4
hw:1,0,4  UX96 MIDI 5
hw:1,0,5  UX96 MIDI 6

if /dev/snd/seq does not exist , do a modbrobe snd-seq (you can automate that by adding snd-seq in /etc/modules)
if module snd-seq-midi is not loaded (see $> lsmod | grep snd-seq-midi) then do a modprobe snd-seq-midi (you can automate that by adding snd-seq-midi in /etc/modules)

Launching pd and connecting midi i/o

Launch pd:
$> pd&

List the midi inputs and outputs:
$> aconnect -lio
this shows the midi inputs and outputs inside the computer.
in my case, i see UX96 has ports 72:0 to 72:5

Connect pd's output to the UX96 input:
$> aconnect 128:1 72:0

Connect the UX96 output to pd's input:
$> aconnect 72:1 128:0

This operation can be made with a graphical tool such as aconnect-gui or qjackctl

Now, pd is linked to your UX96 midi interface
You can automate the two aconnect by puting them in a tiny shell script and call the shell script instead of pd directly.
To ensure pd is connected, just make a new patch containing a simple bang/makenote/noteout to verify that the UX96 leds are lighting each time you press bang. If you connected a syhtesizer (IN) to the UX96 (OUT), you should hear a C.


figure 1: a simple patch to verify that UX96's leds are working.

My first newbie patch

After reading a few documentation of pd, i decided to borrow and simplify a patch i was given to measure the midi latency of my system. The trick is to make a loop between the IN and OUT of the midi interface with a small MIDI cable, and use pd to generate a midi note and measure the milliseconds between the moment it is sent and the moment it is received by pd. Unfortunately, i didn't success to make it work as is, probably because the the timer receives notein through the cold (right) inlet. So, the current version of the patch doesn't work as is!

Here is the picture of the patch:


figure 1: computing the midi latency of my system... doesn't work actually
The pd file can be downloaded here.
Anyway, making this patch allowed me to learn to use the point-and-click interface of pd.

a simple midi organ

Based on the harmonics i saw on a Hammond organ, i made a simple one-note midi organ for learning purpose. This works as expected:

figure 1: a simple one-note at a time midi organ.

a real polyphonic midi organ

Continuing the idea, sorted the midi polyphony into a separate patch, then the organ too, and linked them together in a real midiorgan. the complete patchset is downloadable here: it contains the "sevenvoice" midi router, the "organ" patch, then the linking patch (instanciates 7 organs oscillators, bound to the midi input). You can easily replace the organ by your own synth patch, having the same interface. Here is the look:

figure 1: a 7voices polyphonic midi organ.


Powered by IEM Powered by Plone Section 508 WCAG Valid XHTML Valid CSS Usable in any browser