<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:www.nabble.com,2006:forum-481</id>
	<title>Nabble - Csound - Dev</title>
	<updated>2008-10-12T03:21:33Z</updated>
	<link rel="self" type="application/atom+xml" href="http://www.nabble.com/Csound---Dev-f481.xml" />
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Csound---Dev-f481.html" />
	<subtitle type="html"></subtitle>
	
<entry>
	<id>tag:www.nabble.com,2006:post-19940326</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-12T03:21:33Z</published>
	<updated>2008-10-12T03:21:33Z</updated>
	<author>
		<name>jpff</name>
	</author>
	<content type="html">We used to have a dither-on-output option in csound4 -- not a good one
&lt;br&gt;i might add -- but in the change to Csound5 with libsndfile this
&lt;br&gt;operation was deferred to the library code; we call the options to
&lt;br&gt;switch it on. &amp;nbsp;It has now been confirmed that this code is not
&lt;br&gt;implemented, so we have the choice of resurrecting the cs4 code,
&lt;br&gt;waiting for Erik's free time(TM), or writing it ourselves and offering
&lt;br&gt;to libsndfile.
&lt;br&gt;==John ffitch
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19940326&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19940326.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19939080</id>
	<title>liblo and mingw</title>
	<published>2008-10-11T23:30:11Z</published>
	<updated>2008-10-11T23:30:11Z</updated>
	<author>
		<name>Steven Yi</name>
	</author>
	<content type="html">Hi All,
&lt;br&gt;&lt;br&gt;I tried to get liblo compiled on windows with MinGW and it took a
&lt;br&gt;while. &amp;nbsp;I managed to get it done using the following:
&lt;br&gt;&lt;br&gt;./configure LIBS=-lws2_32 CFLAGS=&amp;quot;-DWIN32 -D_WIN32_WINNT=0x0501&amp;quot;
&lt;br&gt;&lt;br&gt;and commenting out gai_strerrorA in src/server.c. &amp;nbsp; Most of this info
&lt;br&gt;came from the cross-compile info for liblo on the CLAM site:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://clam.iua.upf.edu/wikis/clam/index.php/Devel/Windows_MinGW_cross_compile&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://clam.iua.upf.edu/wikis/clam/index.php/Devel/Windows_MinGW_cross_compile&lt;/a&gt;&lt;br&gt;&lt;br&gt;This got liblo-0.24 compiled here (0.25 failed, but I just went with
&lt;br&gt;0.24). &amp;nbsp;Just thought I'd mention this in case anyone runs into this.
&lt;br&gt;&lt;br&gt;Thanks!
&lt;br&gt;steven
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19939080&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/liblo-and-mingw-tp19939080p19939080.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19938317</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-11T19:49:49Z</published>
	<updated>2008-10-11T19:49:49Z</updated>
	<author>
		<name>Jim Bates</name>
	</author>
	<content type="html">&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;
&lt;div&gt;Boy!  This is starting to get interesting now!&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Michael Gogins wrote:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;-- Do not render to any kind of integer soundfile, not even 24 bit. Render to float soundfiles. This also means do not dither.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;-- If you must render to an integer format, dither in the final float to integer conversion step. If Csound's dither doesn't work, use an editor that has it.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;The basic principle is: always use the highest-precision format that you possibly can (float, 88200 or 96000 Hz at a minimum) at every stage of rendering. If the target is a lower precision, put off converting to the lower precision until the very last step.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;This is entirely consistent with the Bob Katz approach, and indeed is partly informed by it.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Regards,&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Mike&lt;/div&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Quite true, every word of it.  &lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Regarding  &lt;font class=&quot;Apple-style-span&quot; color=&quot;#000001&quot;&gt;&quot;If Csound's dither doesn't work, use an editor that has it.&quot;, on this I agree too, IF conversion to integer is required.  &lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class=&quot;Apple-style-span&quot; color=&quot;#000001&quot;&gt;&lt;br&gt;&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class=&quot;Apple-style-span&quot; color=&quot;#000001&quot;&gt;But additionally, I'd like to fix and improve the quality of dithering available in Csound, since I see in it the possibility of far better dither options than are available in most software  and hardware you can get for under 5 figures.  And, yes, I use the word in the plural, since I don't find one type of dither is adequate for ALL circumstances.  POWr3 is extremely good, but it doesn't fit everything.  &lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Richard Dobson wrote:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;It has nothing to do with sample rates, but to with output sample format &lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;  (floats, 24bit etc)  and thus could not be implemented as an opcode &lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;(indeed would be meaningless as an opcode); it has to be part of the &lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;output subsystem, whether writing to a soundcard (or other streaming &lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;graph, when Csound is running as a plugin; but we would expect that to &lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;be in floats  anyway) or to disk, and controlled at host or api level. &lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Portaudio, for example, has its own api for managing dither.&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;The only opcode I can imagine  would be some sort of &quot;quantize&quot; opcode &lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;(e.g. for deliberate &quot;grunging&quot; of a sound), with dithering incorporated &lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;as a parameter, applied (by default) to the lowest quantization  level. &lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;I am so out of touch with Csound opcodes these days that perhaps there &lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;already is such a thing?&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; min-height: 14px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;Richard Dobson&lt;/div&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Fons Adriaensen wrote:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;I agree, the right place to do dithering is in the audio output&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;interface (either to HW or to file). It should be of no concern&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;to Csound itself.&lt;/div&gt;&lt;/blockquote&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;There may be a good reason for what you both say here, that's plainly obvious to one and all--but my experience with the fine details of the workings of Csound is no where near where you guys are at.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Now, that said, my thoughts are these:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;If Csound is running with streaming output, it would be better to upgrade the signal chain than dither Csound.  And if it's running as a plug-in, then it's part of another program that quite likely has its own dither anyway, and you certainly wouldn't &quot;double-dither&quot;...that's a no-no.  Also, if it's a plug-in that's part of a larger mix, then dither isn't called for until the mix is done, the polishing is complete and it's ready for CD or DVD.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;There's another reason I lean toward Csound code (totally aside from being more familiar with it...):&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Dither must be both random and UN-correlated= it CANNOT be correlated with either the signal NOR itself from one channel to another.  In a stereo recording if the same dither is applied to both channels it will collapse the separation (along with the ambience that was being &quot;salvaged&quot; by dithering).  Poor dither can be worse than no dither, as the last example would have lost the ambience and only had added noise.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The rand opcode can be easily configured with a different seed for each instance.  I have tested it using a correlation meter= zero correlation.  Placing it at the end of the orc in the csd file seems to work.  But, feel free to point out anything I'm missing.  This is still in the design stages.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;And Csound can handle up to 16 channels of audio, which would have to addressed in this manner so as not to degrade the result.  I'm sure this COULD be done internally in the audio output interface, but, aside from being a LOT of work on the internals of Csound (IMHO), it's also a lot to have going on that's &quot;hard-wired&quot; into Csound for a function that will get, at best 5% use (or less).  And &quot;changing or refining the dither algorithms&quot; would be a real bitch as well.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;But I well may be overlooking something quite obvious.  Wouldn't be the first time....&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;All the Best,&lt;/div&gt;&lt;div&gt;Jim Bates&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;br&gt;&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19938317&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19938317.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19936859</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-11T14:43:06Z</published>
	<updated>2008-10-11T14:43:06Z</updated>
	<author>
		<name>Fons Adriaensen-2</name>
	</author>
	<content type="html">On Sat, Oct 11, 2008 at 10:23:03PM +0100, Richard Dobson wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; It has nothing to do with sample rates, but to with output sample format 
&lt;br&gt;&amp;gt; &amp;nbsp; (floats, 24bit etc) &amp;nbsp;and thus could not be implemented as an opcode 
&lt;br&gt;&amp;gt; (indeed would be meaningless as an opcode); it has to be part of the 
&lt;br&gt;&amp;gt; output subsystem, whether writing to a soundcard (or other streaming 
&lt;br&gt;&amp;gt; graph, when Csound is running as a plugin; but we would expect that to 
&lt;br&gt;&amp;gt; be in floats &amp;nbsp;anyway) or to disk, and controlled at host or api level. 
&lt;br&gt;&amp;gt; Portaudio, for example, has its own api for managing dither.
&lt;br&gt;&lt;br&gt;As does Jack when running under Linux or OSX.
&lt;br&gt;&lt;br&gt;I agree, the right place to do dithering is in the audio output
&lt;br&gt;interface (either to HW or to file). It should be of no concern
&lt;br&gt;to Csound itself.
&lt;br&gt;&lt;br&gt;Ciao,
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;FA
&lt;br&gt;&lt;br&gt;Follie! Follie! Delirio vano e' questo!
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19936859&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19936859.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19936886</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-11T14:41:20Z</published>
	<updated>2008-10-11T14:41:20Z</updated>
	<author>
		<name>Erik de Castro Lopo-10</name>
	</author>
	<content type="html">Richard Dobson wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; but to with output sample format 
&lt;br&gt;&amp;gt; (floats, 24bit etc) &amp;nbsp;and thus could not be implemented as an opcode 
&lt;br&gt;&amp;gt; (indeed would be meaningless as an opcode); it has to be part of the 
&lt;br&gt;&amp;gt; output subsystem, whether writing to a soundcard (or other streaming 
&lt;br&gt;&amp;gt; graph, when Csound is running as a plugin; but we would expect that to 
&lt;br&gt;&amp;gt; be in floats &amp;nbsp;anyway) or to disk, and controlled at host or api level. 
&lt;br&gt;&amp;gt; Portaudio, for example, has its own api for managing dither.
&lt;br&gt;&lt;br&gt;Thats why one of the obvious places for it is in libsndfile because
&lt;br&gt;at least for file output, thats is where the final conversion takes
&lt;br&gt;place.
&lt;br&gt;&lt;br&gt;My plans for libsndfile were make dither an option that could be
&lt;br&gt;switched on and off and &amp;nbsp;even when switch on, to do it only when
&lt;br&gt;the conversion required it.
&lt;br&gt;&lt;br&gt;Erik
&lt;br&gt;-- 
&lt;br&gt;-----------------------------------------------------------------
&lt;br&gt;Erik de Castro Lopo
&lt;br&gt;-----------------------------------------------------------------
&lt;br&gt;&amp;quot;Two hands working can do more than a thousand clasped in prayer.&amp;quot;
&lt;br&gt;-- anonymous
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19936886&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19936886.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19936576</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-11T14:23:03Z</published>
	<updated>2008-10-11T14:23:03Z</updated>
	<author>
		<name>Richard Dobson</name>
	</author>
	<content type="html">Jim Bates wrote:
