Skip to content

Commit c3e450d

Browse files
committed
use const
1 parent 4a38287 commit c3e450d

File tree

1 file changed

+22
-21
lines changed

1 file changed

+22
-21
lines changed

tmidi.py

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
__version__ = "0.0.0+auto.0"
3636
__repo__ = "https://github.com/todbot/CircuitPython_TMIDI.git"
3737

38-
3938
# Portions of this library come from Winterbloom_SmolMIDI:
4039
#
4140
# The MIT License (MIT)
@@ -60,46 +59,48 @@
6059
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
6160
# THE SOFTWARE.
6261

62+
from micropython import const
63+
6364
# Message type constants.
64-
NOTE_OFF = 0x80
65+
NOTE_OFF = const(0x80)
6566
"""Note Off"""
66-
NOTE_ON = 0x90
67+
NOTE_ON = const(0x90)
6768
"""Note On"""
68-
AFTERTOUCH = 0xA0
69+
AFTERTOUCH = const(0xA0)
6970
"""Aftertouch"""
70-
CONTROLLER_CHANGE = CC = 0xB0
71+
CONTROLLER_CHANGE = CC = const(0xB0)
7172
"""Controller Change"""
72-
PROGRAM_CHANGE = 0xC0
73+
PROGRAM_CHANGE = const(0xC0)
7374
"""Program Change"""
74-
CHANNEL_PRESSURE = 0xD0
75+
CHANNEL_PRESSURE = const(0xD0)
7576
"""Channel Pressure"""
76-
PITCH_BEND = 0xE0
77+
PITCH_BEND = const(0xE0)
7778
"""Pitch Bend"""
78-
SYSTEM_EXCLUSIVE = SYSEX = 0xF0
79+
SYSTEM_EXCLUSIVE = SYSEX = const(0xF0)
7980
"""Sysex"""
80-
SONG_POSITION = 0xF2
81+
SONG_POSITION = const(0xF2)
8182
"""Song Position"""
82-
SONG_SELECT = 0xF3
83+
SONG_SELECT = const(0xF3)
8384
"""Song Select"""
84-
BUS_SELECT = 0xF5
85+
BUS_SELECT = const(0xF5)
8586
"""BUS Select"""
86-
TUNE_REQUEST = 0xF6
87+
TUNE_REQUEST = const(0xF6)
8788
"""Tune Request"""
88-
SYSEX_END = 0xF7
89+
SYSEX_END = const(0xF7)
8990
"""Sysex End"""
90-
CLOCK = 0xF8
91+
CLOCK = const(0xF8)
9192
"""Clock"""
92-
TICK = 0xF9
93+
TICK = const(0xF9)
9394
"""Tick"""
94-
START = 0xFA
95+
START = const(0xFA)
9596
"""Start"""
96-
CONTINUE = 0xFB
97+
CONTINUE = const(0xFB)
9798
"""Continue"""
98-
STOP = 0xFC
99+
STOP = const(0xFC)
99100
"""Stop"""
100-
ACTIVE_SENSING = 0xFE
101+
ACTIVE_SENSING = const(0xFE)
101102
"""Active Sensing"""
102-
SYSTEM_RESET = 0xFF
103+
SYSTEM_RESET = const(0xFF)
103104
"""System Reset"""
104105

105106
_LEN_0_MESSAGES = set(

0 commit comments

Comments
 (0)