[Csnd] Csound play a midi file via mido
Date | 2019-05-20 17:04 |
From | Richard |
Subject | [Csnd] Csound play a midi file via mido |
I found a surprising simple way to play a midi file as input to Csound, via the mido Python library. Here's the code: from mido import MidiFile, open_output port = open_output('NewPort', virtual=True) mid = MidiFile('midis/moonlight_sonata.mid') for message in mid.play(): print(message) port.send(message) The only thing is, the port must be open before you start Csound,
but that is not really a problem, because you can start Csound
from python after open_output. Richard |
Date | 2019-05-21 09:51 |
From | Rory Walsh |
Subject | Re: [Csnd] Csound play a midi file via mido |
That's neat. On Mon, 20 May 2019 at 17:04, Richard |
Date | 2019-05-31 15:24 |
From | Roger Kelly |
Subject | Re: [Csnd] Csound play a midi file via mido |
I am using Mido to host Midi...then routing to various csound instruments over OSC. Makes a nice midi host. On Tue, May 21, 2019 at 3:51 AM Rory Walsh <rorywalsh@ear.ie> wrote: That's neat. |
Date | 2019-05-31 19:34 |
From | Richard |
Subject | Re: [Csnd] Csound play a midi file via mido |
I tried to do that to..mido/midi to OSC. But I got stuck at
running status, or in other words: converting midi chords to OSC.
On 31/05/2019 16:24, Roger Kelly wrote:
|