Bug in library, bad tick from Read()
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
python-pypm (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
This code:
while True:
while not midi_input.Poll():
md = midi_input.Read(1)
print md
Return data as:
[[[128, 67, 64, 0], 0]]
[[[144, 69, 53, 0], 1]]
[[[128, 65, 64, 0], 0]]
[[[144, 67, 59, 0], 1]]
[[[128, 69, 64, 0], 0]]
[[[144, 65, 63, 0], 0]]
[[[128, 67, 64, 0], 1]]
[[[128, 65, 64, 0], 1]]
[[[144, 69, 57, 0], 1]]
[[[144, 67, 66, 0], 0]]
[[[128, 69, 64, 0], 1]]
[[[144, 65, 66, 0], 1]]
[[[128, 65, 64, 0], 1]]
[[[128, 67, 64, 0], 1]]
Last number is midi tick and is bad. I must be increased and it must be much bigger.
Some time ago it worked.
I have updated Ubuntu 16.04.
python-pypm is version 0.0.7-8
libportmidi0 is version 1:200-0ubuntu3
Whole testing code:
import sys
from time import sleep
import pypm as m
m.Initialize()
def getMidiInput(
for i in xrange(
iFace, name, inp, outp, opened = m.GetDeviceInfo(i)
if inp:
if devName in name:
else:
return False
def monitor(
cntEv = 0
while True:
cntEv += 1
while not midi_input.Poll():
md = midi_input.Read(4) # 1 massage only
print md
if __name__ == '__main__':
devName = 'Pa600'
if len(sys.argv) > 1:
devName = sys.argv[1]
midiIn = getMidiInput(
if midiIn:
print 'Device', devName, 'connected.'
else:
print 'Device', devName, 'not exist.'