&lt;br&gt;..
&lt;br&gt;&amp;gt; I don't think that dither should be put &amp;quot;under the hood&amp;quot; in
&lt;br&gt;&amp;gt; Csound. &amp;nbsp;It needs to be (ideally) in opcode format, so it could be
&lt;br&gt;&amp;gt; called ONLY when converting work to lower sample rates, and
&lt;br&gt;&amp;gt; even then only 'one shot'.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;It has nothing to do with sample rates, but to with output sample format 
&lt;br&gt;&amp;nbsp; (floats, 24bit etc) &amp;nbsp;and thus could not be implemented as an opcode 
&lt;br&gt;(indeed would be meaningless as an opcode); it has to be part of the 
&lt;br&gt;output subsystem, whether writing to a soundcard (or other streaming 
&lt;br&gt;graph, when Csound is running as a plugin; but we would expect that to 
&lt;br&gt;be in floats &amp;nbsp;anyway) or to disk, and controlled at host or api level. 
&lt;br&gt;Portaudio, for example, has its own api for managing dither.
&lt;br&gt;&lt;br&gt;The only opcode I can imagine &amp;nbsp;would be some sort of &amp;quot;quantize&amp;quot; opcode 
&lt;br&gt;(e.g. for deliberate &amp;quot;grunging&amp;quot; of a sound), with dithering incorporated 
&lt;br&gt;as a parameter, applied (by default) to the lowest quantization &amp;nbsp;level. 
&lt;br&gt;I am so out of touch with Csound opcodes these days that perhaps there 
&lt;br&gt;already is such a thing?
&lt;br&gt;&lt;br&gt;Richard Dobson
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19936576&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19936576.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19936337</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-11T13:53:17Z</published>
	<updated>2008-10-11T13:53:17Z</updated>
	<author>
		<name>Steven Yi</name>
	</author>
	<content type="html">Just a side note, wanted to say thanks to everyone who contributed to
&lt;br&gt;this thread; I learned quite a bit!
&lt;br&gt;&lt;br&gt;On Sat, Oct 11, 2008 at 11:04 AM, Jim Bates &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19936337&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jabates@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Thank you all for your posts! &amp;nbsp;The issue is resolved.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Fons Adriaensen wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; You need dither when converting to an integer format,
&lt;br&gt;&amp;gt;&amp;gt; in particular anything less than say 20 bits.
&lt;br&gt;&amp;gt;&amp;gt; The procedure to do this when starting from floats is
&lt;br&gt;&amp;gt;&amp;gt; exactly the same as when you start from a higher precision
&lt;br&gt;&amp;gt;&amp;gt; integer format. You add noise then convert to integer.
&lt;br&gt;&amp;gt;&amp;gt; Except in some rather special cases, the amplitude of
&lt;br&gt;&amp;gt;&amp;gt; the noise depends on the 'step size' of the output format
&lt;br&gt;&amp;gt;&amp;gt; only - this is why the procedure is essentially the same
&lt;br&gt;&amp;gt;&amp;gt; for FP-&amp;gt;16bit as for 24bit-&amp;gt;16bit. &amp;nbsp;The noise added
&lt;br&gt;&amp;gt;&amp;gt; should have a triangular distribution between -1 and +1
&lt;br&gt;&amp;gt;&amp;gt; times the output step size.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Richard Dobson wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; People &amp;nbsp;can practise this radical worldview by setting 0dbfs=1 in all
&lt;br&gt;&amp;gt;&amp;gt; their orc files, rather than the historical but otherwise pointless
&lt;br&gt;&amp;gt;&amp;gt; and
&lt;br&gt;&amp;gt;&amp;gt; irrelevant 32768!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Thank you for persisting in getting your point across Fons. &amp;nbsp;It
&lt;br&gt;&amp;gt; finally sank in, and along with Richard's point, the &amp;quot;dithering of
&lt;br&gt;&amp;gt; floats to ints&amp;quot; is fully clear. &amp;nbsp;So, thank you!
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I don't think that dither should be put &amp;quot;under the hood&amp;quot; in
&lt;br&gt;&amp;gt; Csound. &amp;nbsp;It needs to be (ideally) in opcode format, so it could be
&lt;br&gt;&amp;gt; called ONLY when converting work to lower sample rates, and
&lt;br&gt;&amp;gt; even then only 'one shot'.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Richard--
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;I'm writing Csound code for various dither algorithms. &amp;nbsp;Would you
&lt;br&gt;&amp;gt; be willing and able to re-write the code as an opcode or family
&lt;br&gt;&amp;gt; of opcodes?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; All the Best,
&lt;br&gt;&amp;gt; Jim Bates
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt; This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;&amp;gt; Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;&amp;gt; Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; Csound-devel mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19936337&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19936337&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19936337.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19934984</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-11T11:04:47Z</published>
	<updated>2008-10-11T11:04:47Z</updated>
	<author>
		<name>Jim Bates</name>
	</author>
	<content type="html">Thank you all for your posts! &amp;nbsp;The issue is resolved.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Fons Adriaensen wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; You need dither when converting to an integer format,
&lt;br&gt;&amp;gt; in particular anything less than say 20 bits.
&lt;br&gt;&amp;gt; The procedure to do this when starting from floats is
&lt;br&gt;&amp;gt; exactly the same as when you start from a higher precision
&lt;br&gt;&amp;gt; integer format. You add noise then convert to integer.
&lt;br&gt;&amp;gt; Except in some rather special cases, the amplitude of
&lt;br&gt;&amp;gt; the noise depends on the 'step size' of the output format
&lt;br&gt;&amp;gt; only - this is why the procedure is essentially the same
&lt;br&gt;&amp;gt; for FP-&amp;gt;16bit as for 24bit-&amp;gt;16bit. &amp;nbsp;The noise added
&lt;br&gt;&amp;gt; should have a triangular distribution between -1 and +1
&lt;br&gt;&amp;gt; times the output step size.
&lt;/div&gt;&lt;br&gt;&lt;br&gt;Richard Dobson wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; People &amp;nbsp;can practise this radical worldview by setting 0dbfs=1 in all
&lt;br&gt;&amp;gt; their orc files, rather than the historical but otherwise pointless &amp;nbsp;
&lt;br&gt;&amp;gt; and
&lt;br&gt;&amp;gt; irrelevant 32768!
&lt;br&gt;&lt;br&gt;Thank you for persisting in getting your point across Fons. &amp;nbsp;It
&lt;br&gt;finally sank in, and along with Richard's point, the &amp;quot;dithering of
&lt;br&gt;floats to ints&amp;quot; is fully clear. &amp;nbsp;So, thank you!
&lt;br&gt;&lt;br&gt;I don't think that dither should be put &amp;quot;under the hood&amp;quot; in
&lt;br&gt;Csound. &amp;nbsp;It needs to be (ideally) in opcode format, so it could be
&lt;br&gt;called ONLY when converting work to lower sample rates, and
&lt;br&gt;even then only 'one shot'.
&lt;br&gt;&lt;br&gt;Richard--
&lt;br&gt;&amp;nbsp; &amp;nbsp; I'm writing Csound code for various dither algorithms. &amp;nbsp;Would you
&lt;br&gt;be willing and able to re-write the code as an opcode or family
&lt;br&gt;of opcodes?
&lt;br&gt;&lt;br&gt;All the Best,
&lt;br&gt;Jim Bates
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19934984&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19934984.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19934976</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-11T10:34:45Z</published>
	<updated>2008-10-11T10:34:45Z</updated>
	<author>
		<name>Dave Seidel</name>
	</author>
	<content type="html">I've been generally following Mike's advice by rendering to 96K/32, then 
&lt;br&gt;down-converting as necessary to 44.1K/16 with r8brain[1], which is free, 
&lt;br&gt;though not open source. &amp;nbsp;Seems to do a very decent job, and it included 
&lt;br&gt;dithering.
&lt;br&gt;&lt;br&gt;- Dave
&lt;br&gt;&lt;br&gt;[1] &lt;a href=&quot;http://www.voxengo.com/product/r8brain/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.voxengo.com/product/r8brain/&lt;/a&gt;&lt;br&gt;&lt;br&gt;Michael Gogins wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; My thoughts on this can be found in &amp;quot;A Csound Tutorial,&amp;quot; the final section on audio quality. This is in the Windows installers for Csound and can be found on the SourceForge public page for Csound. In addition to my comments there:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -- Do not render to any kind of integer soundfile, not even 24 bit. Render to float soundfiles. This also means do not dither.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -- If you must render to an integer format, dither in the final float to integer conversion step. If Csound's dither doesn't work, use an editor that has it.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The basic principle is: always use the highest-precision format that you possibly can (float, 88200 or 96000 Hz at a minimum) at every stage of rendering. If the target is a lower precision, put off converting to the lower precision until the very last step.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This is entirely consistent with the Bob Katz approach, and indeed is partly informed by it.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Regards,
&lt;br&gt;&amp;gt; Mike
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19934976&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19934976.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19932537</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-11T06:18:30Z</published>
	<updated>2008-10-11T06:18:30Z</updated>
	<author>
		<name>Michael Gogins</name>
	</author>
	<content type="html">24 bits is not floating point, it is integer. So this is not at odds with Katz.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Mike
