diff options
Diffstat (limited to '')
| -rw-r--r-- | i53wxv.md | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/i53wxv.md b/i53wxv.md new file mode 100644 index 0000000..52ba04b --- /dev/null +++ b/i53wxv.md @@ -0,0 +1,52 @@ +--- +id: i53wxv +date: 2026-02-04T17:15:41+0300 +languages: [ru] +aliases: + +reviews: + +tags: +- draft +- knowledge +- snippet +--- +# Отправка MIDI данных на все каналы по всем портам + +Этот скрипт полезен для тестирования, какой канал принимает данные на устройстве. + +```python +#!/usr/bin/env python3 +import rtmidi +import time + +midiout = rtmidi.MidiOut() +ports = midiout.get_ports() +print("Available ports:") +for i, p in enumerate(ports): + print(f"{i}: {p}") + +if ports: + # Try ALL ports one by one + for i, port_name in enumerate(ports): + print(f"\n--- Trying port {i}: {port_name} ---") + midiout.open_port(i) + + # Try different channels (1-16) + for channel in range(16): + print(f" Testing channel {channel+1}...") + # Note On (0x90 + channel, note, velocity) + midiout.send_message([0x90 + channel, 60, 100]) + time.sleep(0.2) + midiout.send_message([0x80 + channel, 60, 0]) + + midiout.close_port() +else: + print("No MIDI ports found!") +``` + +## Up +- + +## Related +- [Roland FP-e50 MIDI](fdaw8b) |
