<br><br><div class="gmail_quote">On Sat, Feb 26, 2011 at 1:43 PM, David <span dir="ltr">&lt;<a href="mailto:dfkettle@gmail.com">dfkettle@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5">According to the<br>
help documentation, the &#39;-raw&#39; flag only applies to reading files. Is<br>
that correct?<br></div></div></blockquote><div>Well, you can write it back as a soundfile in the formats that [soundfiler] supports. But if it needs to be saved in the original format, you might want to try some of the other suggestions. </div>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">
<br>
Anyway, I tried it and I&#39;m getting a usage error:<br>
<br>
error: usage: read [flags] filename tablename...<br>
flags: -skip &lt;n&gt; -nframes &lt;n&gt; -resize -maxsize &lt;n&gt; ...<br>
-raw &lt;headerbytes&gt; &lt;channels&gt; &lt;bytespersamp&gt; &lt;endian (b, l, or n)&gt;.<br>
<br>
Here&#39;s what my patch looks like. I&#39;m not sure what I&#39;m doing wrong.<br>
<br>
[read -raw 0 1 8 n Default.syx array1(<br>
|<br>
[soundfiler]<br></div></div></blockquote><div>[soundfiler] only supports 2, 3, or 4 bytes per sample...</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div class="h5">

<br>
There&#39;s no &quot;header&quot; in the file, it&#39;s just raw data for a Midi sysex<br>
message, and I want to read each byte as an integer value in the range<br>
of 0 to 255.<br></div></div></blockquote><div>...which would be 1 byte. Definitely try the other suggestions. :-)</div><div><br></div><div>.mmb </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div class="h5">
<br>
David.<br>
<br>
On Fri, Feb 25, 2011 at 7:26 PM, Mike Moser-Booth &lt;<a href="mailto:mmoserbooth@gmail.com">mmoserbooth@gmail.com</a>&gt; wrote:<br>
&gt; Try using the -raw flag for [soundfiler]. Setting the &lt;bytespersample&gt;<br>
&gt; parameter to 2 will treat it as a 16-bit file.<br>
&gt;<br>
&gt; .mmb<br>
&gt;<br>
&gt; On Fri, Feb 25, 2011 at 7:07 PM, David &lt;<a href="mailto:dfkettle@gmail.com">dfkettle@gmail.com</a>&gt; wrote:<br>
&gt;&gt; It&#39;s probably very obvious, but I can&#39;t figure out how to read and<br>
&gt;&gt; write files containing arbitrary binary data. I know there are objects<br>
&gt;&gt; for reading and writing sound files, and there&#39;s [textfile] for<br>
&gt;&gt; reading text files, but I want to read and write binary files, and<br>
&gt;&gt; interpret each byte as a 16-bit integer. Does anyone have an example I<br>
&gt;&gt; can look at? Since they will be small files, I just need to read them<br>
&gt;&gt; sequentially, I don&#39;t need to jump around in the file randomly.<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; <a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
&gt;&gt; UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
&gt;&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt; Mike Moser-Booth<br>
&gt; <a href="mailto:mmoserbooth@gmail.com">mmoserbooth@gmail.com</a><br>
&gt;<br>
<br>
_______________________________________________<br>
<a href="mailto:Pd-list@iem.at">Pd-list@iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -&gt; <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Mike Moser-Booth<br><a href="mailto:mmoserbooth@gmail.com">mmoserbooth@gmail.com</a><br>