&lt;br&gt;&lt;br&gt;-----Original Message-----
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;From: Jim Bates &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19932537&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jabates@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;Sent: Oct 10, 2008 8:54 PM
&lt;br&gt;&amp;gt;To: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19932537&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;csound-devel@...&lt;/a&gt;
&lt;br&gt;&amp;gt;Subject: [Cs-dev] Truncation in Csound5
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;My earlier post regarding the dither problem in Csound5 was started &amp;nbsp;
&lt;br&gt;&amp;gt;before I found out there is no dither currently in Csound5. While it &amp;nbsp;
&lt;br&gt;&amp;gt;has been implied that dither is not needed on a floating point &amp;nbsp;
&lt;br&gt;&amp;gt;system, that viewpoint is at odds with the following from the &amp;nbsp;
&lt;br&gt;&amp;gt;renowned mastering engineer Bob Katz:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;quot;But one programming mistake, or a few cost-saving shortcuts, can &amp;nbsp;
&lt;br&gt;&amp;gt;ruin ether fixed or floating point work, especially if shortcuts are &amp;nbsp;
&lt;br&gt;&amp;gt;taken at the most critical time, when the final output number is &amp;nbsp;
&lt;br&gt;&amp;gt;converted to fixed point 24 bit at the end. If those numbers are not &amp;nbsp;
&lt;br&gt;&amp;gt;converted (and properly dithered to 24 bits) at that time, then the &amp;nbsp;
&lt;br&gt;&amp;gt;sound of the entire system can be compromised.&amp;quot;
&lt;br&gt;&amp;gt;		 &amp;nbsp;Bob Katz &amp;quot;Fixed versus Floating Point Notation&amp;quot; (an answer to a &amp;nbsp;
&lt;br&gt;&amp;gt;question on his Audio FAQ)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;quot;When feeding processors, DAWs or digital mixers to your recording &amp;nbsp;
&lt;br&gt;&amp;gt;unit, dither the output of the processor to a 24-bit word. Dithering &amp;nbsp;
&lt;br&gt;&amp;gt;always sounds better than truncation without dither.&amp;quot;
&lt;br&gt;&amp;gt;		Bob Katz' article &amp;quot;Dither&amp;quot; &amp;nbsp;Full article at: &amp;nbsp;&lt;a href=&quot;http://www.digido.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.digido.com&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;So the real problem is more accurately a truncation problem.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;As the contention is about dithering floating point, I e-mailed Bob &amp;nbsp;
&lt;br&gt;&amp;gt;Katz with the following question:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;Do you know of any current (or past) algorithm for dithering floating &amp;nbsp;
&lt;br&gt;&amp;gt;point audio files?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;Here is his reply:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;Floating point is not the ideal medium for dithering as you don't &amp;nbsp;
&lt;br&gt;&amp;gt;know where the reference level is, it's &amp;quot;floating&amp;quot; :-). &amp;nbsp;Some people &amp;nbsp;
&lt;br&gt;&amp;gt;argue (probably correctly) that dithering makes no sense with &amp;nbsp;
&lt;br&gt;&amp;gt;floating point. So most algorithm designers convert to fixed point &amp;nbsp;
&lt;br&gt;&amp;gt;and then dither. &amp;nbsp;Does that answer your question?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;Best wishes,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;Bob
&lt;br&gt;&amp;gt;-- 
&lt;br&gt;&amp;gt;Bob Katz 407-831-0233 DIGITAL DOMAIN | &amp;quot;There are two kinds of fools,
&lt;br&gt;&amp;gt;Recording, Mastering, Manufacturing &amp;nbsp;| One says-this is old and &amp;nbsp;
&lt;br&gt;&amp;gt;therefore good.
&lt;br&gt;&amp;gt;Informative **CD MASTERING WEBSITE** | The other says-this is new and &amp;nbsp;
&lt;br&gt;&amp;gt;therefore
&lt;br&gt;&amp;gt;&lt;a href=&quot;http://www.digido.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.digido.com&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | better.&amp;quot;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;No trees were killed in the sending of this message. However a large &amp;nbsp;
&lt;br&gt;&amp;gt;number
&lt;br&gt;&amp;gt;of electrons were terribly inconvenienced.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;Another reference regarding that confirms this can be found here: &amp;nbsp; 
&lt;br&gt;&amp;gt;&lt;a href=&quot;http://www.cadenzarecording.com/images/FloatingDither.pdf&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.cadenzarecording.com/images/FloatingDither.pdf&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;This is as clear as I know how to put it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;I would appreciate some feedback on this from those who actually &amp;nbsp;
&lt;br&gt;&amp;gt;develop Csound, like Anthony Kozar, Michael Goggins, Andres Cabrera, &amp;nbsp;
&lt;br&gt;&amp;gt;Steven Yi, Victor Lazzarini, John ffitch, etc.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;All the Best,
&lt;br&gt;&amp;gt;Jim Bates
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19932537&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19932537.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19932533</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-11T06:17:24Z</published>
	<updated>2008-10-11T06:17:24Z</updated>
	<author>
		<name>Michael Gogins</name>
	</author>
	<content type="html">My thoughts on this can be found in &amp;quot;A Csound Tutorial,&amp;quot; the final section on audio quality. This is in the Windows installers for Csound and can be found on the SourceForge public page for Csound. In addition to my comments there:
&lt;br&gt;&lt;br&gt;-- Do not render to any kind of integer soundfile, not even 24 bit. Render to float soundfiles. This also means do not dither.
&lt;br&gt;&lt;br&gt;-- If you must render to an integer format, dither in the final float to integer conversion step. If Csound's dither doesn't work, use an editor that has it.
&lt;br&gt;&lt;br&gt;The basic principle is: always use the highest-precision format that you possibly can (float, 88200 or 96000 Hz at a minimum) at every stage of rendering. If the target is a lower precision, put off converting to the lower precision until the very last step.
&lt;br&gt;&lt;br&gt;This is entirely consistent with the Bob Katz approach, and indeed is partly informed by it.
&lt;br&gt;&lt;br&gt;Regards,
&lt;br&gt;Mike
&lt;br&gt;&lt;br&gt;-----Original Message-----
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;From: Jim Bates &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19932533&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jabates@...&lt;/a&gt;&amp;gt;
&lt;br&gt;&amp;gt;Sent: Oct 10, 2008 8:54 PM
&lt;br&gt;&amp;gt;To: &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19932533&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;csound-devel@...&lt;/a&gt;
&lt;br&gt;&amp;gt;Subject: [Cs-dev] Truncation in Csound5
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;My earlier post regarding the dither problem in Csound5 was started &amp;nbsp;
&lt;br&gt;&amp;gt;before I found out there is no dither currently in Csound5. While it &amp;nbsp;
&lt;br&gt;&amp;gt;has been implied that dither is not needed on a floating point &amp;nbsp;
&lt;br&gt;&amp;gt;system, that viewpoint is at odds with the following from the &amp;nbsp;
&lt;br&gt;&amp;gt;renowned mastering engineer Bob Katz:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;quot;But one programming mistake, or a few cost-saving shortcuts, can &amp;nbsp;
&lt;br&gt;&amp;gt;ruin ether fixed or floating point work, especially if shortcuts are &amp;nbsp;
&lt;br&gt;&amp;gt;taken at the most critical time, when the final output number is &amp;nbsp;
&lt;br&gt;&amp;gt;converted to fixed point 24 bit at the end. If those numbers are not &amp;nbsp;
&lt;br&gt;&amp;gt;converted (and properly dithered to 24 bits) at that time, then the &amp;nbsp;
&lt;br&gt;&amp;gt;sound of the entire system can be compromised.&amp;quot;
&lt;br&gt;&amp;gt;		 &amp;nbsp;Bob Katz &amp;quot;Fixed versus Floating Point Notation&amp;quot; (an answer to a &amp;nbsp;
&lt;br&gt;&amp;gt;question on his Audio FAQ)
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;quot;When feeding processors, DAWs or digital mixers to your recording &amp;nbsp;
&lt;br&gt;&amp;gt;unit, dither the output of the processor to a 24-bit word. Dithering &amp;nbsp;
&lt;br&gt;&amp;gt;always sounds better than truncation without dither.&amp;quot;
&lt;br&gt;&amp;gt;		Bob Katz' article &amp;quot;Dither&amp;quot; &amp;nbsp;Full article at: &amp;nbsp;&lt;a href=&quot;http://www.digido.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.digido.com&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;So the real problem is more accurately a truncation problem.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;As the contention is about dithering floating point, I e-mailed Bob &amp;nbsp;
&lt;br&gt;&amp;gt;Katz with the following question:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;Do you know of any current (or past) algorithm for dithering floating &amp;nbsp;
&lt;br&gt;&amp;gt;point audio files?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;Here is his reply:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;Floating point is not the ideal medium for dithering as you don't &amp;nbsp;
&lt;br&gt;&amp;gt;know where the reference level is, it's &amp;quot;floating&amp;quot; :-). &amp;nbsp;Some people &amp;nbsp;
&lt;br&gt;&amp;gt;argue (probably correctly) that dithering makes no sense with &amp;nbsp;
&lt;br&gt;&amp;gt;floating point. So most algorithm designers convert to fixed point &amp;nbsp;
&lt;br&gt;&amp;gt;and then dither. &amp;nbsp;Does that answer your question?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;Best wishes,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;Bob
&lt;br&gt;&amp;gt;-- 
&lt;br&gt;&amp;gt;Bob Katz 407-831-0233 DIGITAL DOMAIN | &amp;quot;There are two kinds of fools,
&lt;br&gt;&amp;gt;Recording, Mastering, Manufacturing &amp;nbsp;| One says-this is old and &amp;nbsp;
&lt;br&gt;&amp;gt;therefore good.
&lt;br&gt;&amp;gt;Informative **CD MASTERING WEBSITE** | The other says-this is new and &amp;nbsp;
&lt;br&gt;&amp;gt;therefore
&lt;br&gt;&amp;gt;&lt;a href=&quot;http://www.digido.com&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.digido.com&lt;/a&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; | better.&amp;quot;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;No trees were killed in the sending of this message. However a large &amp;nbsp;
&lt;br&gt;&amp;gt;number
&lt;br&gt;&amp;gt;of electrons were terribly inconvenienced.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;Another reference regarding that confirms this can be found here: &amp;nbsp; 
&lt;br&gt;&amp;gt;&lt;a href=&quot;http://www.cadenzarecording.com/images/FloatingDither.pdf&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.cadenzarecording.com/images/FloatingDither.pdf&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;This is as clear as I know how to put it.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;I would appreciate some feedback on this from those who actually &amp;nbsp;
&lt;br&gt;&amp;gt;develop Csound, like Anthony Kozar, Michael Goggins, Andres Cabrera, &amp;nbsp;
&lt;br&gt;&amp;gt;Steven Yi, Victor Lazzarini, John ffitch, etc.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;All the Best,
&lt;br&gt;&amp;gt;Jim Bates
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19932533&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19932533.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19931378</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-11T03:29:36Z</published>
	<updated>2008-10-11T03:29:36Z</updated>
	<author>
		<name>Erik de Castro Lopo-10</name>
	</author>
	<content type="html">Richard Dobson wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; The best dithering we can reasonably 
