From fbf4e161b908b2fe5f03a949a06bc5ab5c1c242e Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 11 Jul 2019 16:43:52 +0200 Subject: [PATCH] midi: add path option --- CHANGELOG.md | 4 +++- resources/docs/docs/midi.md | 1 + src/server/midi.js | 5 ++++- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index c5d87b47..59db15fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,9 @@ ## 0.47.1 - bug fixes - - css font faces not loading from absolute/relative paths + - css font faces not loading from absolute/relative paths +- midi + - added `path` option for setting python binary path manually ## 0.47.0 diff --git a/resources/docs/docs/midi.md b/resources/docs/docs/midi.md index 31795841..86755cc7 100644 --- a/resources/docs/docs/midi.md +++ b/resources/docs/docs/midi.md @@ -18,6 +18,7 @@ When running the app, the `-m / --midi` switch must be set; it accepts the follo - `device_name:input,output`: connect to midi ports `input` and `output`; osc messages sent to target `midi:device_name` will be processed as midi events; Multiple devices can be declared. If the `device_name` contains white spaces, the declaration must be enquoted (ie `"spaced name:input,output"`). `device_name` doesn't need to match the actual midi device name, it is just an identifier (see [Widget settings](#widget-settings)). - `sysex`: parse incomming system exclusive messages (disabled by default) - `pc_offset`: send program changes with a `-1` offset to match some software/hardware implementations +- `path=/path/to/python`: indicates where to find python or python3 binary in case open stage control doesn't (`Error: spawn python3 ENOENT`) *Linux only:* diff --git a/src/server/midi.js b/src/server/midi.js index 4cce0bf2..0ba43f65 100644 --- a/src/server/midi.js +++ b/src/server/midi.js @@ -10,11 +10,14 @@ class MidiConverter { constructor() { + var pythonPath = settings.read('midi').filter(x=>x.includes('path=')).map(x=>x.split('=')[1])[0] + this.py = new PythonShell('python/midi.py', Object.assign({ args: [ settings.read('debug') ? 'debug' : '', ...settings.read('midi') - ] + ], + pythonPath }, pythonOptions)) }