[chuck-users] code reusability

Thomas Girod girodt at gmail.com
Fri Jun 11 09:32:25 EDT 2010

Okay, that's pretty much what I did. Trying all the devices until I find
the one with the proper name is a good idea, thanks !


On Fri, Jun 11, 2010 at 02:08:38PM +0200, Kassen wrote:
> Hi Thomas!
> What I use for this kind of case (my Akai LPD8, for example) is a class with
> it's own sporked listener shred.
> At instantiation it could try to open all MIDI devices in turn, until the name
> of the device is whatever the name of your controller is. from there on you can
> add members and member functions that reflect whatever you want to do with the
> device, including a public event that other shreds could wait for. In the case
> of controllers with leds you'd probably also have member-functions that your
> code could use to set these, with your class handling the MIDI.
> If you build something like that once it will save you a lot of time in the
> long run and only having to do MIDI (with all of its magic numbers) once should
> make your coding a lot more pleasant. The class could sit in its own file (if
> you make it public), or you could simply copy and paste it to the bottom of
> your current project.
> Hope that helps?
> Kas.

More information about the chuck-users mailing list