&lt;br&gt;&amp;gt; expect in Csound is plain TPDF (triangular); which is actually pretty 
&lt;br&gt;&amp;gt; good.
&lt;br&gt;&lt;br&gt;I do mean to (optionally) add the ability to dither appropriate
&lt;br&gt;conversions to libsndfile at some time. Unfortunately, my spare
&lt;br&gt;time is rather limited.
&lt;br&gt;&lt;br&gt;&amp;gt; We have no excuses &amp;nbsp;with regard to file sizes these 
&lt;br&gt;&amp;gt; days, except for high channel counts and high sample rates, and even 
&lt;br&gt;&amp;gt; WAVE itself can support 64bit doubles (I am pretty certain libsndfile 
&lt;br&gt;&amp;gt; supports that - Eric?).
&lt;br&gt;&lt;br&gt;Yes, libsndfile supports writing IEEE double floats to WAV, AIFF, AU
&lt;br&gt;and a number of other formats.
&lt;br&gt;&lt;br&gt;Erik
&lt;br&gt;-- 
&lt;br&gt;-----------------------------------------------------------------
&lt;br&gt;Erik de Castro Lopo
&lt;br&gt;-----------------------------------------------------------------
&lt;br&gt;&amp;quot;Indeed, I am impressed that Google runs an 8,000 node Linux
&lt;br&gt;cluster, 5 data centers, an extensive network, and a rapidly
&lt;br&gt;evolving application all with a staff of 12.&amp;quot;
&lt;br&gt;&amp;nbsp; -- &lt;a href=&quot;http://research.microsoft.com/~gray/papers/FAAMs_HPTS.doc&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://research.microsoft.com/~gray/papers/FAAMs_HPTS.doc&lt;/a&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19931378&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19931378.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19931141</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-11T02:38:45Z</published>
	<updated>2008-10-11T02:38:45Z</updated>
	<author>
		<name>Fons Adriaensen-2</name>
	</author>
	<content type="html">On Fri, Oct 10, 2008 at 08:54:31PM -0400, Jim Bates wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; My earlier post regarding the dither problem in Csound5 was started before 
&lt;br&gt;&amp;gt; I found out there is no dither currently in Csound5. While it has been 
&lt;br&gt;&amp;gt; implied that dither is not needed on a floating point system, that 
&lt;br&gt;&amp;gt; viewpoint is at odds with the following from the renowned mastering 
&lt;br&gt;&amp;gt; engineer Bob Katz:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;quot;But one programming mistake, or a few cost-saving shortcuts, can ruin 
&lt;br&gt;&amp;gt; ether fixed or floating point work, especially if shortcuts are taken at 
&lt;br&gt;&amp;gt; the most critical time, when the final output number is converted to fixed 
&lt;br&gt;&amp;gt; point 24 bit at the end. If those numbers are not converted (and properly 
&lt;br&gt;&amp;gt; dithered to 24 bits) at that time, then the sound of the entire system can 
&lt;br&gt;&amp;gt; be compromised.&amp;quot;
&lt;br&gt;&amp;gt; ...
&lt;br&gt;&amp;gt; Floating point is not the ideal medium for dithering as you don't know 
&lt;br&gt;&amp;gt; where the reference level is, it's &amp;quot;floating&amp;quot; :-). &amp;nbsp;Some people argue 
&lt;br&gt;&amp;gt; (probably correctly) that dithering makes no sense with floating point. So 
&lt;br&gt;&amp;gt; most algorithm designers convert to fixed point and then dither. &amp;nbsp;Does that 
&lt;br&gt;&amp;gt; answer your question?
&lt;/div&gt;&lt;br&gt;This is correct. There is no need to add dither inside algorithms
&lt;br&gt;(e.g. filters, mixers, etc..) that operate entirely in FP, and
&lt;br&gt;it would be difficult to do since, as Bob says, there is no
&lt;br&gt;reference level and the granularity of the output signal is not
&lt;br&gt;fixed.
&lt;br&gt;&lt;br&gt;You need dither when converting to an integer format,
&lt;br&gt;in particular anything less than say 20 bits.
&lt;br&gt;The procedure to do this when starting from floats is
&lt;br&gt;exactly the same as when you start from a higher precision
&lt;br&gt;integer format. You add noise then convert to integer.
&lt;br&gt;Except in some rather special cases, the amplitude of
&lt;br&gt;the noise depends on the 'step size' of the output format
&lt;br&gt;only - this is why the procedure is essentially the same
&lt;br&gt;for FP-&amp;gt;16bit as for 24bit-&amp;gt;16bit. &amp;nbsp;The noise added 
&lt;br&gt;should have a triangular distribution between -1 and +1
&lt;br&gt;times the output step size.
&lt;br&gt;&lt;br&gt;Ciao,
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;FA
&lt;br&gt;&lt;br&gt;Follie! Follie! Delirio vano e' questo!
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19931141&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19931141.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19931049</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-11T01:49:43Z</published>
	<updated>2008-10-11T01:49:43Z</updated>
	<author>
		<name>Richard Dobson</name>
	</author>
	<content type="html">Erik de Castro Lopo wrote:
