Scott Wheeler's script is exactly that.  You should have a look.  The only thing is that it doesn't handle chuck command line args well.  <div><br></div><div>maybe some perl guru would be willing to have a go at modifying it.  </div>
<div><br></div><div>Mike</div><div><br></div><div><br><br><div class="gmail_quote">2010/6/11 Andrew C. Smith <span dir="ltr"><<a href="mailto:andrewchristophersmith@gmail.com">andrewchristophersmith@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div style="word-wrap:break-word">Hm, what about setting up some kind of python (or perl, etc...) script to pre-process ChucK and handle all statements preceded by a #? So, you could totally do the whole #IFDEF thing and make that work. That might be a worthwhile library of stuff to do.<div>
<br></div><div><font color="#888888">Andrew</font><div><div></div><div class="h5"><br><div><div><br><div><div>On Jun 11, 2010, at 12:08 PM, mike clemow wrote:</div><br><blockquote type="cite">Hey, I'd like to recall this thread: <a href="https://lists.cs.princeton.edu/pipermail/chuck-users/2008-October/003408.html" target="_blank">https://lists.cs.princeton.edu/pipermail/chuck-users/2008-October/003408.html</a><div>
<br></div>
<div>I used Scott Wheeler's chuck preprocessor (a Perl script) for a long time.  I really liked the concept.  It did not work well with command line arguments, however, the benefits as far as code-reuse were really nice.  Obviously, things had to be imported in the correct order, but I think that there might be a way around it, if each file you import also imported its prerequisites.  IMHO, Chuck really needs something like this in order to make a library a pleasure to use and a helpful thing to develop.  </div>

<div><br></div><div>LiCK would be trivial to use if Chuck had import/include statements built in.  It's okay at the moment to do what Michael described above, i.e.:</div><div><br></div><div><span style="font-family:arial, sans-serif;font-size:13px;border-collapse:collapse">$ chuck --loop &<br>

$ chuck + <a href="http://import.ck/" style="color:rgb(0, 101, 204)" target="_blank">import.ck</a>       // imports entire library<br>$ chuck + myChuckScript.ck</span></div><div><br></div><div>on the command line, however, in miniAudicle, it's kind of annoying to have to also open the <a href="http://import.ck/" target="_blank">import.ck</a> file and run it before running any other code.  You have to repeat all this when it crashes (which is something that happens from time to time when developing new things ;).</div>

<div><br></div><div>On the other hand, if I could just put:</div><div><br></div><div>#include (LiCK);</div><div><br></div><div>at the head of my code...  easy peasy.</div><div><br></div><div>Or, if I only wanted part of LiCK imported:</div>

<div><br></div><div>#include (FloatIterator);</div><div><br></div><div>That's my buck-oh-five.</div><div><br></div><div>Mike</div><div><br></div><div><br></div><div><br><br><div class="gmail_quote">On Fri, Jun 11, 2010 at 10:00 AM, Daniel Trueman <span dir="ltr"><<a href="mailto:dtrueman@princeton.edu" target="_blank">dtrueman@princeton.edu</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">i believe in the next release you'll be able to open MIDI/Hid devices by name...<br>
<div><div></div><div><br>
On Jun 11, 2010, at 9:32 AM, Thomas Girod wrote:<br>
<br>
> Okay, that's pretty much what I did. Trying all the devices until I find<br>
> the one with the proper name is a good idea, thanks !<br>
><br>
> Tom<br>
><br>
> On Fri, Jun 11, 2010 at 02:08:38PM +0200, Kassen wrote:<br>
>> Hi Thomas!<br>
>><br>
>> What I use for this kind of case (my Akai LPD8, for example) is a class with<br>
>> it's own sporked listener shred.<br>
>><br>
>> At instantiation it could try to open all MIDI devices in turn, until the name<br>
>> of the device is whatever the name of your controller is. from there on you can<br>
>> add members and member functions that reflect whatever you want to do with the<br>
>> device, including a public event that other shreds could wait for. In the case<br>
>> of controllers with leds you'd probably also have member-functions that your<br>
>> code could use to set these, with your class handling the MIDI.<br>
>><br>
>> If you build something like that once it will save you a lot of time in the<br>
>> long run and only having to do MIDI (with all of its magic numbers) once should<br>
>> make your coding a lot more pleasant. The class could sit in its own file (if<br>
>> you make it public), or you could simply copy and paste it to the bottom of<br>
>> your current project.<br>
>><br>
>> Hope that helps?<br>
>> Kas.<br>
><br>
> _______________________________________________<br>
> chuck-users mailing list<br>
> <a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">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>
<br>
_______________________________________________<br>
chuck-users mailing list<br>
<a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">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>
</div></div></blockquote></div><br><br clear="all"><br>-- <br><a href="http://michaelclemow.com/" target="_blank">http://michaelclemow.com</a><br><a href="http://semiotech.org/" target="_blank">http://semiotech.org</a><br>
<br>
</div>
_______________________________________________<br>chuck-users mailing list<br><a href="mailto:chuck-users@lists.cs.princeton.edu" target="_blank">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></div></div></div></div></div><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>
<br></blockquote></div><br><br clear="all"><br>-- <br><a href="http://michaelclemow.com">http://michaelclemow.com</a><br><a href="http://semiotech.org">http://semiotech.org</a><br><br>
</div>