[PD] soundfiler and raw files

Gregorio García ggkarman at airtel.net
Thu Aug 23 15:49:52 CEST 2001

Hi list,

Im trying to read raw data files using soundfiler obj but get this unwanted

The files (generated in matlab), are supposed to be 'ieee-float32' and
contain 515 32-bit floating point numbers. Im trying to read the data to an
array using soundfiler, sending read to it with the following options:

read - raw 0 1 4 l

(0 as matlab says nothing about header data
1 for one channel
4 for 32 bit
l for little endian)

this reports an error message: unknown or bad header format

When i change header size from 0 to 1, soundfiler reads the array but the
data isn´t correct (the data in the attached file is supposed to contain the
dta for sin^2 from 0 to pi).

I get similar behaviour with headersize 2 to 99

When i set headersize to 100 (ie read -raw 100 1 4 l) the data read suddenly
becomes correct, but the first 26 floats in the file are missing in the

What am i doing wrong? How can i get it to work?
If the file format is inconvenient for soundfiler to read could anyone
suggest some other format (matlab can generate a range of standard platform
independent formats.)
The data in the files is intended to be used as wavetables in pd: is there a
more convenient method for reading files it into arrays? amy other

PD: the attached binary file was generated in matlab for windows (with
fwrite), and is supposed to contain 515 32bit littleendianness floats
representing a sin^2 function from 0 to pi, padded with one 0 at the
beginning and two 0s at the end.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sin2.wvt
Type: application/octet-stream
Size: 2060 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20010823/7fa72485/attachment.obj>

More information about the Pd-list mailing list