[PD] slowly load a pd-patches/abs without dropouts

Enrique Erne pd at mild.ch
Fri Jan 26 09:40:38 CET 2007

hi all 

thanks for you thoughts and concerns. 

dyn~ is nice for specific problems... maybe if one needs 
dynamic amount of voices of a synth. if it should work
with every patch / abs i would need to write a translator
since the syntax is quite different from a pd-file 
(please, correct me if i'm wrong)

i hoped threadlib (by georg holzmann?) would solve all my problems :-)
tried it with
[; pd open patch-name.pd path( and [; pd-subpatchname obj 10 10
abstraction-name args(
one didn't work (i think pd open) and the other one gave me weird 
sounding dropouts. 

attached my newest version which should also work with DS.
except 11.array.controls.pd crashes pd when i load it via slowlyopen.pd

an other problem is if a tabread~ was created before its [table]
so for a short while it can't find it and gives errors.
but besides that arrays should now work fine.

> the dsp chain
> needs to be rebuild whenever the dsp graph is changed, which causes
> audio dropouts if your patch has a certain complexity...

tim: i'm not sure about the dsp-chain problem and how to test

when i dynamically create abs like this:
[; pd-subpatchname obj 10 10 abstraction-name args(
dsp seems not to be updated unless i create a ~ obj in an other
subpatch and clear it afterwards. (again workaroundism :)

but when i dynamically create objects i never had dsp-chain problems so far. 

On Sam Jan 20 15:25 , Roman Haefeli  sent:

>personally, i think it is not worth that much effort. unfortunately
>creating a patch dynamically is NOT the same as 'executing' each line of
>the pd-file.

you are totally right, but i guess you didn't check the patch at all.
basically it creates the patch line by line, but if a subpatch
starts "#N canvas", it will search for its restore line "#X restore".
there are important infos like subpatch position and the full name.

it checks the level of the subpatch so i don't have problems 
to create subpatches in subpatches.

> this makes slow dynamic creation much more complicated than
>necessary. also, in order to follow your rule to do EVERYTHIN slowly,
>you would have to turn every instance of an abstraction into an subpatch
>and therefore you would need to parse all dollararguments and convert
>them to their appropriate values.

actually my focus is mainly on abstractions. replace dollar-arguments 
(only in objects, not in msgs) is implemented in the attached patch.

recursively turning every instance of an abstraction into a subpatch
would be possible if we knew the abstraction names. that could be 
done with [pd abslist] but that's too netpd specific for the moment.

> probably there are many problems more,
>which don't come to mind right now.

i have some:

usually i ignore the first line of a patch "#N canvas".
i think these values stands for window position and size 
and maybe fontsize.

in 4.data.structures patches begin with 1 or more "#N struct" lines
before the first "#N canvas". but i don't get it what these "#N struct" 
lines do. the docs seems to work fine when i ignore these lines 
(like i do it with the first "#N canvas"). 
but i don't know DS very well. does someone have more information about
"#N struct" lines at the beginning?

>this approach is like netpd started in the beginning, but it turned out,
>that this adds too much complexity. 
>anyway, i think that these kind of problems shouldn't be solved in the
>userspace, but in pd itself, since that is a general problem. it would
>be interesting, if there is ever a chance, that pd loads patches without
>dropouts or if this is impossible by design. 

yeah would be nice if pd could do that, but for the moment i have this need
and i can't really do anything else than search for a userspace-solution,
which i'm quite close (i think).

i guess if i can do it in userspace, it is possible in pd itself.

>there are other similar
>problems, that cause dropouts, which might be easier to solve like
>dropouts on full network buffer or writing and reading files. 

yes indeed. can we hire somebody to fix maxlib/netclient (+server)
maybe we should begin with collection money? 

cheers enrique

>On Sat, 2007-01-20 at 11:56 +0100, Enrique Erne wrote:
>> hi list
>> i'd like to open patches or dynamically create abstractions during a performance
>> without having dropouts. that's why i'm trying to build a system that slowly
>> loads a patch.
>> instead [; pd open patch-name.pd path( or [; pd-subpatchname obj 10 10
>> abstraction-name args( it reads the patch with [textfile] and creates the objects
>> slowly line by line.
>> a problem was to rebuild the exact order of the subpatches. as far as i tested it
>> works now. if a patch doesn't load correctly please let me know and send it to me.
>> to identify subpatches and place the objects in the right place it adds a number
>> in front of the sub-patch name like this: [pd *id*-subpatchname].
>> -- just found out there is a msg [; pd-subpatchname rename newname(, after
>> renaming the sub-patch to it's original names the is no visual update, besides
>> that it works fine.
>> an other problem was with the array from Menu / Put / Array. it loads now even
>> with content.
>> any comments are welcome.
>> eni
>Der frühe Vogel fängt den Wurm. Hier gelangen Sie zum neuen Yahoo! Mail: http://mail.yahoo.de

-------------- next part --------------
A non-text attachment was scrubbed...
Name: slowlyopen.pd
Type: application/octet-stream
Size: 13413 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070126/448f1286/attachment.obj>

More information about the Pd-list mailing list