Example external puredata objects in C. To build (Linux environments), simply run "Make" in the example's directory and open the PD patch to test it.
To summarize creating externs for PureData:
- decide what you need at a conceptual level. An extern is useful if the PD GUI isn't allowing you to create an intuitive solution
- write the C code, you can use the helloworld example here as boilerplate
- build your object with Make, can modify the helloworld example's
- open a .pd patch that uses your object and wire it to what it needs to be wired to
NOTE: a pd object can't be named with spaces or hyphens, keep this in mind when calling gensym. Underscores are OK. The setup function needs to be <classname>_setup
like hello_world_setup
. You may want all "public" methods to include the classname like so
you will see the pd patch contains a bang. Click the bang, then Window->Pd window to see the output. shows how to use inlets.
every time bang is hit, the outputted value increases. Shows how to use both inlets and outlets.
https://github.com/pure-data/externals-howto
https://www.youtube.com/playlist?list=PLn3ODBv0ka5g_zKRpmgc58-Tj-Qn-P5qz