The MIDI protocol may or may not be satisfactory for algorithmic
composition. There are major issues:
(1) Pitch is quantized by semitone. There are extensions to obtain
fractional pitch values or custom tunings but they are clumsy.
(2) Let's say I have a string section. The score tells 3 fiddles to
play a unison, starting and stopping at different times, as in a
Scelsi piece. MIDI can only handle this by assigning each player to a
separate channel. This is clumsy.
What I suggest is you do your algorithmic composition in some more
flexible score format, such as Csound, and then convert that into MIDI
files if you need MIDI files.
If you do want or need to compose into MIDI files, try Peter Billam's
code, some also available in other languages, at
http://www.pjb.com.au/midi/. I've had very good experience with his
Lua MIDI code, so I think the Python stuff is probably also good.
Obviously, you could develop a Csound score format of your liking,
then write a little bit of Python code to translate that into Billam's
event format and save the events in a MIDI file.
http://michaelgogins.tumblr.com Michael dot Gogins at gmail dot com
> On 1/21/2018 7:50 AM, Michael Gogins wrote:
>> The MIDI protocol may or may not be satisfactory for algorithmic
>> composition. There are major issues:
> I agree that the limitations of the MIDI format are lamentable. My
> target however, is the Kontakt synth, which seems to only communicate
> through this archaic standard.
>> If you do want or need to compose into MIDI files, try Peter Billam's
>> code, some also available in other languages, at
> Csound mailing list
> [hidden email] > https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND > Send bugs reports to
> https://github.com/csound/csound/issues > Discussions of bugs and features can be posted here