I would be happy to help make something too, although I would say we should use Python for two reasons:  <div><br></div><div>1) I know Python much better than Perl.</div><div>2) Python enforces much more legible code.</div>
<div><br></div><div>I would love to be able to be able to create a wrapper for the executable keeps Chuck VM alive and adds the appropriate class definitions to the running VM.  When Chuck crashes, for instance, this process should notice Chuck is not running, restart the VM and load up the last library set used (unless the user begins a new session).  This would actually reduce the need for #include <blah> statements, since your library could just be loaded when Chuck starts--public classes and all.</div>
<div><br></div><div>Lucky for us, Andrew, we live in the same city.  :)  If you're into this, I have some time coming up and would be glad to start working on this sooner rather than later.</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">Yeah, that's my concern. I mean, that doesn't really work for using public classes as buses or something. Or, in my case, I use a public class called Scala to control the global tuning of all my microtonal Scala.mtof(int midiNote) functions. <div>
<br></div><div>Anyway, good to see this. Maybe we can collectively work to make something even more adaptable? I'm willing to learn Perl a bit better.</div><div><br></div><div><font color="#888888">Andrew</font><div><div>
</div><div class="h5"><br><div><br><div><div>On Jun 11, 2010, at 3:47 PM, mike clemow wrote:</div><br><blockquote type="cite">You make non-public classes, and the perl script basically appends those classes to your script and creates a temporary file to send to the vm.  <div>
<br></div><div>it's hacky, but it works.</div><div><br></div><div>#ifdef does NOT work.  only #include (myfile)</div>
<div><br></div><div>mike<br><br><div class="gmail_quote">2010/6/11 Andrew C. Smith <span dir="ltr"><<a href="mailto:andrewchristophersmith@gmail.com" target="_blank">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">It's not clear to me--does #ifdef work? If not, you'd end up instantiating the same public class more than once.<div><br></div><div>Also, a single file can only define one public class at a time, right? So, you'd have to spork a different shred for every class, and not just throw them all into one file. I may be misunderstanding the code though, because I  don't know Perl very well at all, and I'm preoccupied with something else right now.</div>

<div><div></div><div><div><br><div><div>On Jun 11, 2010, at 1:50 PM, mike clemow wrote:</div><br><blockquote type="cite">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" target="_blank">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><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" 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></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><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></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><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>