-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmidimech.py
executable file
·67 lines (55 loc) · 1.54 KB
/
midimech.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#!/usr/bin/python3
# from tkinter import *
from collections import OrderedDict
from configparser import ConfigParser
import os, sys, glm, copy, binascii, struct, math, traceback, signal
import rtmidi2
from dataclasses import dataclass
from glm import ivec2, vec2, ivec3, vec3
import time
from src.core import Core
# suppress pygame messages to keep console clean
with open(os.devnull, "w") as devnull:
stdout = sys.stdout
sys.stdout = devnull
import pygame, pygame.midi, pygame.gfxdraw
sys.stdout = stdout
import pygame_gui
# pymsgbox crashes on Mac, so we can't use this right now
# try:
# import pymsgbox
# except ImportError:
# print("The project dependencies have changed! Run the requirements setup command again!")
# sys.exit(1)
try:
import launchpad_py as launchpad
except ImportError:
try:
import launchpad
except ImportError:
error("The project dependencies have changed! Run the requirements setup command again!")
try:
import yaml
except ImportError:
error("The project dependencies have changed! Run the requirements setup command again!")
# import mido
try:
import musicpy as mp
except ImportError:
error("The project dependencies have changed! Run the requirements setup command again!")
def main():
core = None
try:
core = Core()
core()
except SystemExit:
pass
except:
print(traceback.format_exc())
del core
pygame.midi.quit()
pygame.display.quit()
os._exit(0)
# pygame.quit()
if __name__ == "__main__":
main()