circuitpython-tmidi 0.1__tar.gz → 1.0.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/PKG-INFO +2 -2
  2. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/circuitpython_tmidi.egg-info/PKG-INFO +2 -2
  3. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/pyproject.toml +1 -1
  4. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/tmidi.py +28 -22
  5. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/.github/PULL_REQUEST_TEMPLATE/adafruit_circuitpython_pr.md +0 -0
  6. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/.github/workflows/build.yml +0 -0
  7. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/.github/workflows/failure-help-text.yml +0 -0
  8. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/.github/workflows/release_gh.yml +0 -0
  9. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/.github/workflows/release_pypi.yml +0 -0
  10. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/.gitignore +0 -0
  11. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/.pre-commit-config.yaml +0 -0
  12. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/.pylintrc +0 -0
  13. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/.readthedocs.yaml +0 -0
  14. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/CODE_OF_CONDUCT.md +0 -0
  15. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/LICENSE +0 -0
  16. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/LICENSES/CC-BY-4.0.txt +0 -0
  17. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/LICENSES/MIT.txt +0 -0
  18. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/LICENSES/Unlicense.txt +0 -0
  19. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/README.rst +0 -0
  20. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/README.rst.license +0 -0
  21. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/circuitpython_tmidi.egg-info/SOURCES.txt +0 -0
  22. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/circuitpython_tmidi.egg-info/dependency_links.txt +0 -0
  23. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/circuitpython_tmidi.egg-info/requires.txt +0 -0
  24. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/circuitpython_tmidi.egg-info/top_level.txt +0 -0
  25. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/docs/_static/favicon.ico +0 -0
  26. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/docs/_static/favicon.ico.license +0 -0
  27. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/docs/api.rst +0 -0
  28. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/docs/api.rst.license +0 -0
  29. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/docs/conf.py +0 -0
  30. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/docs/examples.rst +0 -0
  31. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/docs/examples.rst.license +0 -0
  32. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/docs/index.rst +0 -0
  33. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/docs/index.rst.license +0 -0
  34. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/docs/requirements.txt +0 -0
  35. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/examples/tmidi_midiforwarder.py +0 -0
  36. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/examples/tmidi_multiple_receiver.py +0 -0
  37. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/examples/tmidi_simpletest.py +0 -0
  38. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/optional_requirements.txt +0 -0
  39. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/requirements.txt +0 -0
  40. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/setup.cfg +0 -0
  41. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/tests/test_one.py +0 -0
  42. {circuitpython_tmidi-0.1 → circuitpython_tmidi-1.0.2}/tests/test_tmidi_one.py +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: circuitpython-tmidi
3
- Version: 0.1
3
+ Version: 1.0.2
4
4
  Summary: MIDI library for CircuitPython
5
5
  Author-email: Tod Kurt <tod@todbot.com>
6
6
  License: MIT
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.2
2
2
  Name: circuitpython-tmidi
3
- Version: 0.1
3
+ Version: 1.0.2
4
4
  Summary: MIDI library for CircuitPython
5
5
  Author-email: Tod Kurt <tod@todbot.com>
6
6
  License: MIT
