summaryrefslogtreecommitdiff
path: root/i53wxv.md
blob: 52ba04b3affb7cb3fe8aa47bb72180047bc03d73 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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)