aboutsummaryrefslogtreecommitdiffhomepage
path: root/backends
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2020-03-08 13:29:07 +0100
committercbdev <cb@cbcdn.com>2020-03-08 13:29:07 +0100
commit87d7b5a81b8e8f05b4cb8cc79e38d33395b2189f (patch)
tree6647e8ae5e9c059a34947a7b3ef0c0eeb15c49c6 /backends
parent20e8f4632b8e11415435d143ec3c7c4528c54d46 (diff)
downloadmidimonster-87d7b5a81b8e8f05b4cb8cc79e38d33395b2189f.tar.gz
midimonster-87d7b5a81b8e8f05b4cb8cc79e38d33395b2189f.tar.bz2
midimonster-87d7b5a81b8e8f05b4cb8cc79e38d33395b2189f.zip
Enable syntax highlighting, fix some errors
Diffstat (limited to 'backends')
-rw-r--r--backends/python.md6
1 files changed, 3 insertions, 3 deletions
diff --git a/backends/python.md b/backends/python.md
index b6a1162..8589c18 100644
--- a/backends/python.md
+++ b/backends/python.md
@@ -25,7 +25,7 @@ The `midimonster` module provides the following functions:
| `manage(function, socket)` | `midimonster.manage(handler, socket)`| Register a (connected/listening) socket to the MIDIMonster core. Calls `function(socket)` when the socket is ready to read. Calling this method with `None` as the function argument unregisters the socket. A socket may only have one associated handler |
Example Python module:
-```
+```python
import socket
import midimonster
@@ -45,14 +45,14 @@ def socket_handler(sock):
# Interval handler
def ping():
- print(midimonster.interval())
+ print(midimonster.timestamp())
# Register an interval
midimonster.interval(ping, 1000)
# Create and register a client socket (add error handling as you like)
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("localhost", 8990))
-midimonster.manage(reader, s)
+midimonster.manage(socket_handler, s)
```
Input values range between 0.0 and 1.0, output values are clamped to the same range.