&lt;br&gt;..
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; For 24 bit audio the audio samples range from -8388608 to 8388607
&lt;br&gt;&amp;gt; and the dither that is added (before truncation) is at most about
&lt;br&gt;&amp;gt; -2.0 to 2.0 (I've been generous here) with reference to the range
&lt;br&gt;&amp;gt; -8388608 to 8388607.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; That means that the level of the dither is
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; 20 * log10 (2 / 8388607)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; which is -132dB below the reference level. I repeat, there is no
&lt;br&gt;&amp;gt; digital-to-analogue converter on the market today that comes
&lt;br&gt;&amp;gt; anywhere near this in signal to noise ratio.
&lt;br&gt;&amp;gt; 
&lt;/div&gt;&lt;br&gt;As an example I have here, my M-Audio Firewire 410 &amp;nbsp;cites a dynamic 
&lt;br&gt;range of 108dB; i.e. the quiescent noise is significantly above what 
&lt;br&gt;would be the 24bit dither level. Top-level systems may manage 120dB, and 
&lt;br&gt;top-end mic preamps may even cite a range of 130dB - still above the 
&lt;br&gt;theoretical 24bit dither level. To improve on that would need 
&lt;br&gt;liquid-cooled circuitry &amp;nbsp;(and probably liquid-cooled ears and 
&lt;br&gt;loudspeakers too).
&lt;br&gt;&lt;br&gt;A simple answer to all this is to use f/p soundfiles ~always~, and 
&lt;br&gt;reduce to 24bit (or 16bit) only at the very end, as part of the final 
&lt;br&gt;mastering stage (or output to speakers). &amp;nbsp;Note that normalized 32bit f/p 
&lt;br&gt;actually gives you an equivalent 25bit &amp;nbsp;range &amp;nbsp;(the format provides what 
&lt;br&gt;is referred to as a &amp;quot;hidden bit&amp;quot;). &amp;nbsp;The best dithering we can reasonably 
&lt;br&gt;expect in Csound is plain TPDF (triangular); which is actually pretty 
&lt;br&gt;good. Commercial mastering tools will offer more sophisticated (and 
&lt;br&gt;mostly proprietary) noise-shaped dither. Until such time as users 
&lt;br&gt;seriously expect to send the output of perf directly to CD manufacture, 
&lt;br&gt;i.e. do all final mastering in Csound itself, &amp;nbsp;all we really need is 
&lt;br&gt;some token dither for direct audio rendering. &amp;nbsp;Windows &amp;nbsp;already adds 
&lt;br&gt;tpdf dither to audio streamed through the kernel mixer, and I think OS X 
&lt;br&gt;CoreAudio does something very similar. SO if dither is added to Csound, 
&lt;br&gt;&amp;nbsp; it must be possibel to turn it off. There is of course absolutely no 
&lt;br&gt;reason to reduce to 16bit for rendering, these days, unless you are 
&lt;br&gt;still using SoundBlasters, in which case of course the analog dynamic 
&lt;br&gt;range still comes to your rescue.
&lt;br&gt;&lt;br&gt;&lt;br&gt;In short, you may need to deliver in 24bits (or 16 bits for the 
&lt;br&gt;venerable CD etc), but &amp;nbsp;work in progress should always be kept as at 
&lt;br&gt;least 32bit f/p. &amp;nbsp;We have no excuses &amp;nbsp;with regard to file sizes these 
&lt;br&gt;days, except for high channel counts and high sample rates, and even 
&lt;br&gt;WAVE itself can support 64bit doubles (I am pretty certain libsndfile 
&lt;br&gt;supports that - Eric?).
&lt;br&gt;&lt;br&gt;People &amp;nbsp;can practise this radical worldview by setting 0dbfs=1 in all 
&lt;br&gt;their orc files, rather than the historical but otherwise pointless and 
&lt;br&gt;irrelevant 32768!
&lt;br&gt;&lt;br&gt;Richard Dobson
&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19931049&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19931049.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19929237</id>
	<title>Re: Truncation in Csound5</title>
	<published>2008-10-10T20:30:30Z</published>
	<updated>2008-10-10T20:30:30Z</updated>
	<author>
		<name>Erik de Castro Lopo-8</name>
	</author>
	<content type="html">Jim Bates wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; My earlier post regarding the dither problem in Csound5 was started &amp;nbsp;
&lt;br&gt;&amp;gt; before I found out there is no dither currently in Csound5. While it &amp;nbsp;
&lt;br&gt;&amp;gt; has been implied that dither is not needed on a floating point &amp;nbsp;
&lt;br&gt;&amp;gt; system,
&lt;br&gt;&lt;br&gt;If the audio stays in floating point that is 100% correcct.
&lt;br&gt;&lt;br&gt;The only time it *may* be worthwhile dithering is when converting from
&lt;br&gt;floating point to integer (8, 16 or 24 bit integer) formats, or when
&lt;br&gt;converting from a higher bitwidth integer to a smaller bit width integer.
&lt;br&gt;&lt;br&gt;&amp;gt; that viewpoint is at odds with the following from the &amp;nbsp;
&lt;br&gt;&amp;gt; renowned mastering engineer Bob Katz:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;quot;But one programming mistake, or a few cost-saving shortcuts, can &amp;nbsp;
&lt;br&gt;&amp;gt; ruin ether fixed or floating point work, especially if shortcuts are &amp;nbsp;
&lt;br&gt;&amp;gt; taken at the most critical time, when the final output number is &amp;nbsp;
&lt;br&gt;&amp;gt; converted to fixed point 24 bit at the end. If those numbers are not &amp;nbsp;
&lt;br&gt;&amp;gt; converted (and properly dithered to 24 bits) at that time, then the &amp;nbsp;
&lt;br&gt;&amp;gt; sound of the entire system can be compromised.&amp;quot;
&lt;br&gt;&lt;br&gt;Saying that when converting from float to 24 bit integer PCM without
&lt;br&gt;dither &amp;quot;then the sound of the entire system can be compromised.&amp;quot; is
&lt;br&gt;*vastly* overstating the case.
&lt;br&gt;&lt;br&gt;For 24 bit audio the audio samples range from -8388608 to 8388607
&lt;br&gt;and the dither that is added (before truncation) is at most about
&lt;br&gt;-2.0 to 2.0 (I've been generous here) with reference to the range
&lt;br&gt;-8388608 to 8388607.
&lt;br&gt;&lt;br&gt;That means that the level of the dither is
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; 20 * log10 (2 / 8388607)
&lt;br&gt;&lt;br&gt;which is -132dB below the reference level. I repeat, there is no
&lt;br&gt;digital-to-analogue converter on the market today that comes
&lt;br&gt;anywhere near this in signal to noise ratio.
&lt;br&gt;&lt;br&gt;Remeber what the dither is there for. Its added noise which masks
&lt;br&gt;low level artifacts that are the result of truncation. When the
&lt;br&gt;dither is at -132dB, the stuff that it is masking is below that.
&lt;br&gt;&lt;br&gt;If you look at this:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://en.wikipedia.org/wiki/Sound_pressure#Examples_of_sound_pressure_and_sound_pressure_levels&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Sound_pressure#Examples_of_sound_pressure_and_sound_pressure_levels&lt;/a&gt;&lt;br&gt;&lt;br&gt;with 0db being the threshold of hearing, 120dB is where you start
&lt;br&gt;getting hearing damager and 130dB is the threshold of pain.
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; As the contention is about dithering floating point, I e-mailed Bob &amp;nbsp;
&lt;br&gt;&amp;gt; Katz with the following question:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Do you know of any current (or past) algorithm for dithering floating &amp;nbsp;
&lt;br&gt;&amp;gt; point audio files?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Here is his reply:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Floating point is not the ideal medium for dithering as you don't &amp;nbsp;
&lt;br&gt;&amp;gt; know where the reference level is, it's &amp;quot;floating&amp;quot; :-). &amp;nbsp;Some people &amp;nbsp;
&lt;br&gt;&amp;gt; argue (probably correctly) that dithering makes no sense with &amp;nbsp;
&lt;br&gt;&amp;gt; floating point. So most algorithm designers convert to fixed point &amp;nbsp;
&lt;br&gt;&amp;gt; and then dither. &amp;nbsp;Does that answer your question?
&lt;/div&gt;&lt;br&gt;Thats a totally appropriate answer to someone who may not know
&lt;br&gt;how numbers are represented in floating point, but it is far
&lt;br&gt;from a definitive answer.
&lt;br&gt;&lt;br&gt;Erik
&lt;br&gt;-- 
&lt;br&gt;-----------------------------------------------------------------
&lt;br&gt;Erik de Castro Lopo
&lt;br&gt;-----------------------------------------------------------------
&lt;br&gt;&amp;quot;C++ is an atrocity, the bletcherous scab of the computing world,
&lt;br&gt;responsible for more buffer overflows, more security breaches,
&lt;br&gt;more blue screens of death, more mysterious failures than any
&lt;br&gt;other computer language in the history of the planet Earth.&amp;quot;
&lt;br&gt;-- Eric Lee Green
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19929237&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19929237.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19928252</id>
	<title>Truncation in Csound5</title>
	<published>2008-10-10T17:54:31Z</published>
	<updated>2008-10-10T17:54:31Z</updated>
	<author>
		<name>Jim Bates</name>
	</author>
	<content type="html">&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;p style=&quot;margin: 0.0px 0.0px 5.0px 0.0px; line-height: 14.0px&quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; style=&quot;font: 11.0px Verdana&quot;&gt;My earlier post regarding the dither problem in Csound5 was started before I found out there is no dither currently in Csound5. While it has been implied that dither is not needed on a floating point system, that viewpoint is at odds with the following from the renowned mastering engineer Bob Katz: &lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.0px 0.0px 5.0px 0.0px; line-height: 14.0px; font: 11.0px Verdana; min-height: 13.0px&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.0px 0.0px 5.0px 0.0px; line-height: 14.0px&quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; style=&quot;font: 11.0px Verdana&quot;&gt;&quot;But one programming mistake, or a few cost-saving shortcuts, can ruin ether fixed or floating point work, especially if shortcuts are taken at the most critical time, when the final output number is converted to fixed point 24 bit at the end. If those numbers are not converted (and properly dithered to 24 bits) at that time, then the sound of the entire system can be compromised.&quot;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.0px 0.0px 5.0px 0.0px; line-height: 14.0px&quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; style=&quot;font: 11.0px Verdana&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;  Bob Katz &quot;Fixed versus Floating Point Notation&quot; (an answer to a question on his Audio FAQ)&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.0px 0.0px 5.0px 0.0px; line-height: 14.0px; font: 11.0px Verdana; min-height: 13.0px&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.0px 0.0px 5.0px 0.0px; line-height: 14.0px&quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; style=&quot;font: 11.0px Verdana&quot;&gt;&quot;When feeding processors, DAWs or digital mixers to your recording unit, dither the output of the processor to a 24-bit word. Dithering always sounds better than truncation without dither.&quot;  &lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.0px 0.0px 5.0px 0.0px; line-height: 14.0px&quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; style=&quot;font: 11.0px Verdana&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space:pre&quot;&gt;	&lt;/span&gt;Bob Katz' article &quot;Dither&quot;  Full article at:  &lt;a href=&quot;http://www.digido.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;&lt;font face=&quot;Courier&quot; size=&quot;3&quot; color=&quot;#1329dc&quot; style=&quot;font: 12.0px Courier; color: #1329dc&quot;&gt;&lt;u&gt;http://www.digido.com&lt;/u&gt;&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.0px 0.0px 5.0px 0.0px; line-height: 14.0px; font: 12.0px Courier; color: #1329dc; min-height: 14.0px&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.0px 0.0px 5.0px 0.0px; line-height: 14.0px&quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; style=&quot;font: 11.0px Verdana&quot;&gt;So the real problem is more accurately a truncation problem.&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.0px 0.0px 5.0px 0.0px; line-height: 14.0px; font: 11.0px Verdana; min-height: 13.0px&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.0px 0.0px 5.0px 0.0px; line-height: 14.0px&quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; style=&quot;font: 11.0px Verdana&quot;&gt;As the contention is about dithering floating point, I e-mailed Bob Katz with the following question:&lt;/font&gt;&lt;/p&gt;&lt;p style=&quot;margin: 0.0px 0.0px 5.0px 0.0px; line-height: 14.0px; font: 11.0px Verdana; min-height: 13.0px&quot;&gt;&lt;br&gt;&lt;/p&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Lucida Grande&quot; size=&quot;3&quot; style=&quot;font: 11.0px Lucida Grande&quot;&gt;Do you know of any current (or past) algorithm for dithering floating point audio files? &lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; min-height: 13px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Lucida Grande&quot; size=&quot;3&quot; style=&quot;font: 11.0px Lucida Grande&quot;&gt;Here is his reply:&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; min-height: 13px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal 'Lucida Grande'; min-height: 13px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;Floating point is not the ideal medium for dithering as you don't know where the reference level is, it's &quot;floating&quot; :-).  Some people argue (probably correctly) that dithering makes no sense with floating point. So most algorithm designers convert to fixed point and then dither.  Does that answer your question?&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;Best wishes,&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Helvetica; min-height: 14px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;Bob&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;-- &lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Courier&quot; size=&quot;3&quot; style=&quot;font: 12.0px Courier&quot;&gt;Bob Katz 407-831-0233 DIGITAL DOMAIN | &quot;There are two kinds of fools,&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Courier&quot; size=&quot;3&quot; style=&quot;font: 12.0px Courier&quot;&gt;Recording, Mastering, Manufacturing  | One says-this is old and therefore good.&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Courier&quot; size=&quot;3&quot; style=&quot;font: 12.0px Courier&quot;&gt;Informative **CD MASTERING WEBSITE** | The other says-this is new and therefore&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Courier&quot; size=&quot;3&quot; color=&quot;#0b1de5&quot; style=&quot;font: 12.0px Courier; color: #0b1de5&quot;&gt;&lt;a href=&quot;http://www.digido.com/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;&lt;u&gt;http://www.digido.com&lt;/u&gt;&lt;/a&gt;&lt;/font&gt;&lt;font face=&quot;Courier&quot; size=&quot;3&quot; style=&quot;font: 12.0px Courier&quot;&gt;                | better.&quot;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; min-height: 14px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Courier&quot; size=&quot;3&quot; style=&quot;font: 12.0px Courier&quot;&gt;No trees were killed in the sending of this message. However a large number&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Courier&quot; size=&quot;3&quot; style=&quot;font: 12.0px Courier&quot;&gt;of electrons were terribly inconvenienced.&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; min-height: 14px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 12px/normal Courier; min-height: 14px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; style=&quot;font: 11.0px Verdana&quot;&gt;Another reference regarding that confirms this can be found here:  &lt;a href=&quot;http://www.cadenzarecording.com/images/FloatingDither.pdf&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; color=&quot;#0b1de5&quot; style=&quot;font: 12.0px Helvetica; color: #0b1de5&quot;&gt;&lt;u&gt;http://www.cadenzarecording.com/images/FloatingDither.pdf&lt;/u&gt;&lt;/font&gt;&lt;/a&gt;&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Verdana; min-height: 13px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Verdana; min-height: 13px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; style=&quot;font: 11.0px Verdana&quot;&gt;This is as clear as I know how to put it.&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Verdana; min-height: 13px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; style=&quot;font: 11.0px Verdana&quot;&gt;I would appreciate some feedback on this from those who actually develop Csound, like Anthony Kozar, Michael Goggins, Andres Cabrera, Steven Yi, Victor Lazzarini, John ffitch, etc.&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Verdana; min-height: 13px; &quot;&gt;&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; style=&quot;font: 11.0px Verdana&quot;&gt;All the Best,&lt;/font&gt;&lt;/div&gt;&lt;div style=&quot;margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; &quot;&gt;&lt;font face=&quot;Verdana&quot; size=&quot;3&quot; style=&quot;font: 11.0px Verdana&quot;&gt;Jim Bates&lt;/font&gt;&lt;/div&gt;&lt;div&gt;&lt;font class=&quot;Apple-style-span&quot; face=&quot;Verdana&quot; size=&quot;3&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: 11px;&quot;&gt;&lt;br&gt;&lt;/span&gt;&lt;/font&gt;&lt;/div&gt;
&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19928252&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Truncation-in-Csound5-tp19928252p19928252.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19909975</id>
	<title>Re: Messages to callback in C API and C++ API</title>
	<published>2008-10-09T17:37:53Z</published>
	<updated>2008-10-09T17:37:53Z</updated>
	<author>
		<name>Andres Cabrera</name>
	</author>
	<content type="html">Sorry, silly mistake, I put the setMessageCallback after the call to compile...
&lt;br&gt;Everything's OK.
&lt;br&gt;&lt;br&gt;Cheers,
&lt;br&gt;Andrés
&lt;br&gt;&lt;br&gt;On Tue, Oct 7, 2008 at 9:54 AM, Andres Cabrera &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19909975&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mantaraya36@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Hi all,
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; I've noticed the behavior of csound messages sent to the callback is
&lt;br&gt;&amp;gt; different in the C and C++ APIs. Using the C++ API, all messages are
&lt;br&gt;&amp;gt; sent to the callback, but I've just changed to using the standard C
&lt;br&gt;&amp;gt; API and only some of the messages are routed to the message callback
&lt;br&gt;&amp;gt; function. Messages like the csound version and error messages are sent
&lt;br&gt;&amp;gt; to stderr. What can I do to make the C API send all messages to the
&lt;br&gt;&amp;gt; callback function?
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Cheers,
&lt;br&gt;&amp;gt; Andrés
&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;&lt;br&gt;&lt;br&gt;Andrés
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19909975&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Messages-to-callback-in-C-API-and-C%2B%2B-API-tp19860274p19909975.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19900190</id>
	<title>Glitch-free csound</title>
	<published>2008-10-09T07:30:04Z</published>
	<updated>2008-10-09T07:30:04Z</updated>
	<author>
		<name>jpff</name>
	</author>
	<content type="html">I have a version of Csound5 that does Russell's example without
&lt;br&gt;glitches. &amp;nbsp;I have changed things to count in samples rather than in
&lt;br&gt;seconds, and so keeps things in integers. &amp;nbsp;It does not fix the same
&lt;br&gt;problems in beatmode and I probably need to check to see what else it
&lt;br&gt;breaks.
&lt;br&gt;&amp;nbsp;
&lt;br&gt;May also be a little slower, but that could be minor and even
&lt;br&gt;optimised out.
&lt;br&gt;&lt;br&gt;Back to testing
&lt;br&gt;&lt;br&gt;==John ffitch
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19900190&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Glitch-free-csound-tp19900190p19900190.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19889072</id>
	<title>Re: Dither Problem in Csound5</title>
	<published>2008-10-08T15:39:03Z</published>
	<updated>2008-10-08T15:39:03Z</updated>
	<author>
		<name>Jim Bates</name>
	</author>
	<content type="html">A very good reference on dithering issues and the differences in &amp;nbsp;
&lt;br&gt;dithering for ints and floats can be found here:
&lt;br&gt;&lt;br&gt;&lt;a href=&quot;http://www.cadenzarecording.com/images/FloatingDither.pdf&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://www.cadenzarecording.com/images/FloatingDither.pdf&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;All the Best,
&lt;br&gt;Jim Bates
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19889072&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Dither-Problem-in-Csound5-tp19842306p19889072.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19887962</id>
	<title>Re: Csound-devel Digest, Vol 30, Issue 13</title>
	<published>2008-10-08T14:23:17Z</published>
	<updated>2008-10-08T14:23:17Z</updated>
	<author>
		<name>Fons Adriaensen-2</name>
	</author>
	<content type="html">On Wed, Oct 08, 2008 at 05:10:40PM -0400, Jim Bates wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; Let me rephrase my other point on the matter, which is this:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; After Csound has run its numbers in doubles, it is downsampled to float.
&lt;br&gt;&lt;br&gt;As Eric has already pointed out, this is not 'downsampling'.
&lt;br&gt;It's conversion (in this case) or (re)quantisation if you
&lt;br&gt;convert to int or fixed point.
&lt;br&gt;&lt;br&gt;&amp;gt; BUT, since Csound's output is floating point, trying to
&lt;br&gt;&amp;gt; dither it while downsampling to 24-Bit or 16-Bit DOESN'T
&lt;br&gt;&amp;gt; work, even if the dither function IS working. &amp;nbsp;
&lt;br&gt;&lt;br&gt;That means you implemented it wrong. It *does* work.
&lt;br&gt;There should be no problem at all with the original
&lt;br&gt;being float or double rather than int. The basic 
&lt;br&gt;approach is to add noise, then convert to lower
&lt;br&gt;precision.
&lt;br&gt;&lt;br&gt;&amp;gt; I know--
&lt;br&gt;&amp;gt; --I've tried it with POWr3 dither and other dithers using
&lt;br&gt;&amp;gt; an external application.
&lt;br&gt;&lt;br&gt;You, or the external application, must have done something
&lt;br&gt;wrong.
&lt;br&gt;&lt;br&gt;Ciao,
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;FA
&lt;br&gt;&lt;br&gt;Follie! Follie! Delirio vano e' questo!
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19887962&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Re%3A-Csound-devel-Digest%2C-Vol-30%2C-Issue-13-tp19887759p19887962.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19887759</id>
	<title>Re: Csound-devel Digest, Vol 30, Issue 13</title>
	<published>2008-10-08T14:10:40Z</published>
	<updated>2008-10-08T14:10:40Z</updated>
	<author>
		<name>Jim Bates</name>
	</author>
	<content type="html">&lt;html&gt;&lt;body style=&quot;word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; &quot;&gt;&lt;div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;blockquote type=&quot;cite&quot;&gt;&lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px&quot;&gt;&lt;br&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;Sorry Jim, but none of that makes any sense whatsoever.&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px&quot;&gt;&lt;br&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;Downsampling is the process of converting from a higher sampling&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;rate to a lower sampling rate and has nothing to do with the way&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;the individual samples are represented (int, float double etc).&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px&quot;&gt;&lt;br&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;What you are talking about it changing the bit width (and hence&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;precision) of the samples which is correctly called re-quantization.&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px&quot;&gt;&lt;br&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;Dither is added when re-quantizing samples from a higher bit&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;width to a lower bit width. Its purpose is to hide audilble&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;correlated artifacts arising from the bit width reduction.&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px&quot;&gt;&lt;br&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;When those correlated artifacts are not audible, there is no&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;reason to add dither. For instance when converting floating&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;point data to 24 bit PCM (and using the full 24 bits) there&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;is no point in adding dither because the dynamic range of&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;24 bit audio is about 144dB and any correlated artifacts would&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;be 144dB below the loudest part and hence quieter than the&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;best playback system money can by (I think the best available&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;D-A converters have a signal to noise ratio of about 125dB).&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px&quot;&gt;&lt;br&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;Since floats have more than 24 bits of dynamic range, there&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;is no good reason to add dither when converting from double&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;to float.&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px&quot;&gt;&lt;br&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;For more on dither, see the wikipedia article:&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px&quot;&gt;&lt;br&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;&lt;span class=&quot;Apple-converted-space&quot;&gt;    &lt;/span&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Dither&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Dither&lt;/a&gt;&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px&quot;&gt;&lt;br&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;Erik&lt;/font&gt;&lt;/p&gt; &lt;p style=&quot;margin: 0.0px 0.0px 0.0px 0.0px&quot;&gt;&lt;font face=&quot;Helvetica&quot; size=&quot;3&quot; style=&quot;font: 12.0px Helvetica&quot;&gt;--&lt;span class=&quot;Apple-converted-space&quot;&gt; &lt;/span&gt;&lt;/font&gt;&lt;/p&gt; &lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;div&gt;I got it Erik. Thank you for your response --regarding the internal downsampling &lt;/div&gt;&lt;div&gt;of doubles to floats---your point on the matter is valid and well taken.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Let me rephrase my other point on the matter, which is this:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;After Csound has run its numbers in doubles, it is downsampled to float.&lt;/div&gt;&lt;div&gt;BUT, since Csound's output is floating point, trying to dither it while downsampling &lt;/div&gt;&lt;div&gt;to 24-Bit or 16-Bit DOESN'T work, even if the dither function IS working.  I know-- &lt;/div&gt;&lt;div&gt;--I've tried it with POWr3 dither and other dithers using an external application.  &lt;/div&gt;&lt;div&gt;No effect whatsoever.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;That's the reason I was looking at re-quantization to a format that COULD be&lt;/div&gt;&lt;div&gt;effectively dithered with existing dithering algorithms. &lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Perhaps there is a better way of solving it. &lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;But I don't see it as trivial issue.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;All the Best,&lt;/div&gt;&lt;div&gt;JIm Bates&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;&lt;br /&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br /&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19887759&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Re%3A-Csound-devel-Digest%2C-Vol-30%2C-Issue-13-tp19887759p19887759.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19887136</id>
	<title>Re: Dither Problem in Csound5</title>
	<published>2008-10-08T13:33:10Z</published>
	<updated>2008-10-08T13:33:10Z</updated>
	<author>
		<name>Fons Adriaensen-2</name>
	</author>
	<content type="html">On Thu, Oct 09, 2008 at 06:50:34AM +1100, Erik de Castro Lopo wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; When those correlated artifacts are not audible, there is no
&lt;br&gt;&amp;gt; reason to add dither. For instance when converting floating
&lt;br&gt;&amp;gt; point data to 24 bit PCM (and using the full 24 bits) there
&lt;br&gt;&amp;gt; is no point in adding dither because the dynamic range of
&lt;br&gt;&amp;gt; 24 bit audio is about 144dB and any correlated artifacts would
&lt;br&gt;&amp;gt; be 144dB below the loudest part and hence quieter than the
&lt;br&gt;&amp;gt; best playback system money can by (I think the best available
&lt;br&gt;&amp;gt; D-A converters have a signal to noise ratio of about 125dB).
&lt;br&gt;&lt;br&gt;I'd say that's 99.9% correct.
&lt;br&gt;&lt;br&gt;When you convert to 24 bit, either for a DA convertor
&lt;br&gt;or for writing a file, and your signal contains anything
&lt;br&gt;that was recorded from an analog source, then it very
&lt;br&gt;probably has already enough noise in it to make any
&lt;br&gt;dithering pointless.
&lt;br&gt;&lt;br&gt;For synthesised signals this could be different. In
&lt;br&gt;the case of a DA converter, any correlated artifacts
&lt;br&gt;will be masked by the analog noise, but they are still
&lt;br&gt;there - you *can* measure them. Same for a file, where
&lt;br&gt;they are not even masked because there is no analog
&lt;br&gt;noise. 
&lt;br&gt;&lt;br&gt;To *remove* rather than mask them, you have to add
&lt;br&gt;noise *before* the quantisation. If you have 24 bits
&lt;br&gt;anyway, this noise can be so low that you will never
&lt;br&gt;hear it - but it has to be added if your signal is
&lt;br&gt;otherwise noise-free.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Ciao,
&lt;br&gt;&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;FA
&lt;br&gt;&lt;br&gt;Follie! Follie! Delirio vano e' questo!
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19887136&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Dither-Problem-in-Csound5-tp19842306p19887136.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19886348</id>
	<title>Re: Dither Problem in Csound5</title>
	<published>2008-10-08T12:55:18Z</published>
	<updated>2008-10-08T12:55:18Z</updated>
	<author>
		<name>Steven Yi</name>
	</author>
	<content type="html">(Okay, I'll just note that I'm glad Erik and Fons and everyone else is
&lt;br&gt;here on this list! =) )
&lt;br&gt;&lt;br&gt;On Wed, Oct 8, 2008 at 12:50 PM, Erik de Castro Lopo
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19886348&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;mle+la@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Jim Bates wrote:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;&amp;gt; As far as I know there is (currently) no workable algorithm for
&lt;br&gt;&amp;gt;&amp;gt; floating point dither; and dither designed for ints
&lt;br&gt;&amp;gt;&amp;gt; does not work on floats. &amp;nbsp;So one way for handling this would be
&lt;br&gt;&amp;gt;&amp;gt; converting the 64-Bit doubles to 80-Bit ints
&lt;br&gt;&amp;gt;&amp;gt; and dithering the result, using a conventional rectangular dither,
&lt;br&gt;&amp;gt;&amp;gt; prior to downsampling to 40-Bit int, which can
&lt;br&gt;&amp;gt;&amp;gt; then be converted to 32-Bit float, or to a lower Bit-depth.
&lt;br&gt;&amp;gt;&amp;gt; That would be the first step in handling the internal (doubles to
&lt;br&gt;&amp;gt;&amp;gt; floats) dither problem. &amp;nbsp;It would also give
&lt;br&gt;&amp;gt;&amp;gt; a 40 bit int that could be easily downsampled and dithered to 32, 24
&lt;br&gt;&amp;gt;&amp;gt; or 16 Bits. &amp;nbsp;32-Bit floats don't dither any
&lt;br&gt;&amp;gt;&amp;gt; better than 64-Bit doubles do.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Sorry Jim, but none of that makes any sense whatsoever.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Downsampling is the process of converting from a higher sampling
&lt;br&gt;&amp;gt; rate to a lower sampling rate and has nothing to do with the way
&lt;br&gt;&amp;gt; the individual samples are represented (int, float double etc).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; What you are talking about it changing the bit width (and hence
&lt;br&gt;&amp;gt; precision) of the samples which is correctly called re-quantization.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Dither is added when re-quantizing samples from a higher bit
&lt;br&gt;&amp;gt; width to a lower bit width. Its purpose is to hide audilble
&lt;br&gt;&amp;gt; correlated artifacts arising from the bit width reduction.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; When those correlated artifacts are not audible, there is no
&lt;br&gt;&amp;gt; reason to add dither. For instance when converting floating
&lt;br&gt;&amp;gt; point data to 24 bit PCM (and using the full 24 bits) there
&lt;br&gt;&amp;gt; is no point in adding dither because the dynamic range of
&lt;br&gt;&amp;gt; 24 bit audio is about 144dB and any correlated artifacts would
&lt;br&gt;&amp;gt; be 144dB below the loudest part and hence quieter than the
&lt;br&gt;&amp;gt; best playback system money can by (I think the best available
&lt;br&gt;&amp;gt; D-A converters have a signal to noise ratio of about 125dB).
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Since floats have more than 24 bits of dynamic range, there
&lt;br&gt;&amp;gt; is no good reason to add dither when converting from double
&lt;br&gt;&amp;gt; to float.
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; For more on dither, see the wikipedia article:
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://en.wikipedia.org/wiki/Dither&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Dither&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Erik
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; -----------------------------------------------------------------
&lt;br&gt;&amp;gt; Erik de Castro Lopo
&lt;br&gt;&amp;gt; -----------------------------------------------------------------
&lt;br&gt;&amp;gt; &amp;quot;Well behaved women rarely make history.&amp;quot; -- Dorothy Parker
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; -------------------------------------------------------------------------
&lt;br&gt;&amp;gt; This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;&amp;gt; Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;&amp;gt; Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;&amp;gt; _______________________________________________
&lt;br&gt;&amp;gt; Csound-devel mailing list
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19886348&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&amp;gt; &lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;&amp;gt;
&lt;/div&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19886348&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Dither-Problem-in-Csound5-tp19842306p19886348.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19886264</id>
	<title>Re: Dither Problem in Csound5</title>
	<published>2008-10-08T12:50:34Z</published>
	<updated>2008-10-08T12:50:34Z</updated>
	<author>
		<name>Erik de Castro Lopo-10</name>
	</author>
	<content type="html">Jim Bates wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; As far as I know there is (currently) no workable algorithm for &amp;nbsp;
&lt;br&gt;&amp;gt; floating point dither; and dither designed for ints
&lt;br&gt;&amp;gt; does not work on floats. &amp;nbsp;So one way for handling this would be &amp;nbsp;
&lt;br&gt;&amp;gt; converting the 64-Bit doubles to 80-Bit ints
&lt;br&gt;&amp;gt; and dithering the result, using a conventional rectangular dither, &amp;nbsp;
&lt;br&gt;&amp;gt; prior to downsampling to 40-Bit int, which can
&lt;br&gt;&amp;gt; then be converted to 32-Bit float, or to a lower Bit-depth.
&lt;br&gt;&amp;gt; That would be the first step in handling the internal (doubles to &amp;nbsp;
&lt;br&gt;&amp;gt; floats) dither problem. &amp;nbsp;It would also give
&lt;br&gt;&amp;gt; a 40 bit int that could be easily downsampled and dithered to 32, 24 &amp;nbsp;
&lt;br&gt;&amp;gt; or 16 Bits. &amp;nbsp;32-Bit floats don't dither any
&lt;br&gt;&amp;gt; better than 64-Bit doubles do.
&lt;/div&gt;&lt;br&gt;Sorry Jim, but none of that makes any sense whatsoever.
&lt;br&gt;&lt;br&gt;Downsampling is the process of converting from a higher sampling
&lt;br&gt;rate to a lower sampling rate and has nothing to do with the way
&lt;br&gt;the individual samples are represented (int, float double etc).
&lt;br&gt;&lt;br&gt;What you are talking about it changing the bit width (and hence
&lt;br&gt;precision) of the samples which is correctly called re-quantization.
&lt;br&gt;&lt;br&gt;Dither is added when re-quantizing samples from a higher bit
&lt;br&gt;width to a lower bit width. Its purpose is to hide audilble
&lt;br&gt;correlated artifacts arising from the bit width reduction.
&lt;br&gt;&lt;br&gt;When those correlated artifacts are not audible, there is no
&lt;br&gt;reason to add dither. For instance when converting floating
&lt;br&gt;point data to 24 bit PCM (and using the full 24 bits) there
&lt;br&gt;is no point in adding dither because the dynamic range of
&lt;br&gt;24 bit audio is about 144dB and any correlated artifacts would
&lt;br&gt;be 144dB below the loudest part and hence quieter than the
&lt;br&gt;best playback system money can by (I think the best available
&lt;br&gt;D-A converters have a signal to noise ratio of about 125dB).
&lt;br&gt;&lt;br&gt;Since floats have more than 24 bits of dynamic range, there
&lt;br&gt;is no good reason to add dither when converting from double
&lt;br&gt;to float.
&lt;br&gt;&lt;br&gt;For more on dither, see the wikipedia article:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://en.wikipedia.org/wiki/Dither&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://en.wikipedia.org/wiki/Dither&lt;/a&gt;&lt;br&gt;&lt;br&gt;Erik
&lt;br&gt;-- 
&lt;br&gt;-----------------------------------------------------------------
&lt;br&gt;Erik de Castro Lopo
&lt;br&gt;-----------------------------------------------------------------
&lt;br&gt;&amp;quot;Well behaved women rarely make history.&amp;quot; -- Dorothy Parker
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19886264&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Dither-Problem-in-Csound5-tp19842306p19886264.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19885743</id>
	<title>OSC problem</title>
	<published>2008-10-08T12:23:20Z</published>
	<updated>2008-10-08T12:23:20Z</updated>
	<author>
		<name>Jean-Pierre Lemoine-2</name>
	</author>
	<content type="html">Helllo all,
&lt;br&gt;&lt;br&gt;Ar you looking at this problem with OSC?
&lt;br&gt;Thanks
&lt;br&gt;jp
&lt;br&gt;&lt;br&gt;&lt;br&gt;Looking at the OSC code, OSCinit does not have a deinit callback
&lt;br&gt;(but OSClisten does). I never programmed liblo, but I expect
&lt;br&gt;lo_server_thread_stop() needs to be called to free the port. I
&lt;br&gt;don't think it is called.
&lt;br&gt;&lt;br&gt;John's your expert here, he should be able to answer this one.
&lt;br&gt;&lt;br&gt;Victor
&lt;br&gt;&lt;br&gt;----- Original Message ----- From: &amp;quot;victor&amp;quot; &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19885743&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Victor.Lazzarini@...&lt;/a&gt;&amp;gt;
&lt;br&gt;To: &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19885743&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;csound@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Sent: Tuesday, October 07, 2008 9:50 PM
&lt;br&gt;Subject: [Csnd] Re: use of OSC with csound API
&lt;br&gt;&lt;br&gt;&lt;br&gt;Looks like the opcode requires a deinit callback (a destructor), which
&lt;br&gt;it doesn't have, to free the port. Or does it? Perhaps we should discuss 
&lt;br&gt;this in the
&lt;br&gt;developer's list.
&lt;br&gt;&lt;br&gt;Victor
&lt;br&gt;----- Original Message ----- From: &amp;quot;jean-pierre lemoine&amp;quot; 
&lt;br&gt;&amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19885743&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;lemoine.jp@...&lt;/a&gt;&amp;gt;
&lt;br&gt;To: &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19885743&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;csound@...&lt;/a&gt;&amp;gt;
&lt;br&gt;Sent: Tuesday, October 07, 2008 8:11 PM
&lt;br&gt;Subject: [Csnd] use of OSC with csound API
&lt;br&gt;&lt;br&gt;&lt;br&gt;I am implemented OSC support in AVSynthesis. &amp;nbsp;but I have a problem
&lt;br&gt;with reusing the csound instance (windows platform, csound double)
&lt;br&gt;&lt;br&gt;I start a thread which executes in its loop
&lt;br&gt;&amp;nbsp;cs.Perform();
&lt;br&gt;&amp;nbsp;cs.Cleanup();
&lt;br&gt;&amp;nbsp;cs.Reset();
&lt;br&gt;&lt;br&gt;When I stop the csound execution from the main thread, csound stops,
&lt;br&gt;and the cleanup , reset are done.
&lt;br&gt;If I launch a new thread with the same csound instance, i get the
&lt;br&gt;following error message and a trap
&lt;br&gt;OSC server error 9904 in path (null): cannot find free port
&lt;br&gt;&lt;br&gt;The trap
&lt;br&gt;#
&lt;br&gt;# An unexpected error has been detected by Java Runtime Environment:
&lt;br&gt;#
&lt;br&gt;# &amp;nbsp;EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x2fc75321, pid=2444, 
&lt;br&gt;tid=3524
&lt;br&gt;#
&lt;br&gt;# Java VM: Java HotSpot(TM) Client VM (10.0-b19 mixed mode, sharing 
&lt;br&gt;windows-x86)
&lt;br&gt;# Problematic frame:
&lt;br&gt;# C &amp;nbsp;[lo.dll+0x5321]
&lt;br&gt;#
&lt;br&gt;&lt;br&gt;It seems that the OSC resources are not released during cleanup and
&lt;br&gt;reset. Do I need to do something specific?
&lt;br&gt;&lt;br&gt;In the csd I have
&lt;br&gt;giOSChandle OSCinit 7770
&lt;br&gt;&lt;br&gt;and
&lt;br&gt;&lt;br&gt;instr 1
&lt;br&gt;kreadOSC init 0
&lt;br&gt;kosc OSClisten giOSChandle, &amp;quot;/AVS/layer1&amp;quot;, &amp;quot;f&amp;quot;, kreadOSC
&lt;br&gt;if (kosc == 0) goto exl1
&lt;br&gt;gkchLayer1 = kreadOSC
&lt;br&gt;printk .1, gkchLayer1
&lt;br&gt;exl1:
&lt;br&gt;kosc OSClisten giOSChandle, &amp;quot;/AVS/layer2&amp;quot;, &amp;quot;f&amp;quot;, kreadOSC
&lt;br&gt;if (kosc == 0) goto exl2
&lt;br&gt;gkchLayer2 = kreadOSC
&lt;br&gt;exl2:
&lt;br&gt;kosc OSClisten giOSChandle, &amp;quot;/AVS/layer3&amp;quot;, &amp;quot;f&amp;quot;, kreadOSC
&lt;br&gt;if (kosc == 0) goto exl3
&lt;br&gt;gkchLayer3 = kreadOSC
&lt;br&gt;exl3:
&lt;br&gt;kosc OSClisten giOSChandle, &amp;quot;/AVS/layer4&amp;quot;, &amp;quot;f&amp;quot;, kreadOSC
&lt;br&gt;if (kosc == 0) goto exl4
&lt;br&gt;gkchLayer4 = kreadOSC
&lt;br&gt;exl4:
&lt;br&gt;kosc OSClisten giOSChandle, &amp;quot;/AVS/layer5&amp;quot;, &amp;quot;f&amp;quot;, kreadOSC
&lt;br&gt;if (kosc == 0) goto exl5
&lt;br&gt;gkchLayer5 = kreadOSC
&lt;br&gt;exl5:
&lt;br&gt;kosc OSClisten giOSChandle, &amp;quot;/AVS/layer6&amp;quot;, &amp;quot;f&amp;quot;, kreadOSC
&lt;br&gt;if (kosc == 0) goto exl6
&lt;br&gt;gkchLayer6 = kreadOSC
&lt;br&gt;exl6:
&lt;br&gt;kosc OSClisten giOSChandle, &amp;quot;/AVS/layer7&amp;quot;, &amp;quot;f&amp;quot;, kreadOSC
&lt;br&gt;if (kosc == 0) goto exl7
&lt;br&gt;gkchLayer7 = kreadOSC
&lt;br&gt;exl7:
&lt;br&gt;kosc OSClisten giOSChandle, &amp;quot;/AVS/layer8&amp;quot;, &amp;quot;f&amp;quot;, kreadOSC
&lt;br&gt;if (kosc == 0) goto exl8
&lt;br&gt;gkchLayer8 = kreadOSC
&lt;br&gt;exl8:
&lt;br&gt;endin
&lt;br&gt;&lt;br&gt;Thanks for any help
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19885743&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/OSC-problem-tp19885743p19885743.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19885074</id>
	<title>Re: Dither Problem in Csound5</title>
	<published>2008-10-08T11:27:30Z</published>
	<updated>2008-10-08T11:27:30Z</updated>
	<author>
		<name>Fons Adriaensen-2</name>
	</author>
	<content type="html">On Wed, Oct 08, 2008 at 01:08:04PM -0400, Jim Bates wrote:
