diff options
author | cbdev <cb@cbcdn.com> | 2020-03-18 22:36:35 +0100 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2020-03-18 22:36:35 +0100 |
commit | 9718e10c7f4151cea895f515c785c14e0021d967 (patch) | |
tree | e6f4b069b91d627e8a46c6b31bcf93197102aa2b /backends/python.md | |
parent | daf9ac5b883cf981a163654d58932bfbdce619d9 (diff) | |
download | midimonster-9718e10c7f4151cea895f515c785c14e0021d967.tar.gz midimonster-9718e10c7f4151cea895f515c785c14e0021d967.tar.bz2 midimonster-9718e10c7f4151cea895f515c785c14e0021d967.zip |
Implement default channel handlers for Lua/Python
Diffstat (limited to 'backends/python.md')
-rw-r--r-- | backends/python.md | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/backends/python.md b/backends/python.md index f06e504..6852a79 100644 --- a/backends/python.md +++ b/backends/python.md @@ -6,6 +6,7 @@ to route, generate and manipulate channel events using the Python 3 scripting la Every instance has its own interpreter, which can be loaded with multiple Python modules. These modules may contain member functions accepting a single `float` parameter, which can then be used as target channels. For each incoming event, the handler function is called. +Channels in the global scope may be assigned a default handler function. Python modules may also register `socket` objects (and an associated callback function) with the MIDIMonster core, which will then alert the module when there is data ready to be read. @@ -67,9 +68,10 @@ The `python` backend does not take any global configuration. #### Instance configuration -| Option | Example value | Default value | Description | -|---------------|-----------------------|-----------------------|-----------------------------------------------| -| `module` | `my_handlers.py` | none | (Path to) Python module source file, relative to configuration file location | +| Option | Example value | Default value | Description | +|-----------------------|-----------------------|-----------------------|-----------------------------------------------| +| `module` | `my_handlers.py` | none | (Path to) Python module source file, relative to configuration file location | +| `default-handler` | `mu_handlers.default` | none | Function to be called as handler for all top-level channels (not belonging to a module) | A single instance may have multiple `module` options specified. This will make all handlers available within their module namespaces (see the section on channel specification). |