Objects

Comment

class pdpy_lib.objects.comment.Comment(comments=None, pd_lines=None, json=None, xml=None)[source]

Bases: Object

A Pure Data comment

addtext(text)[source]

Add a text row to the comment. It will be semicolon-terminated.

Obj

class pdpy_lib.objects.obj.Obj(className=None, pd_lines=None, json=None, **kwargs)[source]

Bases: Object

This class represents a Pure Data object.

Parameters
  • className (string or None) – The className of the pd object.

  • pd_lines (string or None) – The pd-lang line that represents the object, eg: #X obj 10 10 float 1

  • json (dict or None) – The json dictionary representing the object.

  • **kwargs – Additional keyword arguments are passed pdpy.Object

Raises

ValueError – If the pd_lines provided invalid arguments

Msg

class pdpy_lib.objects.msg.Msg(message=None, pd_lines=None, json=None)[source]

Bases: Object

Representation of a patchable Pd Message box

This class represents a Pd message box with a list of targets. Each target is an instance of Message.

Parameters
  • message (str, a list of str, or None) – A string or a list of strings with a message. Each element of the list defaults to the outlet target.

  • pd_lines (str) – A pd-lang string with a message, eg: #X msg 10 10 Hello world Or, for multiple targets: #X msg 10 10 Hello World \;pd quit

  • json (dict) – A json dictionary with the scope of a Msg.

addMessages(argv)[source]

Add a new message to its appropriate target

addTarget(address=None)[source]

Add a target to the message target list

Gui Objects

class pdpy_lib.objects.gui.Gui(pd_lines=None, json=None, **kwargs)[source]

Bases: Object

A Pd Native Gui object like floatatom, symbolatom, or listbox

A Pd Native Gui object is a graphical user interface that is implemented in pure data.

Parameters
  • pd_lines (list) – The lines of the Pure Data patch that define the object.

  • json (dict) – A JSON representation of the object.

  • **kwargs (optional) –

    Keyword arguments are:

    • className: the name of the class of the object

    • digits_width : The width of the object in digits

    • flag: The flag of the object

    • label: The label of the object

    • fontsize: The font-size of the object

    Other keyword arguments are passed to pdpy_lib.primitives.bounds.Bounds and pdpy_lib.patching.comm.Comm

See also

pdpy_lib.utilities.default.Default

For default parameters.