<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><br></div><div>Hey Katya,</div><div><br></div><div>I'm very happy you're working on this, I think its a big and very valuable step for Pd for many reasons. &nbsp;For me, things like accessing large arrays and also working with UNIX timestamps and other large integers directly, make Pd a lot easier in cases that touch on those limitations. &nbsp; It brings Pd 99% to the goal of having a generic "number" type that handles all the floats and ints that are used with any frequency.</div><div><br></div><div>Sounds like you've done a fair amount of testing. &nbsp;I think the big question that needs to be answered before this gets included is: can this be done without majoring impacting 32-bit operation? &nbsp;It sounds like you've covered that already. &nbsp;As for 64-bit floats to output, a quick hack to get things working is to just hammer samples down to 32-bits...</div><div><br></div><div>.hc</div><br><div><div>On Jul 27, 2011, at 3:39 AM, katja wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Hello,</div><div><br></div><div>Triggered by a recent thread (<a href="http://lists.puredata.info/pipermail/pd-dev/2011-07/017022.html">http://lists.puredata.info/pipermail/pd-dev/2011-07/017022.html</a>) I've written alternative code for Pd classes like phasor~, osc~, and vcf~, in preparation for double precision builds of Pd. These classes currently employ Hoeldrich's method, a fascinating type punning trick for optimization of phase-wrapping jobs. Considering available data types in C, this method can not be translated to double precision input/output format.&nbsp;</div> <div><br></div><div>Phasor~ and osc~ are typically used by the dozens in Pd setups, and even a modest performance loss could be a show stopper for setups which are on the limit of acceptable CPU load. Fortunately it was possible to define double-ready versions without performance loss, by tedious elimination of redundancy instead of fancy bit hacking. How often must a phase be wrapped? Even at high frequencies like half the Nyquist rate, only one in four iterations goes out of bounds. On average it proves efficient to do the phase wrapping conditionally. Phasor~ profits most, being up to three times faster than before, at moderate frequencies. The others did not speed up so much, but at least none of them is slower than the original version, when both are compared within the same Pd build. Also, the alternative versions do not suffer from phase drift, like the Hoeldrich versions do. I have tested this on OSX / IntelMac for single and double precision builds. Performance may be different on other platforms / architectures. Macro PD_BIGORSMALL was redefined to work with arbitrary precision.</div> <div><br></div><div>A Pd running with PD_FLOATTYPE double immediately shouted at me that there's a lot more work to do. The audio API (PortAudio in this case) couldn't handle 64 bit output samples from dac~. Vectors are apparently read as type float, and maximum level digital noise is the useless output. I've not delved into this yet. Internally things seems to work well, for what I've seen so far.&nbsp;</div> <div><br></div><div>Ah, almost forgot to mention the pro's of a double precision Pd, if it will ever work:</div><div><br></div><div>- indexing of large audio buffers with ample resolution for interpolation</div><div>- accurate sine and sinc of small angles, useful for things like fractional delay</div> <div>- FFT with frames larger than 2^17, I hope</div><div>- long sine sweeps without artifacts</div><div>- probably many more of such meticulous dsp jobs, you name them</div><div><br></div><div>If you're interested in double precision Pd, please find the attached pd_doubletest.zip with C code and test-patches. Let me know if you have test results on different platforms, or if you find stupid bugs in my code. Is anyone working on other aspects of double precision Pd? I'd like to join forces. &nbsp;</div> <div><br></div><div>Katja Vetter</div> <span>&lt;pd_doubletest.zip&gt;</span>_______________________________________________<br>Pd-dev mailing list<br><a href="mailto:Pd-dev@iem.at">Pd-dev@iem.at</a><br><a href="http://lists.puredata.info/listinfo/pd-dev">http://lists.puredata.info/listinfo/pd-dev</a><br></blockquote></div><br><div> <span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><div style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; border-spacing: 0px 0px; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 12px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; text-align: auto; -khtml-text-decorations-in-effect: none; text-indent: 0px; -apple-text-size-adjust: auto; text-transform: none; orphans: 2; white-space: normal; widows: 2; word-spacing: 0px; "><br class="Apple-interchange-newline"></span><div><br class="khtml-block-placeholder"></div><div><br class="khtml-block-placeholder"></div><div><br class="khtml-block-placeholder"></div><div><br class="khtml-block-placeholder"></div><div><br></div><div>----------------------------------------------------------------------------<br></div><div><br class="khtml-block-placeholder"></div><div>"It is convenient to imagine a power beyond us because that means we don't have to examine our own lives.", from "The Idols of Environmentalism", by Curtis White</div><div><br class="khtml-block-placeholder"></div><div><br class="khtml-block-placeholder"></div></div><br class="Apple-interchange-newline"></span> </div><br></body></html>