@@ -13,7 +13,7 @@ requires = [
13
13
  [project]
14
14
  name = "circuitpython-tmidi"
15
15
  description = "MIDI library for CircuitPython"
16
- version = "0.1"
16
+ version = "1.0.2"
17
17
  readme = "README.rst"
18
18
  authors = [
19
19
  {name = "Tod Kurt", email = "tod@todbot.com"}
@@ -32,10 +32,9 @@ Implementation Notes
32
32
 
33
33
  # imports
34
34
 
35
- __version__ = "0.1"
35
+ __version__ = "1.0.2"
36
36
  __repo__ = "https://github.com/todbot/CircuitPython_TMIDI.git"
37
37
 
38
-
39
38
  # Portions of this library come from Winterbloom_SmolMIDI:
40
39
  #
41
40
  # The MIT License (MIT)
@@ -60,46 +59,48 @@ __repo__ = "https://github.com/todbot/CircuitPython_TMIDI.git"
60
59
  # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
61
60
  # THE SOFTWARE.
62
61
 
62
+ from micropython import const
63
+
63
64
  # Message type constants.
64
- NOTE_OFF = 0x80
65
+ NOTE_OFF = const(0x80)
65
66
  """Note Off"""
66
- NOTE_ON = 0x90
67
+ NOTE_ON = const(0x90)
67
68
  """Note On"""
68
- AFTERTOUCH = 0xA0
69
+ AFTERTOUCH = const(0xA0)
69
70
  """Aftertouch"""
70
- CONTROLLER_CHANGE = CC = 0xB0
71
+ CONTROLLER_CHANGE = CC = const(0xB0)
71
72
  """Controller Change"""
72
- PROGRAM_CHANGE = 0xC0
73
+ PROGRAM_CHANGE = const(0xC0)
73
74
  """Program Change"""
74
- CHANNEL_PRESSURE = 0xD0
75
+ CHANNEL_PRESSURE = const(0xD0)
75
76
  """Channel Pressure"""
76
- PITCH_BEND = 0xE0
77
+ PITCH_BEND = const(0xE0)
77
78
  """Pitch Bend"""
78
- SYSTEM_EXCLUSIVE = SYSEX = 0xF0
79
+ SYSTEM_EXCLUSIVE = SYSEX = const(0xF0)
79
80
  """Sysex"""
80
- SONG_POSITION = 0xF2
81
+ SONG_POSITION = const(0xF2)
81
82
  """Song Position"""
82
- SONG_SELECT = 0xF3
83
+ SONG_SELECT = const(0xF3)
83
84
  """Song Select"""
84
- BUS_SELECT = 0xF5
85
+ BUS_SELECT = const(0xF5)
85
86
  """BUS Select"""
86
- TUNE_REQUEST = 0xF6
87
+ TUNE_REQUEST = const(0xF6)
87
88
  """Tune Request"""
88
- SYSEX_END = 0xF7
89
+ SYSEX_END = const(0xF7)
89
90
  """Sysex End"""
90
- CLOCK = 0xF8
91
+ CLOCK = const(0xF8)
91
92
  """Clock"""
92
- TICK = 0xF9
93
+ TICK = const(0xF9)
93
94
  """Tick"""
94
- START = 0xFA
95
+ START = const(0xFA)
95
96
  """Start"""
96
- CONTINUE = 0xFB
97
+ CONTINUE = const(0xFB)
97
98
  """Continue"""
98
- STOP = 0xFC
99
+ STOP = const(0xFC)
99
100
  """Stop"""
100
- ACTIVE_SENSING = 0xFE
101
+ ACTIVE_SENSING = const(0xFE)
101
102
  """Active Sensing"""
102
- SYSTEM_RESET = 0xFF
103
+ SYSTEM_RESET = const(0xFF)
103
104
  """System Reset"""
104
105
 
105
106
  _LEN_0_MESSAGES = set(
@@ -189,11 +190,15 @@ class Message:
189
190
  m = Message(tmidi.NOTE_ON, 0, 60, 127)
190
191
  # create CC 74 with val 63 on ch 4
191
192
  m = Message(tmidi.CC, 3, 74, 63)
193
+ # create a pitch bend full up on ch 1
194
+ m = Message(tmidi.PITCH_BEND, 0, 8191)
192
195
  """
193
196
  self.type = mtype
194
197
  self.channel = channel
195
198
  self.data0 = data0
196
199
  self.data1 = data1
200
+ if mtype == PITCH_BEND and data1 == 0:
201
+ self.pitch_bend = data0
197
202
 
198
203
  def __bytes__(self):
199
204
  status_byte = self.type
@@ -246,6 +251,7 @@ class Message:
246
251
 
247
252
  @pitch_bend.setter
248
253
  def pitch_bend(self, pbval):
254
+ pbval += 8192
249
255
  self.data0 = pbval & 0x7F
250
256
  self.data1 = pbval >> 7
251
257