OmkObject
OmkObject()Base class for everything that can be a node in the graph.
Every object has an id: a UUID that stays with it across sessions and storage, distinct from any ids a graph backend or database assigns. Value types (a pitch, a chord type, a quarter note) have no id; only things that appear in a score do.
Equality means “same musical content”: the id (which stands for the object’s place in a graph) and meta are excluded, so two separately built B-flat quarter notes compare equal while remaining distinct objects (is is unaffected). Objects are mutable and unhashable.
meta is free-form storage for consumers of OMK (an app’s on-screen placement of a note, an importer’s source reference); OMK itself never reads it. Objects are slotted, so no other attributes can be added:
>>> OmkObject().anything = 1
Traceback (most recent call last):
...
AttributeError: ...Attributes
| Name | Description |
|---|---|
| meta | |
| id |