Hi Thomas!<div><br></div><div>What I use for this kind of case (my Akai LPD8, for example) is a class with it's own sporked listener shred.</div><div><br></div><div>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.</div>
<div><br></div><div>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.</div>
<div><br></div><div>Hope that helps?</div><div>Kas.</div><div><br></div><div><br></div><div><br><div class="gmail_quote">On 11 June 2010 13:34, Thomas Girod <span dir="ltr"><<a href="mailto:girodt@gmail.com">girodt@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi there.<br>
<br>
I'm currently working on a chuck project that is progressively<br>
increasing in size. Some parts of this project are already quite<br>
generic, and I will probably use them in other projects later (namely,<br>
an interface to communicate with the novation's monome ripoff).<br>
<br>
So I start to wonder: how can I organize my code for easy reuse ? What<br>
are the options / good practices to write less monolithic chuck code ?<br>
Is it possible to write something that could behave as a library ?<br>
<br>
Thanks for your attention<br>
<br>
Tom<br>
<br>
_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu">chuck-users@lists.cs.princeton.edu</a><br>
<a href="https://lists.cs.princeton.edu/mailman/listinfo/chuck-users" target="_blank">https://lists.cs.princeton.edu/mailman/listinfo/chuck-users</a><br>
</blockquote></div><br></div>