<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: peek~ versus poke~ accuracy problem</title>
		<atom:link href="http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 14:19:45 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-30953</guid>
					<title><![CDATA[peek~ versus poke~ accuracy problem]]></title>
					<link>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-30953</link>
					<pubDate>Wed, 21 Mar 2007 14:37:50 +0000</pubDate>
					<dc:creator>bin</dc:creator>

					<description>
						<![CDATA[
						<p>hi<br />
I&#8217;m having trouble understanding how values are written into various file types. writing a value such as 0.5 or 1 into a buffer~ <br />
seems to get written to disk as a value slightly less than those numbers, unless a choose a filetype float32 or float64. i want to use standard int16 filetype, to write values that will be stable when i write and read the file! at the moment every time i write and read a value to disk it seems to change, i don&#8217;t understand why, especially with a number like .5 or 1 which i would have thought could be accurately represented by a 16bit write, or 8bit write. does this mean my audio files are degrading every time i resave them? confused</p>
<p>james</p>
<p>heres an example </p>
<p>
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 1;<br />
#P message 219 62 23 196617 0 1;<br />
#P user ezdac~ 56 176 100 209 0;<br />
#P message 187 62 26 196617 0 0.5;<br />
#P window setfont &#8220;Sans Serif&#8221; 12.;<br />
#P user number~ 188 167 285 186 12 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P newex 190 142 48 196617 index~ z;<br />
#P newex 190 120 38 196617 sig~ 0;<br />
#P message 117 75 48 196617 read zed;<br />
#P message 116 56 53 196617 write zed;<br />
#P user umenu 45 95 53 196647 1 64 111 0;<br />
#X add int8;<br />
#X add int16;<br />
#X add int24;<br />
#X add int32;<br />
#X add float32;<br />
#X add float64;<br />
#X add mulaw;<br />
#X add alaw;<br />
#P newex 45 116 89 196617 prepend samptype;<br />
#P newex 45 136 67 196617 buffer~ z 10;<br />
#P newex 190 90 44 196617 peek~ z;<br />
#P connect 11 0 0 0;<br />
#P connect 9 0 0 0;<br />
#P connect 7 0 8 0;<br />
#P connect 5 0 1 0;<br />
#P connect 4 0 1 0;<br />
#P connect 2 0 1 0;<br />
#P connect 6 0 7 0;<br />
#P fasten 3 1 2 0 93 113 50 113;<br />
#P window clipboard copycount 12;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99653</guid>
					<title><![CDATA[Re: peek~ versus poke~ accuracy problem]]></title>
					<link>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99653</link>
					<pubDate>Wed, 21 Mar 2007 15:08:39 +0000</pubDate>
					<dc:creator>bin</dc:creator>

					<description>
						<![CDATA[
						<p>sorry title of post is wrong</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99654</guid>
					<title><![CDATA[Re: peek~ versus poke~ accuracy problem]]></title>
					<link>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99654</link>
					<pubDate>Wed, 21 Mar 2007 15:58:42 +0000</pubDate>
					<dc:creator>Emmanuel Jourdan</dc:creator>

					<description>
						<![CDATA[
						<p>On 21 mars 07, at 14:37, bin ray wrote:</p>
<p>> I&#8217;m having trouble understanding how values are written into  <br />
> various file types. writing a value such as 0.5 or 1 into a buffer~<br />
> seems to get written to disk as a value slightly less than those  <br />
> numbers, unless a choose a filetype float32 or float64. i want to  <br />
> use standard int16 filetype, to write values that will be stable  <br />
> when i write and read the file! at the moment every time i write  <br />
> and read a value to disk it seems to change, i don&#8217;t understand  <br />
> why, especially with a number like .5 or 1 which i would have  <br />
> thought could be accurately represented by a 16bit write, or 8bit  <br />
> write. does this mean my audio files are degrading every time i  <br />
> resave them? confused</p>
<p>I&#8217;m not sure I&#8217;m understand. Max is working with 32 bits floating  <br />
points number for the signal part. If you play an int16 file it&#8217;ll  <br />
automatically be &#8220;converted&#8221; as 32bits fp. When you save a file you  <br />
just convert a 32 bits fp into something else.</p>
<p>Cheers,<br />
ej</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99655</guid>
					<title><![CDATA[Re: peek~ versus poke~ accuracy problem]]></title>
					<link>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99655</link>
					<pubDate>Wed, 21 Mar 2007 16:45:00 +0000</pubDate>
					<dc:creator>bin</dc:creator>

					<description>
						<![CDATA[
						<p>firstly. i don&#8217;t really understand the difference between an int32 file and a float32 file. they both seem to be the same size, i&#8217;m assuming each sample is a value containing 32 bits of binary data, so what is the difference?</p>
<p>how would the number 0.5 be represented in 32 bit float? and how is it represented in a 16 bit int file?</p>
<p>
if i save the value 0.5 into a 16bit int file, then read that file, max tells me the value is 0.499969. if i then write that file again as  16bit int, and read it again, max now tells me its 0.499939, every time i save it the value seems to change.</p>
<p>sorry i can&#8217;t find anything in the documentation that explains this</p>
<p>james</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99656</guid>
					<title><![CDATA[Re: peek~ versus poke~ accuracy problem]]></title>
					<link>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99656</link>
					<pubDate>Wed, 21 Mar 2007 17:09:37 +0000</pubDate>
					<dc:creator>Gregory Taylor</dc:creator>

					<description>
						<![CDATA[
						<p>> sorry i can&#8217;t find anything in the documentation that explains this</p>
<p>That&#8217;s because the standards for representing in32 and float32 have nothing to do with Cycling &#8217;74. That&#8217;s a standard data representation problem. I&#8217;d try something like IEEE for explanations of that sort of tweakiness.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99657</guid>
					<title><![CDATA[Re: peek~ versus poke~ accuracy problem]]></title>
					<link>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99657</link>
					<pubDate>Wed, 21 Mar 2007 17:34:24 +0000</pubDate>
					<dc:creator>bin</dc:creator>

					<description>
						<![CDATA[
						<p>i&#8217;m not clear why you think this isn&#8217;t a problem relevant to maxmsp. </p>
<p>i&#8217;m trying to write a value into a 16 bit int file from what is apparently a 32 bit float buffer~. all i want is that its the same value when i read the file again. <br />
i&#8217;m expecting the value to be quantized to 16bit when its written to the file, but i don&#8217;t understand why it keeps decreasing every time i write and read the file. </p>
<p>in the following patch try entering a value into the buffer~ z and then writing and then reading the file (as 16 bit int)alternately. every time you read the file the value decreases a little.</p>
<p>i dont understand why. doesnt this mean all my 16bit int audio and data files are degrading as i rewrite them?</p>
<p>#P window setfont &#8220;Sans Serif&#8221; 9.;<br />
#P window linecount 4;<br />
#P comment 193 251 100 196617 value read from file into buffer loses about 2ms for each write /read;<br />
#P window linecount 2;<br />
#P comment 39 179 100 196617 write then read alternately;<br />
#P window linecount 1;<br />
#P newex 198 65 52 196617 / 65536.;<br />
#P flonum 198 34 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P user ezdac~ 200 322 244 355 0;<br />
#P message 198 91 31 196617 0 $1;<br />
#P newex 198 119 44 196617 peek~ z;<br />
#P user number~ 194 225 369 240 9 3 3 2 0. 0. 0 0. 250 0. 0 0 0 221 221 221 222 222 222 0 0 0;<br />
#P newex 194 203 59 196617 *~ 65536.;<br />
#P newex 195 180 48 196617 index~ z;<br />
#P newex 195 158 38 196617 sig~ 0;<br />
#P message 99 153 48 196617 read zed;<br />
#P message 39 152 53 196617 write zed;<br />
#P user umenu 42 51 53 196647 1 64 67 0;<br />
#X add int8;<br />
#X add int16;<br />
#X add int24;<br />
#X add int32;<br />
#X add float32;<br />
#X add float64;<br />
#X add mulaw;<br />
#X add alaw;<br />
#P newex 42 72 89 196617 prepend samptype;<br />
#P newex 42 92 85 196617 buffer~ z 10000;<br />
#P comment 242 34 100 196617 enter a value;<br />
#P connect 7 0 8 0;<br />
#P connect 8 0 9 0;<br />
#P connect 14 0 11 0;<br />
#P connect 13 0 14 0;<br />
#P fasten 3 1 2 0 90 69 47 69;<br />
#P connect 5 0 1 0;<br />
#P connect 4 0 1 0;<br />
#P connect 2 0 1 0;<br />
#P connect 6 0 7 0;<br />
#P connect 11 0 10 0;<br />
#P window clipboard copycount 17;</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99658</guid>
					<title><![CDATA[Re: peek~ versus poke~ accuracy problem]]></title>
					<link>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99658</link>
					<pubDate>Wed, 21 Mar 2007 19:30:50 +0000</pubDate>
					<dc:creator>bin</dc:creator>

					<description>
						<![CDATA[
						<p>ok i did some tests, and yes i am gradually eroding all my sound files as  they get converted to and fro from 32 bit float to 16int and back, during read/write. so now i will have to use 32 bit float as file type i guess, since all my metadata is in sound files, and i don&#8217;t want my audio to get degraded. if theres any other solution i&#8217;d be interested to know. i still don&#8217;t understand *why* this happens</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99659</guid>
					<title><![CDATA[Re: peek~ versus poke~ accuracy problem]]></title>
					<link>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99659</link>
					<pubDate>Thu, 22 Mar 2007 10:59:59 +0000</pubDate>
					<dc:creator>Stefan Tiedje</dc:creator>

					<description>
						<![CDATA[
						<p>Gregory Taylor schrieb:<br />
>> sorry i can&#8217;t find anything in the documentation that explains this<br />
>> <br />
> <br />
> That&#8217;s because the standards for representing in32 and float32 have<br />
> nothing to do with Cycling &#8217;74. That&#8217;s a standard data representation<br />
> problem. I&#8217;d try something like IEEE for explanations of that sort of<br />
> tweakiness.</p>
<p>The problem is the way how it is converted: you map 16-bit integer, a <br />
range going from -32768 to + 32767 (non symetric)to -1.0 to +1.0. <br />
(symetric)&#8230; Just to get an idea.<br />
If you want to store to disk and later load it in again, just save as <br />
32-bit float, you have to set the fileformat before saving&#8230; (I guess <br />
for that purpose the additional space needed doesn&#8217;t hurt too much&#8230; ;-)</p>
<p>Stefan</p>
<p>&#8211; <br />
Stefan Tiedje&#8212;&#8212;&#8212;&#8212;x&#8212;&#8212;-<br />
&#8211;_____&#8212;&#8212;&#8212;&#8211;|&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8211;(_|_ &#8212;-|&#8212;&#8211;|&#8212;&#8211;()&#8212;&#8212;-<br />
&#8211; _|_)&#8212;-|&#8212;&#8211;()&#8212;&#8212;&#8212;&#8212;&#8211;<br />
&#8212;&#8212;&#8212;-()&#8212;&#8212;&#8211;www.ccmix.com</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99660</guid>
					<title><![CDATA[Re: peek~ versus poke~ accuracy problem]]></title>
					<link>http://cycling74.com/forums/topic/peek-versus-poke-accuracy-problem/#post-99660</link>
					<pubDate>Thu, 22 Mar 2007 11:30:44 +0000</pubDate>
					<dc:creator>bin</dc:creator>

					<description>
						<![CDATA[
						<p>>The problem is the way how it is converted: you map 16-bit >integer, a <br />
>range going from -32768 to + 32767 (non symetric)to -1.0 to >+1.0. <br />
>(symetric)&#8230; Just to get an idea.<br />
>If you want to store to disk and later load it in again, just >save as <br />
>32-bit float, you have to set the fileformat before saving&#8230; (I guess <br />
>for that purpose the additional space needed doesn&#8217;t hurt too >much&#8230; ;-)</p>
<p>i thought it was something like that. i&#8217;d assumed there would be values common to both file formats i could use that would be stable, but apparently not. strange to think of my old files being worn away smooth as pebbles over the years of not knowing this</p>
<p>thanks <br />
james</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

