Skip to content

Commit 5a7dc9d

Browse files
authored
Merge pull request #9 from kevinjwalters/master
Implementation of a parser for MIDI events (messages) and alternative send interface
2 parents 8d10fda + d507b42 commit 5a7dc9d

26 files changed

+2449
-158
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
# See https://github.com/adafruit/circuitpython-build-tools for detailed setup
44
# instructions.
55

6+
# CUSTOMISED to run tests
7+
#
68
dist: xenial
79
language: python
810
python:
@@ -42,7 +44,9 @@ install:
4244
- pip install --force-reinstall pylint==1.9.2
4345

4446
script:
45-
- pylint adafruit_midi.py
47+
- ([[ -d "tests" ]] && py.test)
48+
- pylint adafruit_midi/*.py
49+
- ([[ -d "tests" ]] && pylint --disable=missing-docstring,invalid-name,bad-whitespace,trailing-whitespace,line-too-long,wrong-import-position,unused-import tests/*.py)
4650
- ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/*.py)
4751
- circuitpython-build-bundles --filename_prefix adafruit-circuitpython-midi --library_location .
4852
- cd docs && sphinx-build -E -W -b html . _build/html && cd ..

README.rst

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,21 +58,21 @@ Usage Example
5858
5959
import time
6060
import random
61+
import usb_midi
6162
import adafruit_midi
6263
63-
midi = adafruit_midi.MIDI(out_channel=0)
64+
midi = adafruit_midi.MIDI(midi_out=usb_midi.ports[1], out_channel=0)
6465
6566
print("Midi test")
6667
67-
print("Default output channel:", midi.out_channel)
68-
print("Listening on input channel:", midi.in_channel)
68+
print("Default output MIDI channel:", midi.out_channel + 1)
6969
7070
while True:
71-
midi.note_on(44, 120)
72-
midi.note_off(44, 120)
73-
midi.control_change(3, 44)
74-
midi.pitch_bend(random.randint(0,16383))
75-
time.sleep(1)
71+
midi.note_on(44, 120)
72+
midi.note_off(44, 120)
73+
midi.control_change(3, 44)
74+
midi.pitch_bend(random.randint(0,16383))
75+
time.sleep(1)
7676
7777
7878
Contributing

adafruit_midi.py

Lines changed: 0 additions & 143 deletions
This file was deleted.

0 commit comments

Comments
 (0)