[chuck-users] Scala importer, FileIO capabilities

Andrew C. Smith acsmith at willamette.edu
Mon Sep 28 01:13:28 EDT 2009


All right, after digging through the ChucK source code I found a few
new methods--FileIO.seek(int) and FileIO.tell()--which made the whole
thing far easier than I thought. In the process I also got the
string.getat(int) method working, but couldn't decide whether it
should return an int or a string. Right now (in my build of ChucK) it
returns an int, and -1 if it goes out of bounds. I could probably
include the patch here, but it's messy and gross.

Anyway, Scala class works now. It reads in a file with
Scala.read(string) and initializes with Scala.init(), then you can get
a pitch with Scala.mtof(int). That's all it does--any other
suggestions? The real Scala program does so much more that I hate to
just short it like this. It even reads in the files that are mixed
with cents and ratios, basically by just reading the first number and
looking for a "/". If it finds one, it reads the second number and
calculates the ratio, but if not then it calculates it as cents.

You have to have the CVS version of ChucK to use this. Search "CVS" on
the list and you'll find it posted often. Source code is attached. I'm
up for suggestions, interpretations, reactions, anything. Paraphrasing
Harry Partch, the only reason that a musical system is sustained is
because significant music has been written with it. So keep ChucKing.

Andrew

On Sat, Sep 26, 2009 at 12:25 PM, mike clemow <gelfmuse at gmail.com> wrote:
>>... So, hands up if anyone has been working with
>> FileIO to a large extent.
>
> me!
>
>> All right, admit if you've made a Scala file importer. If not, it's
>> about time that it was done,
>
> agreed.
>
>> ... Side projects for extending FileIO also include
>> implementing the tinyXML file parser, which would let us easily parse
>> XML files with ChucK.
>
> That is a great idea.  ChucK FileIO is kind of limited at the moment.
> I've been writing lots of pre-processing scripts in Python to make
> fileIO in ChucK a great deal easier.  I think that fileIO is really a
> great thing to have in ChucK and the better we make it, the more
> options we have for using complex data in our favorite audio
> programming language.
>
> More when the storms pass...
>
> Mike
>
> On Sat, Sep 26, 2009 at 12:09 AM, Andrew C. Smith
> <acsmith at willamette.edu> wrote:
>> All right, admit if you've made a Scala file importer. If not, it's
>> about time that it was done, likely not to extend mtof() directly but
>> rather as a separate public class/static method (like Scala.mtof or
>> something). I know you're probably sick of hearing about microtonal
>> things, but I've just been having a tough time getting a sustainable
>> system going where I can work with an existing scale archive and
>> develop my own tunings reasonably easily. I think a Scala converter is
>> where it's at.
>>
>> If it hasn't been done, can someone tell me (before I send this to the
>> dev list) where in the source the FileIO capabilities are? I just
>> finished building ChucK with Xcode, so I'm ready to dive in and make
>> some mistakes. Side projects for extending FileIO also include
>> implementing the tinyXML file parser, which would let us easily parse
>> XML files with ChucK. So, hands up if anyone has been working with
>> FileIO to a large extent.
>>
>> Andrew
>> _______________________________________________
>> chuck-users mailing list
>> chuck-users at lists.cs.princeton.edu
>> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>>
>
>
>
> --
> http://michaelclemow.com
> http://semiotech.org
> _______________________________________________
> chuck-users mailing list
> chuck-users at lists.cs.princeton.edu
> https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scala.ck
Type: application/octet-stream
Size: 2939 bytes
Desc: not available
URL: <http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20090928/594b9585/attachment.obj>


More information about the chuck-users mailing list