I made some more changes and added some help information to the voice
creation patch so you can simple use a float to add voices and 0 to clear
all voices. There are wired inlets for the voices now. 

Hope it's helpful for anybody!

Ingo

> -----Ursprüngliche Nachricht-----
> Von: Ingo [mailto:i...@miamiwave.com]
> Gesendet: Donnerstag, 29. September 2011 12:02
> An: 'Ingo'; 'Roman Haefeli'; 'Ludwig Maes'
> Cc: 'Pd List'
> Betreff: AW: [PD] Fwd: Variable number of objects?
> 
> I just added the [; pd dsp 0( when starting to creat voices to speed it up
> and eliminated the 17 voices limit of the patch.
> 
> Maybe it's useful for somebody.
> 
> Ingo
> 
> > -----Ursprüngliche Nachricht-----
> > Von: pd-list-boun...@iem.at [mailto:pd-list-boun...@iem.at] Im Auftrag
> von
> > Ingo
> > Gesendet: Donnerstag, 29. September 2011 11:33
> > An: 'Roman Haefeli'; 'Ludwig Maes'
> > Cc: 'Pd List'
> > Betreff: Re: [PD] Fwd: Variable number of objects?
> >
> > Actually, I just tried again to simply copy a couple of voices and it
> only
> > took a fraction of a second with a very short dropout - even with the
> dsp
> > on.
> >
> > I have recently installed Natty instead of Lucid on a new machine. Maybe
> > it
> > has something to do with realloc that Mathieu mentioned.
> >
> > So it looks like dynamic patching of voices isn't "that" much of a
> problem
> > here anymore. It still takes 7-8 seconds to create 16 voices in my case
> > with
> > the dsp off (12 with the dsp on) but that's still faster than restarting
> > the
> > patch. I would never have checked again if nobody would have mentioned
> it.
> >
> > I have attached a patch that I used for testing. These voices were
> > receiving
> > their input with [receive] so no connections were needed. If you are
> using
> > wired inlets you will have to dynamically add the connections of course.
> >
> > I added a cut & paste at the end because for some reasons the voices
> > didn't
> > get initialized correctly. Not sure if this is needed for other
> > voice-abstractions.
> >
> > Ingo
> >
> >
> > > -----Ursprüngliche Nachricht-----
> > > Von: pd-list-boun...@iem.at [mailto:pd-list-boun...@iem.at] Im Auftrag
> > von
> > > Roman Haefeli
> > > Gesendet: Donnerstag, 29. September 2011 08:36
> > > An: Ludwig Maes
> > > Cc: Pd List
> > > Betreff: Re: [PD] Fwd: Variable number of objects?
> > >
> > > On Wed, 2011-09-28 at 19:29 +0200, Ludwig Maes wrote:
> > > >
> > > >
> > > > ---------- Forwarded message ----------
> > > > From: Ludwig Maes <ludwig.m...@gmail.com>
> > > > Date: 28 September 2011 19:29
> > > > Subject: Re: [PD] Variable number of objects?
> > > > To: Ingo <i...@miamiwave.com>
> > > >
> > > >
> > > > I actually meant more in general, also for non-~ signals (i.e. also
> > > > control rate .pd patches). I referred to polysynth such that people
> > > > would see more easily what I meant. Are there really no such
> > > > primitives? That seems like quite a restriction...
> > > >
> > > > How can that take 10 seconds?? I dont see what would cause such a
> huge
> > > > overhead, i'd expect an increase in computations & memory though
> (say
> > > > from 10 voices to 11: 10% increase in cpu workload & ram dedicated
> to
> > > > these voices..., I fail to see what would necessitate a long
> > > > initialization...)
> > > >
> > > > also, how is it done even with the long delays?
> > > >
> > >
> > >
> > > As I understand it, the whole DSP is recompiled whenever it is
> changed.
> > > So, if you have a very large patch (and Ingo seems to be an expert in
> > > very large patches) and you create another voice, it's easily possible
> > > to eat up quite some time.
> > >
> > > Also, it's probably much slower the first time, if the voice
> abstraction
> > > is built of many other abstractions, which need to be read from disk.
> > >
> > > But I guess you are right about the increase in CPU workload _after_
> the
> > > DSP graph has been recompiled: A switch from 10 two 11 instances is
> > > expected to show only an increase of 10% in CPU usage.
> > >
> > > It's been said, that often you can gain quite some time while turning
> > > off DSP during dynamic instantiation. But I guess, this makes only a
> > > difference when performing several instantiations at the same time.
> When
> > > DSP is on, each cycle would cause a complete DSP graph recompilation,
> > > whereas when DSP is off, it's only recompiled once (after turning it
> on
> > > again).
> > >
> > >
> > >
> > > Roman
> > >
> > >
> > >
> > > _______________________________________________
> > > Pd-list@iem.at mailing list
> > > UNSUBSCRIBE and account-management ->
> > > http://lists.puredata.info/listinfo/pd-list
#N canvas 607 0 578 744 10;
#X obj 26 21 inlet;
#N canvas 342 529 257 383 voicecanvas 1;
#X restore 26 58 pd voicecanvas;
#X text 254 559 pos left;
#X text 312 559 pos top;
#X obj 297 623 pack f f f;
#X msg 112 562 selectall;
#X msg 82 562 cut;
#X obj 39 616 s reset_system_delay;
#X obj 240 348 f;
#X obj 272 348 + 1;
#X obj 196 395 sel;
#X obj 220 333 bng 15 250 50 0 empty empty empty 17 7 0 10 -262144
-1 -1;
#X msg 196 422 0;
#X obj 98 422 spigot;
#X obj 315 576 * 20;
#X msg 459 429 clear;
#X obj 315 596 + 20;
#X obj 459 449 s pd-voicecanvas;
#X obj 82 589 s pd-voicecanvas;
#X obj 297 663 s pd-voicecanvas;
#X text 295 678 send to <window-name>;
#X obj 342 321 nbx 2 14 0 1e+037 0 0 empty empty empty 0 -8 0 10 -261682
-1 -1 0 256;
#X obj 262 375 +;
#X obj 339 459 s pd-voicecanvas;
#X obj 339 412 t b b;
#X text 384 400 clear subpatch and create inlet;
#X text 384 410 when starting from 1st voice;
#X msg 413 279 set \$1;
#X obj 376 542 f;
#X text 401 541 set automatic voice offset;
#X text 372 319 automatic voice number offset;
#X msg 10 690 \; pd dsp 1;
#X msg 506 182 \; pd dsp 0;
#X msg 48 562 undo;
#X msg 24 643 connect 0 0 1 0;
#X obj 24 663 s pd-create_voices.pd;
#X obj 10 525 t b b b b b b b;
#X obj 138 21 inlet;
#X msg 382 279 0;
#X msg 188 61 2;
#X text 274 60 float adds voices;
#X obj 248 11 loadbang;
#X obj 248 31 del 1000;
#X msg 258 81 0;
#X msg 248 61 4;
#X text 284 80 0 clears voices;
#X obj 138 178 moses 1;
#X obj 262 395 t b f f;
#X obj 177 252 t b f f b;
#X obj 339 365 spigot;
#X obj 372 345 == 0;
#X obj 459 242 t b b;
#X msg 506 259 \; pd dsp 1;
#X text 3 369 (pipe can be set faster);
#X msg 158 61 1;
#X msg 268 101 0 \, 6;
#X text 304 100 clears \, then adds voices;
#X obj 342 165 t b b;
#X obj 98 395 pipe 100;
#X msg 240 328 1;
#X text 163 615 not needed;
#X msg 297 643 obj \$1 \$2 samplevoice \$3 \, connect 0 0 \$3 0;
#X obj 279 644 bng 15 250 50 0 empty empty empty -72 8 1 9 -258113
-1 -1;
#X text 219 637 set_voice;
#X text 219 647 name here;
#X text 363 622 voice number;
#X obj 10 505 del 10;
#X msg 339 439 obj 20 10 inlet;
#X msg 262 576 100;
#X obj 138 118 t f b;
#X obj 382 13 cnv 15 190 60 empty empty empty 20 12 0 14 -233017 -66577
0;
#X text 391 17 make sure there is enough;
#X text 391 47 before sending the next float;
#X text 391 32 time for creating the voices;
#X msg 218 61 3;
#X text 399 153 connect for faster creation;
#X text 399 163 disconnect less dropout ?;
#X text 6 4 data for voices;
#X text 111 4 reset/add voices;
#X connect 4 0 61 0;
#X connect 5 0 18 0;
#X connect 6 0 18 0;
#X connect 8 0 9 0;
#X connect 8 0 58 0;
#X connect 8 0 10 0;
#X connect 8 0 22 0;
#X connect 9 0 8 1;
#X connect 10 0 12 0;
#X connect 10 0 66 0;
#X connect 11 0 8 0;
#X connect 12 0 13 1;
#X connect 13 0 11 0;
#X connect 14 0 16 0;
#X connect 15 0 17 0;
#X connect 16 0 4 1;
#X connect 21 0 22 1;
#X connect 21 0 50 0;
#X connect 22 0 47 0;
#X connect 24 0 67 0;
#X connect 24 1 15 0;
#X connect 27 0 21 0;
#X connect 28 0 27 0;
#X connect 33 0 18 0;
#X connect 34 0 35 0;
#X connect 36 0 31 0;
#X connect 36 1 34 0;
#X connect 36 2 7 0;
#X connect 36 3 5 0;
#X connect 36 4 33 0;
#X connect 36 5 6 0;
#X connect 36 6 28 0;
#X connect 36 6 5 0;
#X connect 37 0 69 0;
#X connect 38 0 21 0;
#X connect 38 0 24 0;
#X connect 39 0 69 0;
#X connect 41 0 42 0;
#X connect 42 0 44 0;
#X connect 43 0 69 0;
#X connect 44 0 69 0;
#X connect 46 0 51 0;
#X connect 46 1 48 0;
#X connect 47 0 68 0;
#X connect 47 1 14 0;
#X connect 47 2 4 2;
#X connect 47 2 28 1;
#X connect 48 0 59 0;
#X connect 48 1 13 1;
#X connect 48 2 10 1;
#X connect 48 3 49 0;
#X connect 49 0 24 0;
#X connect 50 0 49 1;
#X connect 51 0 15 0;
#X connect 51 1 38 0;
#X connect 51 1 52 0;
#X connect 54 0 69 0;
#X connect 55 0 69 0;
#X connect 57 0 21 0;
#X connect 57 1 32 0;
#X connect 58 0 13 0;
#X connect 59 0 8 0;
#X connect 61 0 19 0;
#X connect 66 0 36 0;
#X connect 67 0 23 0;
#X connect 68 0 4 0;
#X connect 69 0 46 0;
#X connect 69 1 57 0;
#X connect 74 0 69 0;
#N canvas 601 430 450 300 10;
#X obj 20 20 inlet;
_______________________________________________
Pd-list@iem.at mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to