Actually it isn't the right list.... this is the right one:
or archived. All sc-users emails should go to the bham.ac.uk address.
> Hiho,
>
> On Tuesday 15 July 2008 10:43:29 lea nicholson wrote:
>> I had a question on here a couple of weeks ago about recording mouse
>> movements to a buffer. The help provided was incredibly useful. I am
>> now trying to record the content of that buffer to a file, and running
>> into some problems there.
>>
>> as far as I understand it,
>>
>> Buffer.write
>>
>> is expecting to be writing to a sound file, and requires appropriate
>> info for this task. This is not what I am doing here. Obviously, I
>> tried this and it didn't work, but no surprise. So I went up the chain
>> a little to
>>
>> File.write
>>
>> This seemed a great deal more promising. However, the following code
>> doesn't work, and I am not sure why, given that Buffers are described
>> as "globally available arrays of floats" in help file for Buffer.
>>
>> // This block should record buffer b - containing mouse movement data
>> - to a file?
>> (
>> var h;
>> // "wb" arg for read/write binary
>> h = File("myFile", "wb");
>> // b is buffer containing mouse movement coords
>> b.do({ arg item; h.putFloat(item)});
>> h.close;
>> )
>>
>> error message starts
>>
>> ERROR: Primitive '_FilePutFloat' failed.
>> Wrong type.
>>
>> running b as a line of code gives:
>>
>> Buffer(2, 10335.9375, 1, 44100, nil)
>>
>> so the Buffer does exist.
>>
>> Also, is this question appropriate for this list - a great deal of the
>> questions on here seem to be concerned with development?
>
> this is the right list.
>
> Buffer in the language (sclang) is a representation of a buffer on the server
> (scsynth).
> If you want to write the contents to a file, you either have to use Buffer's
> write method and not care so much that the file will have an audio header (or
> use the format "raw", which will result in a raw binary file, which seems to
> be what you want anyway), or retrieve the data from the buffer to the
> language (with Buffer.getToFloatArray) and store it with File.
>
> sincerely,
> Marije
> _______________________________________________
> sc-users mailing list
>
sc-users@...
>
http://lists.create.ucsb.edu/mailman/listinfo/sc-users>