File tree Expand file tree Collapse file tree 6 files changed +25
-22
lines changed
docs/programmers_reference_guide Expand file tree Collapse file tree 6 files changed +25
-22
lines changed Original file line number Diff line number Diff line change @@ -85,10 +85,6 @@ console:
85
85
86
86
pip install jupylet
87
87
88
- To install it with MIDI support type the following command instead:
89
-
90
- pip install jupylet[midi]
91
-
92
88
If you are using Python 3.8 on Windows you also need to run following command:
93
89
94
90
python -m jupylet postinstall
Original file line number Diff line number Diff line change @@ -24,12 +24,6 @@ console:
24
24
25
25
pip install jupylet
26
26
27
- To install it with MIDI support type the following command instead:
28
-
29
- .. code-block :: bash
30
-
31
- pip install jupylet[midi]
32
-
33
27
If you are using Python 3.8 on Windows you also need to run following command:
34
28
35
29
.. code-block :: bash
Original file line number Diff line number Diff line change 48
48
sys .stderr .write (
49
49
'WARNING: numpy was imported before jupylet. ' +
50
50
'On Mac OS X you should import jupylet first to let it work around ' +
51
- 'a bug in the algebra libraries used by numpy, that may cause the ' +
51
+ 'a bug in the algebra libraries used by numpy that may cause the ' +
52
52
'program to exit.' + '\n '
53
53
)
54
54
Original file line number Diff line number Diff line change @@ -264,11 +264,13 @@ def set_midi_sound(self, s):
264
264
s (jupylet.audio.sound.Sound): The sound object to use as MIDI
265
265
instrument.
266
266
"""
267
- midi .set_midi_sound (s )
268
- midi .set_midi_callback (midi .simple_midi_callback )
269
-
270
- self .scheduler .unschedule (midi .midi_port_handler )
271
- self .scheduler .schedule_interval (midi .midi_port_handler , 1 )
267
+ if midi .test_rtmidi ():
268
+
269
+ midi .set_midi_sound (s )
270
+ midi .set_midi_callback (midi .simple_midi_callback )
271
+
272
+ self .scheduler .unschedule (midi .midi_port_handler )
273
+ self .scheduler .schedule_interval (midi .midi_port_handler , 1 )
272
274
273
275
@property
274
276
def width (self ):
Original file line number Diff line number Diff line change 27
27
#
28
28
# python-rtmidi requires the following command on ubuntu:
29
29
# sudo apt-get install libasound2-dev libjack-dev build-essentials
30
- # And extend setup.py with extras for midi to avoid setup crash on ubuntu.
31
30
#
32
31
33
- import functools
34
- import _thread
35
32
import logging
36
33
37
34
try :
38
35
import rtmidi
39
36
import mido
40
-
41
37
except :
42
38
rtmidi = None
43
39
mido = None
46
42
logger = logging .getLogger (__name__ )
47
43
48
44
45
+ def test_rtmidi ():
46
+
47
+ if rtmidi :
48
+ return True
49
+
50
+ logger .warning (
51
+ 'Module python-rtmidi is not installed. To install it on Ubuntu ' +
52
+ 'Linux run these commands:\n ' +
53
+ '$ sudo apt-get install libasound2-dev libjack-dev build-essentials\n ' +
54
+ '$ pip install python-rtmidi'
55
+ )
56
+
57
+
49
58
_port = None
50
59
51
60
Original file line number Diff line number Diff line change 38
38
python_requires = '>=3.6, <3.9' ,
39
39
install_requires = [
40
40
'glfw' ,
41
+ 'mido' ,
41
42
'wget' ,
42
- 'numpy==1.19.3 ; platform_system=="Windows"' ,
43
43
'numpy ; platform_system!="Windows"' ,
44
+ 'numpy==1.19.3 ; platform_system=="Windows"' ,
44
45
'PyGLM' ,
45
46
'scipy' ,
46
47
'pillow' ,
54
55
'matplotlib' ,
55
56
'sounddevice' ,
56
57
'scikit-image' ,
58
+ 'python-rtmidi ; platform_system!="Linux"' ,
57
59
'moderngl-window' ,
58
60
],
59
61
extras_require = {
60
- 'midi' : ['mido' , ' python-rtmidi' ]
62
+ 'midi' : ['python-rtmidi' ]
61
63
},
62
64
classifiers = [
63
65
'Development Status :: 4 - Beta' ,
You can’t perform that action at this time.
0 commit comments