[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] DATA FILES (thanks David cottle)



Thanks David. This is definitely the best chapter in your book ( markov
chains). Do you where I can get further instructions on this subject(related
to supercollider)?
The string example does work and is definitely better to work with.

Thanks,
Pb.


> Hi,
> 
> I would guess getAllInt16 is no longer implemented. I'm not sure. I should
> change the example.
> 
> Read the next section. I think working with interpreted strings is easier
> anyway, because you can edit the file using any text editor.
> 
> var fp, data;
> fp = File("TestInt", "w");
> data = "[65, 66, 67, 68, 69, 70, 71]";
> fp.write(data);
> fp.close;
> 
> var fp, data;
> fp = File("TestInt", "r"); //open a file
> fp.length;
> data = fp.readAllString.interpret;
> data.postln;
> data.at(0).postln;
> fp.close;
> 
> Note that the code below also works, but data is now a string, not an array
> of integers (as illustrated by data.at(0), which is the character "["). The
> .interpret translates the string into code, i.e. an array of integers.
> 
> var fp, data;
> fp = File("TestInt", "r"); //open a file
> fp.length;
> data = fp.readAllString;
> data.postln;
> data.at(0).postln;
> fp.close;
> 
> 
> _______________________________________________
> sc-users mailing list
> sc-users@xxxxxxxxxxxxxxx
> http://www.create.ucsb.edu/mailman/listinfo/sc-users
> 
>