&lt;br&gt;&lt;br&gt;&amp;gt; As far as I know there is (currently) no workable algorithm for floating 
&lt;br&gt;&amp;gt; point dither;
&lt;br&gt;&lt;br&gt;There may well be a good reason for that -
&lt;br&gt;AFAICS, it doesn't make any sense to do it.
&lt;br&gt;&lt;br&gt;Single precision floating is at least as good
&lt;br&gt;as 24 bit linear, and the quantisation noise
&lt;br&gt;for 24 bits is so low that you can forget about
&lt;br&gt;it. If your concern is systematic errors that
&lt;br&gt;can occur on simple periodic signals, just add
&lt;br&gt;noise at -130dB below the nominal signal level
&lt;br&gt;or so, and the errors will be randomised (turned
&lt;br&gt;into noise which is still so low you will never
&lt;br&gt;hear it).
&lt;br&gt;&lt;br&gt;&amp;gt; one way for handling this would be converting 
&lt;br&gt;&amp;gt; the 64-Bit doubles to 80-Bit ints and dithering
&lt;br&gt;&amp;gt; the result, using a conventional rectangular
&lt;br&gt;&amp;gt; dither, prior to downsampling to 40-Bit int,
&lt;br&gt;&amp;gt; which can then be converted to 32-Bit float,
&lt;br&gt;&lt;br&gt;This would be a complete waste of time, first
&lt;br&gt;for the reason mentioned above, and second
&lt;br&gt;because this procedure doesn't do what you
&lt;br&gt;think it does.
&lt;br&gt;&lt;br&gt;Ciao,
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;FA
&lt;br&gt;&lt;br&gt;Follie! Follie! Delirio vano e' questo!
&lt;br&gt;&lt;br&gt;-------------------------------------------------------------------------
&lt;br&gt;This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
&lt;br&gt;Build the coolest Linux based applications with Moblin SDK &amp; win great prizes
&lt;br&gt;Grand prize is a trip for two to an Open Source event anywhere in the world
&lt;br&gt;&lt;a href=&quot;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://moblin-contest.org/redirect.php?banner_id=100&amp;url=/&lt;/a&gt;&lt;br&gt;_______________________________________________
&lt;br&gt;Csound-devel mailing list
&lt;br&gt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19885074&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;Csound-devel@...&lt;/a&gt;
&lt;br&gt;&lt;a href=&quot;https://lists.sourceforge.net/lists/listinfo/csound-devel&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;https://lists.sourceforge.net/lists/listinfo/csound-devel&lt;/a&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://www.nabble.com/Dither-Problem-in-Csound5-tp19842306p19885074.html" />
</entry>

