Difference between revisions of "Talk:USB Roll-up drum kit user-space driver for linux"
From Organic Design wiki
(client server) |
m (→Building) |
||
(3 intermediate revisions by the same user not shown) | |||
Line 2: | Line 2: | ||
*[http://liblo.sourceforge.net/examples/example_client.c Client example for liblo] | *[http://liblo.sourceforge.net/examples/example_client.c Client example for liblo] | ||
*[http://chuck.cs.princeton.edu/doc/examples/osc/ OSC examples for Chuck] | *[http://chuck.cs.princeton.edu/doc/examples/osc/ OSC examples for Chuck] | ||
+ | *[http://mips42.altervista.org/jackdrum/jackdrum-1.0a.tar.gz JACK MIDI driver for drumkit] | ||
==Program flow== | ==Program flow== | ||
− | *init | + | *init liblo |
*read command line parameter | *read command line parameter | ||
*open device | *open device | ||
Line 14: | Line 15: | ||
*tidy up | *tidy up | ||
*exit | *exit | ||
+ | |||
+ | ==Building== | ||
+ | Download [http://liblo.sourceforge.net liblo] from sourceforge | ||
+ | curl -O http://waix.dl.sourceforge.net/sourceforge/liblo/liblo-0.25.tar.gz | ||
+ | tar xzf liblo-0.25.tar.gz | ||
+ | cd liblo-0.25 | ||
+ | ./configure | ||
+ | make && make install | ||
+ | |||
+ | Need to tell the linker where to find the newly installed libs | ||
+ | ldconfig /usr/local/lib | ||
+ | |||
+ | Add this Makefile | ||
+ | cat > Makefile | ||
+ | all: | ||
+ | gcc -llo drumkit.c -o drumkit | ||
+ | (ctrl-d) | ||
+ | And build it. | ||
+ | make | ||
+ | |||
+ | Check it linked correctly - you should NOT see this: | ||
+ | liblo.so.0 => not found | ||
+ | more like | ||
+ | liblo.so.0 => /usr/local/lib/liblo.so.0 (0xb7fc9000) |
Latest revision as of 08:06, 22 January 2009
Use basic unix IO and liblo to make a driver that will read the device and output Open Sound Control messages. The C program reading th usb device will act as the client and the Chuck shred will be the server.
Program flow
- init liblo
- read command line parameter
- open device
- output message "connect to device"
- loop:
- read device
- process input
- send osc message
- check for exit condition
- tidy up
- exit
Building
Download liblo from sourceforge
curl -O http://waix.dl.sourceforge.net/sourceforge/liblo/liblo-0.25.tar.gz tar xzf liblo-0.25.tar.gz cd liblo-0.25 ./configure make && make install
Need to tell the linker where to find the newly installed libs
ldconfig /usr/local/lib
Add this Makefile
cat > Makefile all: gcc -llo drumkit.c -o drumkit (ctrl-d)
And build it.
make
Check it linked correctly - you should NOT see this:
liblo.so.0 => not found
more like
liblo.so.0 => /usr/local/lib/liblo.so.0 (0xb7fc9000)