[Cs-dev] linux hid (joystick)
Date | 2010-05-26 19:36 |
From | Justin Glenn Smith |
Subject | [Cs-dev] linux hid (joystick) |
Attachments | linuxjoystick.c linuxjoystick.h None None |
I wrote up a plugin for linux hid (specifically to use a usb logitech ps2 style joystick for live performance with csound), and I figured that it may be generally useful. I can license it under gpl or whatever if others want to use it. I would of course be delighted if this eventually became part of the standard csound (though maybe the linux specific nature of it would prevent this?). features: get raw values from all knobs / buttons on a joystick multiple instruments can get input from a single joystick (even the same knob/button) multiple simultanious joysticks are supported deals relatively gracefully with a joystick being plugged in / unplugged at perf time todo: make it one opcode per joystick (rather than one opcode per control) write all output to a table, so it can be accessed with vtablek lower cpu usage when joystick is not yet plugged in or temporarily unplugged flag to get the polar coordinates of a paddle flag to get an output value with paddle acting as a jog wheel / rotary (clockwise to increment, ccw to decrement) flag to get a moving point in clipped or wrapped plane with velocity controled by paddle (video game style) |
Date | 2010-05-26 21:02 |
From | jpff@cs.bath.ac.uk |
Subject | Re: [Cs-dev] linux hid (joystick) |
LGPL woul dbe best. Easy (!) to make it into a plugin i hope. Sounds interesting to add t othe CVS. ==John ff > I wrote up a plugin for linux hid (specifically to use a usb logitech ps2 > style joystick for live performance with csound), and I figured that it > may be generally useful. I can license it under gpl or whatever if others > want to use it. I would of course be delighted if this eventually became > part of the standard csound (though maybe the linux specific nature of it > would prevent this?). > > features: get raw values from all knobs / buttons on a joystick > multiple instruments can get input from a single joystick (even > the same knob/button) > multiple simultanious joysticks are supported > deals relatively gracefully with a joystick being plugged in / > unplugged at perf time > > todo: make it one opcode per joystick (rather than one opcode per control) > write all output to a table, so it can be accessed with vtablek > lower cpu usage when joystick is not yet plugged in or temporarily > unplugged > flag to get the polar coordinates of a paddle > flag to get an output value with paddle acting as a jog wheel / > rotary (clockwise to increment, ccw to decrement) > flag to get a moving point in clipped or wrapped plane with velocity > controled by paddle (video game style) > ------------------------------------------------------------------------------ > > _______________________________________________ > Csound-devel mailing list > Csound-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/csound-devel > ------------------------------------------------------------------------------ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2010-06-01 15:23 |
From | Justin Glenn Smith |
Subject | Re: [Cs-dev] linux hid (joystick) |
Excellent. I will be adding LGPL licensing to the code while I work on it today. I also have been working on some image manipulation opcodes (using the data sctructures used by the existing imageload and imagesave opcodes) and for now "mplayer $FILE -vo png:z=7 -ao pcm" to create the images and mencoder "mf://output/*.png -o output.avi -ovc lavc -oac lavc -lavcopts vcodec=flv:acodec=libmp3lame -fps 29 -audiofile test.wav" to turn them plus my audio output into a movie ( http://www.youtube.com/watch?v=bA5L2qRPIVc is my first example output ). Point being I have some image manipulation opcodes I plan to share soon, and have a back burner goal on maybe getting frames directly into csound instead of having to play around with mplayer / mencoder and the concomitant hard drive usage. I am wondering though if pulling the frames of the video into a table accessible with vtablek may not be more useful than the existing image format and the indirection involved (especially if one wants to consider the image (already an x by y by 3 tensor) as an element of a larger tensor (aka a movie)). jpff@cs.bath.ac.uk wrote: > LGPL woul dbe best. Easy (!) to make it into a plugin i hope. Sounds > interesting to add t othe CVS. > ==John ff > >> I wrote up a plugin for linux hid (specifically to use a usb logitech ps2 >> style joystick for live performance with csound), and I figured that it >> may be generally useful. I can license it under gpl or whatever if others >> want to use it. I would of course be delighted if this eventually became >> part of the standard csound (though maybe the linux specific nature of it >> would prevent this?). >> >> features: get raw values from all knobs / buttons on a joystick >> multiple instruments can get input from a single joystick (even >> the same knob/button) >> multiple simultanious joysticks are supported >> deals relatively gracefully with a joystick being plugged in / >> unplugged at perf time >> >> todo: make it one opcode per joystick (rather than one opcode per control) >> write all output to a table, so it can be accessed with vtablek >> lower cpu usage when joystick is not yet plugged in or temporarily >> unplugged >> flag to get the polar coordinates of a paddle >> flag to get an output value with paddle acting as a jog wheel / >> rotary (clockwise to increment, ccw to decrement) >> flag to get a moving point in clipped or wrapped plane with velocity >> controled by paddle (video game style) >> ------------------------------------------------------------------------------ >> ------------------------------------------------------------------------------ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2010-06-01 15:28 |
From | Justin Glenn Smith |
Subject | Re: [Cs-dev] linux hid (joystick) |
oops, a quick correction, the mplayer commands (for those interested in the functionality) were mispresented: mplayer $FILE -vo png:z=7 -ao pcm mencoder mf://$DIRECTORY/*.png -o output.avi -ovc lavc -oac lavc -lavcopts vcodec=flv:acodec=libmp3lame -fps 29 -audiofile test.wav where $FILE is a movie file with a soundtrack and $DIRECTORY is the directory with your output png files named in numeric order ( 00000001.png 00000002.png etc. ). And test.wav obviously being the default output of csound. Justin Glenn Smith wrote: > Excellent. I will be adding LGPL licensing to the code while I work on it today. > > I also have been working on some image manipulation opcodes (using the data sctructures used by the existing imageload and imagesave opcodes) and for now "mplayer $FILE -vo png:z=7 -ao pcm" to create the images and mencoder "mf://output/*.png -o output.avi -ovc lavc -oac lavc -lavcopts vcodec=flv:acodec=libmp3lame -fps 29 -audiofile test.wav" to turn them plus my audio output into a movie ( http://www.youtube.com/watch?v=bA5L2qRPIVc is my first example output ). > > Point being I have some image manipulation opcodes I plan to share soon, and have a back burner goal on maybe getting frames directly into csound instead of having to play around with mplayer / mencoder and the concomitant hard drive usage. I am wondering though if pulling the frames of the video into a table accessible with vtablek may not be more useful than the existing image format and the indirection involved (especially if one wants to consider the image (already an x by y by 3 tensor) as an element of a larger tensor (aka a movie)). > > jpff@cs.bath.ac.uk wrote: >> LGPL woul dbe best. Easy (!) to make it into a plugin i hope. Sounds >> interesting to add t othe CVS. >> ==John ff >> >>> I wrote up a plugin for linux hid (specifically to use a usb logitech ps2 >>> style joystick for live performance with csound), and I figured that it >>> may be generally useful. I can license it under gpl or whatever if others >>> want to use it. I would of course be delighted if this eventually became >>> part of the standard csound (though maybe the linux specific nature of it >>> would prevent this?). >>> >>> features: get raw values from all knobs / buttons on a joystick >>> multiple instruments can get input from a single joystick (even >>> the same knob/button) >>> multiple simultanious joysticks are supported >>> deals relatively gracefully with a joystick being plugged in / >>> unplugged at perf time >>> >>> todo: make it one opcode per joystick (rather than one opcode per control) >>> write all output to a table, so it can be accessed with vtablek >>> lower cpu usage when joystick is not yet plugged in or temporarily >>> unplugged >>> flag to get the polar coordinates of a paddle >>> flag to get an output value with paddle acting as a jog wheel / >>> rotary (clockwise to increment, ccw to decrement) >>> flag to get a moving point in clipped or wrapped plane with velocity >>> controled by paddle (video game style) >>> ------------------------------------------------------------------------------ >>> > ------------------------------------------------------------------------------ _______________________________________________ Csound-devel mailing list Csound-devel@lists.sourceforge.net |
Date | 2010-06-03 04:06 |
From | Justin Glenn Smith |
Subject | Re: [Cs-dev] linux hid (joystick) |
Attachments | linuxjoystick.c linuxjoystick.h linuxjoystick.orc linuxjoystick.sco linuxjoystick2.orc None None |
I don't have the extra input conversion opcodes written, but the basic raw joystick access is done, with some examples - joystick.orc should show all the data your joystick makes available at real time, joystick2.orc is a simple tone generator, using the first two axes of the stick and as many buttons as are available, as an example of using the opcode for real time instrument control. Justin Glenn Smith wrote: > oops, a quick correction, the mplayer commands (for those interested in the functionality) were mispresented: > > mplayer $FILE -vo png:z=7 -ao pcm > mencoder mf://$DIRECTORY/*.png -o output.avi -ovc lavc -oac lavc -lavcopts vcodec=flv:acodec=libmp3lame -fps 29 -audiofile test.wav > > where $FILE is a movie file with a soundtrack and $DIRECTORY is the directory with your output png files named in numeric order ( 00000001.png 00000002.png etc. ). And test.wav obviously being the default output of csound. > > Justin Glenn Smith wrote: >> Excellent. I will be adding LGPL licensing to the code while I work on it today. >> >> I also have been working on some image manipulation opcodes (using the data sctructures used by the existing imageload and imagesave opcodes) and for now "mplayer $FILE -vo png:z=7 -ao pcm" to create the images and mencoder "mf://output/*.png -o output.avi -ovc lavc -oac lavc -lavcopts vcodec=flv:acodec=libmp3lame -fps 29 -audiofile test.wav" to turn them plus my audio output into a movie ( http://www.youtube.com/watch?v=bA5L2qRPIVc is my first example output ). >> >> Point being I have some image manipulation opcodes I plan to share soon, and have a back burner goal on maybe getting frames directly into csound instead of having to play around with mplayer / mencoder and the concomitant hard drive usage. I am wondering though if pulling the frames of the video into a table accessible with vtablek may not be more useful than the existing image format and the indirection involved (especially if one wants to consider the image (already an x by y by 3 tensor) as an element of a larger tensor (aka a movie)). >> >> jpff@cs.bath.ac.uk wrote: >>> LGPL woul dbe best. Easy (!) to make it into a plugin i hope. Sounds >>> interesting to add t othe CVS. >>> ==John ff >>> >>>> I wrote up a plugin for linux hid (specifically to use a usb logitech ps2 >>>> style joystick for live performance with csound), and I figured that it >>>> may be generally useful. I can license it under gpl or whatever if others >>>> want to use it. I would of course be delighted if this eventually became >>>> part of the standard csound (though maybe the linux specific nature of it >>>> would prevent this?). >>>> >>>> features: get raw values from all knobs / buttons on a joystick >>>> multiple instruments can get input from a single joystick (even >>>> the same knob/button) >>>> multiple simultanious joysticks are supported >>>> deals relatively gracefully with a joystick being plugged in / >>>> unplugged at perf time >>>> >>>> todo: make it one opcode per joystick (rather than one opcode per control) >>>> write all output to a table, so it can be accessed with vtablek >>>> lower cpu usage when joystick is not yet plugged in or temporarily >>>> unplugged >>>> flag to get the polar coordinates of a paddle >>>> flag to get an output value with paddle acting as a jog wheel / >>>> rotary (clockwise to increment, ccw to decrement) >>>> flag to get a moving point in clipped or wrapped plane with velocity >>>> controled by paddle (video game style) >>>> ------------------------------------------------------------------------------ >>>> > > |