Comments (11)
I think what you are seeing may be "running status": http://www.somascape.org/midi/tech/spec.html#runstat
Please run the script midiin_callback.py from the examples, select the MIDI port, your keyboard is attached to and play some notes. Then post the output here.
Also, without seeing the code you are using, I can't reproduce your problems, so please post a minimal example that demonstrates the problem, if you can.
from python-rtmidi.
Thank you for the response! I use expanded version of midiin_callback.py in my code, some results from running given file (constantly key 96 is pressed):
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538410.931765 [144, 96, 0]
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538410.993423 [144, 96, 70]
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538411.076520 [144, 96, 0]
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538411.139425 [144, 96, 72]
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538411.222518 [144, 96, 96]
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538411.265334 [144, 0, 96]
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538411.348264 [144, 67, 96]
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538411.410048 [144, 0, 96]
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538411.494266 [144, 67, 96]
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538411.555934 [144, 0, 96]
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538411.639266 [144, 66, 96]
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538411.682106 [144, 0, 96]
[MidiLink Mini:MidiLink Mini MIDI 1 20:0] 1555538411.765017 [144, 66, 96]
from python-rtmidi.
I use expanded version of midiin_callback.py
So, you are saying the output above is from the unchanged midiin_callback
or from your code? If it is from your code, then please post your code here. Because I'm not able to reproduce your results with midiin_callback.py
and the MIDI input devices I have.
Also, which OS are you on and which API backend are you using (JACK, ALSA, CoreMidi, WindowsMM)?
from python-rtmidi.
This is output from unchanged midiin_callback file. The easiest way to reproduce this on my device is constantly pressing very fast one key for some time.
I use ALSA and work on Raspbian GNU/Linux 8.0 (jessie).
from python-rtmidi.
Do you have another MIDI interface to test with?
Is this the MIDI interface you are using?
https://www.thomann.de/de/miditech_midilink_mini.htm
The buyers' comments don't exactly fill me with confidence in the reliability of this interface.
from python-rtmidi.
Yes, this is exactly the interface I am using and unfortunately the only I can test with for now.
from python-rtmidi.
I'll try to test this on a Rasberry Pi (also with Raspbian 8) tomorrow.
from python-rtmidi.
Thank you very much for help.
from python-rtmidi.
Sorry, I have not been able to reproduce this.
I tested this on my own Raspberry Pi, which also has Raspbian 8 installed, with the Python 3.4 version installed from the distribution packages. I created a virtualenv and installed python-rtmidi
1.3.0 from PyPI with pip
. I played the notes as quickly as I could and everything looks fine.
I suspect your MIDI interface is to blame. Can you test it with aseqdump
? Run aseqdump -l
to list MIDI input ports, then run aseqdum -p <port>
with the port number reported for your MIDI interface and play your keyboard? Please post the output after playing some notes here.
virtualenv -p python3 rtmidi
source rtmidi/bin/activate
pip install python-rtmidi
python midiin_callback.py # download this e.g. from the github repo
DEBUG:rtmidi.midiutil:Creating MidiIn object.
Do you want to create a virtual MIDI input port? (y/N)
Available MIDI ports:
[0] Midi Through:Midi Through Port-0 14:0
[1] Xkey:Xkey MIDI 1 20:0
Select MIDI input port (Control-C to exit): 1
INFO:rtmidi.midiutil:Opening MIDI input port #1 (Xkey:Xkey MIDI 1 20:0).
Attaching MIDI input callback handler.
Entering main loop. Press Control-C to exit.
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 1, 77]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 1, 72]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 1, 68]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 1, 58]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 1, 55]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 1, 44]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 1, 27]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 1, 22]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 1, 23]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 1, 10]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 1, 9]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 1, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 64, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 64, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 64, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 64, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617572.892733 [176, 64, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617574.202841 [144, 72, 101]
[Xkey:Xkey MIDI 1 20:0] @1555617574.246702 [128, 72, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617574.410570 [144, 72, 88]
[Xkey:Xkey MIDI 1 20:0] @1555617574.458187 [128, 72, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617574.610817 [144, 72, 59]
[Xkey:Xkey MIDI 1 20:0] @1555617574.674693 [128, 72, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617574.839810 [144, 72, 88]
[Xkey:Xkey MIDI 1 20:0] @1555617574.891180 [128, 72, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617575.008811 [144, 72, 29]
[Xkey:Xkey MIDI 1 20:0] @1555617575.075221 [128, 72, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617575.232823 [144, 72, 84]
[Xkey:Xkey MIDI 1 20:0] @1555617575.262937 [128, 72, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617575.424315 [144, 72, 34]
[Xkey:Xkey MIDI 1 20:0] @1555617575.454433 [128, 72, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617576.254557 [144, 72, 94]
[Xkey:Xkey MIDI 1 20:0] @1555617576.370936 [128, 72, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617576.478558 [144, 72, 97]
[Xkey:Xkey MIDI 1 20:0] @1555617576.572432 [128, 72, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617576.662572 [144, 72, 102]
[Xkey:Xkey MIDI 1 20:0] @1555617576.733934 [128, 72, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617577.867922 [144, 84, 95]
[Xkey:Xkey MIDI 1 20:0] @1555617577.958045 [128, 84, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617578.484406 [144, 84, 62]
[Xkey:Xkey MIDI 1 20:0] @1555617578.540766 [128, 84, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617578.683394 [144, 84, 106]
[Xkey:Xkey MIDI 1 20:0] @1555617578.776013 [128, 84, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617579.190025 [144, 96, 123]
[Xkey:Xkey MIDI 1 20:0] @1555617579.291410 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617579.414032 [144, 96, 113]
[Xkey:Xkey MIDI 1 20:0] @1555617579.507907 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617579.610533 [144, 96, 104]
[Xkey:Xkey MIDI 1 20:0] @1555617579.675668 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617579.794546 [144, 96, 110]
[Xkey:Xkey MIDI 1 20:0] @1555617579.880910 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617579.998531 [144, 96, 90]
[Xkey:Xkey MIDI 1 20:0] @1555617580.064901 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617580.410028 [144, 96, 93]
[Xkey:Xkey MIDI 1 20:0] @1555617580.493900 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617580.631530 [144, 96, 107]
[Xkey:Xkey MIDI 1 20:0] @1555617580.729154 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617580.818027 [144, 96, 114]
[Xkey:Xkey MIDI 1 20:0] @1555617580.884394 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617580.962016 [144, 96, 105]
[Xkey:Xkey MIDI 1 20:0] @1555617581.057143 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617581.132272 [144, 96, 116]
[Xkey:Xkey MIDI 1 20:0] @1555617581.206172 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617581.292528 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617581.377649 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617581.470271 [144, 96, 96]
[Xkey:Xkey MIDI 1 20:0] @1555617581.539142 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617581.624263 [144, 96, 119]
[Xkey:Xkey MIDI 1 20:0] @1555617581.736892 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617581.808260 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617581.895891 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617581.976013 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617582.056141 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617582.140014 [144, 96, 118]
[Xkey:Xkey MIDI 1 20:0] @1555617582.216383 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617582.300260 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617582.367883 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617582.450506 [144, 96, 114]
[Xkey:Xkey MIDI 1 20:0] @1555617582.519378 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617583.687004 [144, 96, 102]
[Xkey:Xkey MIDI 1 20:0] @1555617583.715876 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617583.834746 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617583.869870 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617583.996245 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617584.032619 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617584.126495 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617584.176615 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617584.265512 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617584.321883 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617584.398249 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617584.452118 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617584.529742 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617584.582367 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617584.659993 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617584.710113 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617584.791490 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617584.841613 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617584.921735 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617584.969365 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617585.053237 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617585.103364 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617585.185982 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617585.234857 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617585.326240 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617585.365114 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617585.460236 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617585.507853 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617585.584236 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617585.645613 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617585.733250 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617585.779612 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617585.873484 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617585.919853 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617586.017483 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617586.062612 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617586.155233 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617586.204099 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617586.301733 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617586.346855 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617586.443231 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617586.488349 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617586.588481 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617586.634848 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617586.723724 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617586.776356 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617586.860228 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617586.922846 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617587.002978 [144, 96, 125]
[Xkey:Xkey MIDI 1 20:0] @1555617587.058103 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617587.150724 [144, 96, 65]
[Xkey:Xkey MIDI 1 20:0] @1555617587.185848 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617587.287244 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617587.341102 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617587.431231 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617587.483846 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617587.581473 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617587.631599 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617587.715470 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617587.776845 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617587.868220 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617587.923354 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617588.009720 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617588.068592 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617588.157464 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617588.215087 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617588.295211 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617588.352842 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617588.454216 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617588.504330 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617588.603226 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617588.652092 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617588.753480 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617588.799833 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617588.907457 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617588.953834 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617589.051460 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617589.096581 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617589.177957 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617589.233075 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617589.325704 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617589.373334 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617589.469707 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617589.523577 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617589.619957 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617589.668830 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617589.770204 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617589.810325 [128, 96, 0]
[Xkey:Xkey MIDI 1 20:0] @1555617589.909203 [144, 96, 127]
[Xkey:Xkey MIDI 1 20:0] @1555617589.958076 [128, 96, 0]
^C
Exit.
from python-rtmidi.
I attach the output from aseqdump
as you said it is probably my midi controller guilty for switching note and velocity.
from python-rtmidi.
Yes, it seems either your keyboards (unlikely) or the MIDI interface are sending garbage.
These cheap cable-integrated MIDI interfaces can be hit-and-miss and often, even if they work for "nomal" MIDI events (notes, controllers, etc.), they mess up System Exclusive messages. If you're looking not to spend too much, I'd try to buy a used, older USB audio interface with MIDI ports (and some standard MIDI cables), even if you don't plan on using the audio capabilities, you can still use its MIDI interface.
I'm closing this issue now. If you have new data that suggest that python-rmidi
is to blame after all, feel free to re-open it.
from python-rtmidi.
Related Issues (20)
- MidiInAlsa::initialize: error creating ALSA sequencer client object HOT 25
- Newbie setup issue HOT 2
- Apple Silicon macOS wheel? HOT 2
- [WSL2] Failed to install 1.5.0 via pypi HOT 10
- [macOS] incompatible binary wheels for architecture M1 / arm64 HOT 35
- [windows] No result from 1.5.0 get_ports() HOT 23
- Version 1.5.0 PyPi incompatible with M1 ARM64 architectures HOT 1
- get_ports() method returns blank lists with Python 3.11 and ARM Macs HOT 8
- how to close midi port which has been opened? HOT 1
- Error when installing on Raspberry PI (1.5.5) HOT 2
- ALSA incomplete message on Pi HOT 8
- get_ports() returns garbled text on multi-byte character port name. HOT 2
- Missing wheel for Python 3.12 HOT 2
- 1.5.7 seems to have an issue with Pipewire implementing JACK HOT 5
- pypi link to source code HOT 1
- Build error [due to version field missing] HOT 4
- Error when installing via pip on CoreElec (aarch64) HOT 16
- Increase the sysex input buffer size on Windows HOT 3
- MIDI port crashes if midi sent inside async socket server HOT 4
- delta timestamps are broken on macOS in current release (1.5.8) HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-rtmidi.