<entry>
	<id>tag:www.nabble.com,2006:post-19883571</id>
	<title>Re: Dither Problem in Csound5</title>
	<published>2008-10-08T10:26:34Z</published>
	<updated>2008-10-08T10:26:34Z</updated>
	<author>
		<name>Steven Yi</name>
	</author>
	<content type="html">Wow, just to say, I'm glad you're here to talk about all this Jim as I
&lt;br&gt;don't have a clue. :P
&lt;br&gt;&lt;br&gt;One thing I was curious about though, we did look at some dithering in
&lt;br&gt;Audacity and it is an open source project, so maybe we should take a
&lt;br&gt;look at their source code?
&lt;br&gt;&lt;br&gt;steven
&lt;br&gt;&lt;br&gt;On Wed, Oct 8, 2008 at 10:08 AM, Jim Bates &amp;lt;&lt;a href=&quot;http://www.nabble.com/user/SendEmail.jtp?type=post&amp;post=19883571&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jabates@...&lt;/a&gt;&amp;gt; wrote:
&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Errr, but John, libsndfile does not (yet) do dithering :-).
&lt;br&gt;&amp;gt; Erik
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; -----------------------------------------------------------------
&lt;br&gt;&amp;gt; Erik de Castro Lopo
&lt;br&gt;&amp;gt;
&lt;br&gt;&amp;gt; Well that makes some sense.
&lt;br&gt;&amp;gt; As far as I know there is (currently) no workable algorithm for floating
&lt;br&gt;&amp;gt; point dither; and dither designed for ints
&lt;br&gt;&amp;gt; does not work on floats. &amp;nbsp;So one way for handling this would be converting
&lt;br&gt;&amp;gt; the 64-Bit doubles to 80-Bit ints
&lt;br&gt;&amp;gt; and dithering the result, using a conventional rectangular dither, prior to
&lt;br&gt;&amp;gt; downsampling to 40-Bit int, which can
&lt;br&gt;&amp;gt; then be converted to 32-Bit float, or to a lower Bit-depth.
&lt;br&gt;&amp;gt; That would be the first step in handling the internal (doubles to floats)
&lt;br&gt;&amp;gt; dither problem. &amp;nbsp;It would also give
&lt;br&gt;&amp;gt; a 40 bit int that could be easily downsampled and dithered to 32, 24 or 16
&lt;br&gt;&amp;gt; Bits. &amp;nbsp;32-Bit floats don't dither any
&lt;br&gt;&amp;gt; better than 64-Bit doubles do.
&lt;br&gt;&amp;gt; So... a couple of questions, regarding implementing this, using libsndfile:
&lt;br&gt;&amp;gt; 1.) Can libsndfile read doubles and convert to 80-Bit ints, whether .W64 or
&lt;br&gt;&amp;gt; WAV or AIFF-C Extended formats?
&lt;br&gt;&amp;gt; 2.) Can libsndfile conve