Public bug reported:

This code:
    while True:
        while not midi_input.Poll():
            sleep(0.01)
        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(devName):
    for i in xrange(m.CountDevices()):
        iFace, name, inp, outp, opened = m.GetDeviceInfo(i)
        if  inp:
            if  devName in name:
                return m.Input(i)
            else:
                print 'Skiped device:', name
    return False

def monitor(midi_input):
    cntEv = 0

    while True:
        cntEv   += 1
        while not midi_input.Poll():
            sleep(0.01)
        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(devName)
    if  midiIn:
        print 'Device', devName, 'connected.'
        monitor(midiIn)
    else:
        print 'Device', devName, 'not exist.'

** Affects: python-pypm (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1746078

Title:
  Bug in library, bad tick from Read()

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python-pypm/+bug/1746078/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to