I am trying to send a basic MIDI message to a synthesizer, using Python.
I know that the PC-Synthesizer link is functional because the Rosegarden application can be configured to play MIDI files on the device, when the MIDI output is set to 'DigitalKBD 20:0' port.
I have discovered this Python library (MIDO) and installed it. The good news is that the external MIDI device is recognized and available in the port list. Unfortunately the simple note-on test does not trigger any sound on the device. Here is the code I tried:
Using PortMidi (this is the default for MIDO):
>>> import mido
>>> output = mido.open_output('DigitalKBD MIDI 1')
>>> output.send(mido.Message('note_on', note=60, velocity=64))
Using RtMidi:
>>> import mido
>>> rtmidi = mido.Backend('mido.backends.rtmidi')
>>> output = rtmidi.open_output('DigitalKBD 20:0')
>>> output.send(mido.Message('note_on', note=60, velocity=64))
In both cases, there is no sound coming from the synthesizer whatsoever.
Please, can I get advice how to fix the code (or setup) so that the instrument receives and interprets the messages correctly?
aseqdump, play to that port, and check if anything arrives. - CL.mido.Messagethechannelfield accordingly. - h7rmido.get_output_names()list the name of your device as an available output? Try using the exact string returned by that function. - John Lyon