aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarel Kočí <karel.koci@nic.cz>2016-12-23 10:53:01 +0100
committerKarel Kočí <karel.koci@nic.cz>2016-12-23 10:53:01 +0100
commit19bb576edefd1bf8ecc9a03c1d4f7a233a9d3369 (patch)
tree37b578af11ba9f926776c6297eed3847ef944827
parentf394e02d51256dcb557e4b4689a750dad2260d2e (diff)
downloadturris-light-organ-19bb576edefd1bf8ecc9a03c1d4f7a233a9d3369.tar.gz
turris-light-organ-19bb576edefd1bf8ecc9a03c1d4f7a233a9d3369.tar.bz2
turris-light-organ-19bb576edefd1bf8ecc9a03c1d4f7a233a9d3369.zip
Allow no output by printing ignored message just when -v specified
-rwxr-xr-xtlo-midi.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/tlo-midi.py b/tlo-midi.py
index 5f89ba4..d7776ed 100755
--- a/tlo-midi.py
+++ b/tlo-midi.py
@@ -12,7 +12,8 @@ from colour import Color
# Parse arguments
parser = argparse.ArgumentParser(description='Turris leds midi track player')
parser.add_argument('-c', nargs=1, type=int, help="Choose channel")
-parser.add_argument('-d', nargs=1, type=str, help="Color in format 0xFFF")
+parser.add_argument('-d', nargs=1, type=str, help="Color in format #FFFFFF")
+parser.add_argument('-v', action='store_true', help="Print verbose messages")
parser.add_argument('-t', action='store_true',
help="If it is test run (print output to console)")
parser.add_argument('FILE', nargs=1, type=str, help="Midi audio file")
@@ -114,7 +115,7 @@ for msg in midi:
if (msg.type == "note_on" or msg.type == "note_off") and \
msg.channel == channel:
note(msg.note, msg.velocity, msg.time, msg.type == "note_off")
- else:
+ elif args.v:
print("Ignoring message: " + str(msg))
output_line()