Monogram API
Search…
⌃K

Presets (Optional)

In addition to specifying the Inputs that your app accepts (i.e. inputs.json), you can also curate desired user experiences for a given module by pre-defining the module's settings.
Provide module presets to (a) minimize the friction of assigning actions to modules and (b) enable additional functionality for a more engaging and seamless experience.
Suppose you wanted the following functionality:
  • A button that flags/rejects a photo and goes to the next one
  • A dial that normally changes exposure when turned, but changes saturation when pressed and turned. Single pressing the dial resets both exposure and saturation.
While it is possible for the individual user to replicate these functionalities by using the UI, Presets provides better user experience as it will populate all relevant module settings with one-click.

Creating Presets

Create a presets.json file in your app bundle folder.
path/to/myphotoeditor.monogram
├── config.json
├── icon.png
├── inputs.json
└── presets.json
Add the following JSON to it
{
"button": [
{
"label": "Pick, Next",
"press": {
"macro": [
["Likes", "increment"],
"Next Photo"
]
}
},
{
"label": "Reject, Next",
"press": {
"macro": [
["Likes", "decrement"],
"Next Photo"
]
}
}
],
"dial": [
{
"label": "Exposure + Saturation",
"info": "Turn to change Exposure. Press and turn to change Saturation. Press to reset both",
"press": {
"macro": [
["Exposure", "reset"],
["Saturation", "reset"]
]
},
"turn": "Exposure",
"pressAndTurn": "Saturation"
}
],
"orbiter": [
{
"label": "Saturation & Exposure",
"info": "Tilt X = Saturation<br>Tilt Y = Exposure<br>Turn = undefined",
"tiltX": {
"input": "Saturation",
"step": 1
},
"tiltY": {
"input": "Exposure",
"step": 0.001
},
"turn": {}
}
]
}
These will appear in the Module Settings > Presets menu for respective modules.
The Exposure + Saturation dial preset has effectively doubled the functionality of a single dial module.
The presets.json has the format of { [ModuleType]: PresetType[] }. Possible ModuleTypes are button, dial, slider, and orbiter.

Inheritance of ModuleType

The ModuleType here to refer to the "base class" of a module. Both the Monogram Core and Essential Keys modules have tactile keys on them that the user can press down. Consequently, there are two buttons on the Monogram Core and three buttons on the Essential Keys. Defining a preset under the button key will make it available for both aforementioned cases.
See the presets.json API documentation for details.