Configuration
Some configuration for the object.
Types
-
type
Set the type of the object:
pd.NORMAL
,pd.VIS
,pd.AUDIOIN
,pd.AUDIOOUT
,pd.AUDIO
.def py4pdLoadObjects(): myrandom = pd.new_object("py.random") myrandom.addmethod_bang(randomNumber) myrandom.type = pd.AUDIOIN myrandom.add_object()
Parameters Type Description arg1
bool
pd.NORMAL
orpd.VIS
orpd.AUDIOIN
orpd.AUDIOOUT
orpd.AUDIO
Outlets
-
require_n_of_outlets
When set
True
, the creation of the object will require the user to set the number of outlets of the object.def py4pdLoadObjects(): gateobj = pd.new_object("py.gate") gateobj.require_outlet_n = True gateobj.add_object()
Parameters Type Description arg1
bool
True
to require to set the number of outlets. -
py_out
When set to
True
, the object will outputPyObject
instead of PureData data types.def py4pdLoadObjects(): gateobj = pd.new_object("py.gate") gateobj.py_out = True gateobj.add_object()
Parameters Type Description arg1
bool
True
to require to set the number of outlets. -
no_outlet
When set to
True
, the object will be created without any outlet.def py4pdLoadObjects(): obj = pd.new_object("myconfigObj") obj.no_outlet = True obj.add_object()
-
n_extra_outlets
When set to
True
, the object will be created without any outlet.def py4pdLoadObjects(): obj = pd.new_object("py.if") obj.n_extra_outlets = 1 # the object will have 2 outlets. obj.add_object()
Output
-
py_out
When set to
True
, the object will outputPyObject
instead of PureData data types.def py4pdLoadObjects(): gateobj = pd.new_object("py.gate") gateobj.py_out = True gateobj.add_object()
Parameters Type Description arg1
bool
True
to require to set the number of outlets. -
ignore_none
When set to
True
, the object will not output anything if PyObject isNone
.def py4pdLoadObjects(): obj = pd.new_object("myconfigObj") obj.ignore_none = True obj.add_object()
Images
-
image
Set the pathname for the default image for a
pd.VIS
object.def py4pdLoadObjects(): patchZoom = pd.get_patch_zoom() if patchZoom == 1: scoreImage = "./resources/nozoom.gif" elif patchZoom == 2: scoreImage = "./resources/zoom.gif" # py.chord chordObj = pd.new_object("py.chord") chordObj.addmethod_anything(chord) chordObj.image = scoreImage chordObj.fig_size = (250, 250) chordObj.type = pd.VIS chordObj.add_object()
-
fig_size
Set the height and width (respectively) of the image.
def py4pdLoadObjects(): patchZoom = pd.get_patch_zoom() if patchZoom == 1: scoreImage = "./resources/nozoom.gif" elif patchZoom == 2: scoreImage = "./resources/zoom.gif" # py.chord chordObj = pd.new_object("py.chord") chordObj.addmethod_anything(chord) chordObj.image = scoreImage chordObj.fig_size = (250, 250) chordObj.type = pd.VIS chordObj.add_object()
Player
-
playable
When set to
True
, it adds 3 methods for the object,play
,stop
,clear
, this allows to use of the functionpd.add_to_player
.def addtoplayer(onset, thing): pd.add_to_player(onset, thing) def py4pd_upic_setup(): upic = pd.new_object("readsvg") upic.addmethod_anythin(readSvg) upic.playable = True upic.py_out = True upic.ignore_none_return = True upic.add_object()