[PD-dev] Was: Re: algo for sequencing merges

Claude Heiland-Allen claude at mathr.co.uk
Sun Dec 22 01:10:47 CET 2019


Hi,

On 19/12/2019 20:01, IOhannes m zmölnig wrote:
> the high-performance phase-wrapping algorithm
For reference: 
https://github.com/pure-data/pure-data/blob/e3a78da5b7d825bf8b9f5d313e4ea55e5e32e8f1/src/d_osc.c#L91-L97 
(current master at time of writing)

Using a [phasor~] with x -= floor(x); for wrapping is about twice as 
slow as the built-in tabfudge version, provided I compile with 
-march=native on my AMD Ryzen 7 2700X Eight-Core Processor.  When 
compiled with pd-lib-builder's default -march=core2, the floor version 
is over five times slower.  I can run tests on other hardware in early 
January if more data points are desired.

Benchmark methodology: time how long running 1000 copies of [phasor~ 
440] takes in pd -batch, with a timeout.pd that quits pd after 1 minute 
of logical time.  The tabfudge version finishes in 3 seconds.  I used 
the /usr/bin/pd in 0.49.0-3 (Debian Buster).

I suppose it's not so hard to load a custom phasor~ library (source 
attached), if you need the extra accuracy of the floor version, and can 
live with the slowdown.  I did this already in one project for a vcf~ 
with internal double precision feedback state.


Claude
-- 
https://mathr.co.uk

-------------- next part --------------
PDLIBBUILDER_DIR=../pd-lib-builder/
lib.name = phasor~
class.sources = phasor~.c
include $(PDLIBBUILDER_DIR)/Makefile.pdlibbuilder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: phasor~.c
Type: text/x-csrc
Size: 1595 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20191222/4a5d8393/attachment.c>


More information about the Pd-dev mailing list