Configuration
Some configuration for the object.
Types
-
typeSet 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 arg1boolpd.NORMALorpd.VISorpd.AUDIOINorpd.AUDIOOUTorpd.AUDIO
Outlets
-
require_n_of_outletsWhen 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 arg1boolTrueto require to set the number of outlets. -
py_outWhen set to
True, the object will outputPyObjectinstead of PureData data types.def py4pdLoadObjects(): gateobj = pd.new_object("py.gate") gateobj.py_out = True gateobj.add_object()Parameters Type Description arg1boolTrueto require to set the number of outlets. -
no_outletWhen 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_outletsWhen 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_outWhen set to
True, the object will outputPyObjectinstead of PureData data types.def py4pdLoadObjects(): gateobj = pd.new_object("py.gate") gateobj.py_out = True gateobj.add_object()Parameters Type Description arg1boolTrueto require to set the number of outlets. -
ignore_noneWhen 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
-
imageSet the pathname for the default image for a
pd.VISobject.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_sizeSet 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
-
playableWhen 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()