[PD] Edit Pd file to change coordinates. pdlua or other language?

João Pais jmmmpais at gmail.com
Thu Mar 24 21:51:41 CET 2016


HI Fred Jan,

that sounds good. But I think you sent me the same file as before? They
are exactly alike.

I don't want to push it, but I noticed 2 details that I could mention. But
ignore them if you have better things to do:
- since I'm recording the console output of the tcl patch, only now I
noticed that it adds a first line with "lines to patch: 9 36 37 38 39..."
etc. Anyway it is ignored by Pd when loading the file, I only noticed it
by chance when I opened the pd file in a text editor
- I didn't look at the structure of the pd files clearly enough, the lines
starting with "#X restore" and "#X msg" could also be processed, for a
more coherent result.

But anyway, ignore all these if you have more interesting things to do. I
can do any testing anytime for anything - since I can't program on
anything else than Pd, at least it's my way of paying back the price of
free software.

Afaik, there isn't any rasterizer or grid alignment option - you might ask  
Jonathan Wilkes, since he's putting lots of new things into Pd2lork. Or  
maybe the community might be interested in supporting your code to improve  
patching quality - at least it could have an interesting result for you.

Best,

Joao

> Hi João,
>
> Changed the behaviour and also added some code that prevents #A and #N
> lines from being changed. Make sure you proper test it, because I
> didn't. Consider this the price of free software :-).
>
> @Dan: It is Tcl, but I should look into the gui plugin interface to make
> it work. And another way of selecting objects as there aren't any line
> numbers within Pd. It could be converted to some kind of rasterizer or
> align-to-grid option, but that may already exist...
>
> Greetings & success,
>
> Fred Jan
>
>> Hi Fred,
>>
>> I did some testing today when I had some more time. It works great, and
>> if I use it in a command like xxxx > new.pd, I get the new patch out of  
>> it.
>>
>> If I may, I would ask for a small improvement: it would be great if the
>> processing would be done in the opposite way; that is, all lines with #X
>> obj are processed, *except* the ones given as arguments. I can also work
>> with the version you sent me, but for the exercises I'm thinking about,
>> only an exception of lines will be kept in the original way.
>>
>> I tried to do it myself, but quickly I came to the conclusion that my
>> lack of experience with scripting languages doesn't really help me.
>>
>> Thanks a lot,
>>
>> Joao
>>
>>
>>> Hi João,
>>>
>>> It appeared to be a simple program in Tcl, which you should have, as it
>>> comes with Pd.
>>> The usage is: tclsh changeCoords.tcl patchName xcoord ycoord line1
>>> ?line2? ...
>>> lineN arguments may be a number or a range, like 12-15.
>>>
>>> The patch is currently dumped to the console. Only minimal checking is
>>> done.
>>>
>>> If you remove the #'s for the puts "..." lines, you can see some  
>>> interim
>>> results (which will ruin the patch format).
>>>
>>> Greetings,
>>>
>>> Fred Jan



More information about the Pd-list mailing list