charlesneimog / py4pd

py4pd allows write PureData objects using Python. The main goal is to allow easy IA, Scores, Graphics, and bring to Pd data types as array, np.arrays, list, dict, and others.
https://charlesneimog.github.io/py4pd/
GNU General Public License v3.0
14 stars 2 forks source link

Improve Documentation #93

Open atoav opened 1 month ago

atoav commented 1 month ago

I am currently trying to get started with using the docs. I have a bit of pd experience and a lot of python experience and still can't really understand how things tie together. This might be a subjective problem, but the only way to improve documentation is if people who don't understand things admit it and tell about it.

On the page: https://charlesneimog.github.io/py4pd/pd-users/ it says:

This section describes how the py4pd objects work in PureData environment.

Which is fine, but how am I to know what the py4pd object is and what its function within the whole project is? Does it tie my script to puredata? Where do my scripts even live? Or did I overlook something here?

From the arguments-section one could infer that this is used to create scripts:

For those who work with Python, you can set the IDE editor in the creation of the py4pd

But it never explicitly says "you can create your own scripts using X". After installing py4pd via Find externals... in plugdata, when I add a py4pd object I get an console error of the kind:

C:\Users\atoav\Documents\plugdata\Externals\py4pd\py4pd.m_amd64: The specified module could not be found.
 (126)
py4pd
... couldn't create

I checked the path and the py4pd.m_amd64 file is there, I suspect within the file it tries to load a module that isn't installed or cannot be found within the path.

All the other stuff looks logical to me, but I have a hard time finding the entry point. Maybe a step by step "hello world" tutorial would help.

charlesneimog commented 1 month ago

Hi @atoav,

I agree with you, people need to give some feedback. For me, everything is clear hehe. So I appreciate the feedback.

I will add some Hello World to the docs and maybe a First project section! For now, you can see some of my projects with py4pd

https://github.com/charlesneimog/py4pd-orchidea https://github.com/charlesneimog/py4pd-upic

For these projects, if you download the repo and open the README.deken.pd it should work, always complain about uninstalled Python modules (like svgelements and svgpathtools for py4pd-upic). To install these modules use the py4pd object and send a pip install svgelements and after pip install svgpathtools. Restart PureData and the patch.

py4pd works with functions, if you create a patch. pd and in the same folder, you create a myscript.py with a function called myfunction. You load this function using py4pd myscript myfunction. This is the easy way.

You can also create a function using the pd.add_object (simple objects) or pd.new_object() (for complex objects), for that I recommend that you see the py4pd-upic or py4pd-orchidea (I use more this way, so it probably has less bugs).

About the error, this must be some problem with Windows paths, can you see if libraries like py4pd-orchidea or py4pd-upic works, then I can be more precise in my search for this bug.

charlesneimog commented 1 month ago

Also, see this section,

https://charlesneimog.github.io/py4pd/python-users/pylibrary/?h=py4pdloa

just note that in the patch image, the object should be py4pd -lib mylibname and not py4pd -lib myNewPdObjects