Initialize UI objects
This patch shows how to initialize UI objects using loadbang, loadmess, and pattr objects.
This patch shows how to initialize UI objects using loadbang, loadmess, and pattr objects.
This patch demonstrates the use of pattr objects to store several attributes of a note-generating algorithm, and pattrstorage to store and recall preset values for all of those pattrs. In order to use the presets already designed for this patch, you will first need to download the file called notestreams.json and place it somewhere in the Max file search path.
This example shows how to store and output data using the pattr object. Whatever data is sent into a pattr object will be saved with the patch and will output on load unless the ‘thru’ attribute is disabled as shown in the lower portion of the example. The initial value of pattr can also be set using the ‘initial’ attribute.
This example shows how you can create a gangable multislider-like object. Although it is a common idea used in, for example, digital mixing consoles, there's no single object in Max yet to achieve this task of "ganging" multiple faders.
This example shows how you can ignore certain preset parameters in pattrstorage. The active message followed by the parameter name and a 0, allows you to deactivate that parameter and, consequently, all the preset interpolation associated with it. In this example, whenever you select particular preset 2, it deactivates the parameter, and then reactivates it for other presets.
There are several ways to initialize UI objects, but the data is not stored with the object itself (except for the Live objects). Triggering an initializing message to the object with loadbang is one way. See also loadmess, patcherargs, and pattr.
This example shows different ways to interpolate between values, for the purpose of automating volume control.
[In order for this example to work properly, you should first download the file called noiseburstpresets.json and save it with that name somewhere in the Max file search path.]
[In order for this example to work properly, you should first download the file called twocloudspresets.json and save it with that name somewhere in the Max file search path.]
In large and complex patches that have many pattr objects, it might be useful to be able to communicate with all of them at one central location. That is the purpose of the pattrhub object. With pattrhub you can alter the contents of any pattr just by using the name of the pattr followed by the data you want to put in it.