Python Exploring Algorithmic Composition and MIDI Programming with Python

Click For Summary
To explore machine learning and algorithmic composition using Python and MIDI, several resources and packages are recommended. Key areas of focus include understanding MIDI and its applications, as well as algorithmic composition techniques. Notable Python libraries for MIDI manipulation include pygame.midi, which supports MIDI input and output across multiple operating systems, and offers object-oriented manipulation of MIDI streams. Other libraries mentioned are MIDI.py, which provides a range of functions for working with MIDI data, and PMIDI, which facilitates the generation of MIDI sequences. For foundational knowledge, readers are encouraged to seek books specifically addressing MIDI usage and algorithmic composition strategies, enhancing their ability to create innovative musical compositions through programming.
Avatrin
Messages
242
Reaction score
6
Python is the only programming language I know, and I know there is a huge library of MIDI music out there.

I want to play around with machine learning and algorithmic composition to see what I can produce.

So, what books should I read to be able to do this? What I am looking for is:

Books to learn about MIDI, and how to use it the way I want to use it.

Books to learn about algorithmic composition.
 
  • Like
Likes Pepper Mint
Technology news on Phys.org
Some python / audio packages:

https://wiki.python.org/moin/PythonInMusic

with a section on Python MIDI packages:

MIDI Mania
  • pygame.midi - is a portmidi wrapper orginally based on the pyportmidi wrapper. Also pygame.music can play midi files. Can get input from midi devices and can output to midi devices. For osx, linux and windows. New with pygame 1.9.0. python -m pygame.examples.midi --output
  • pyMIDI - Provides object oriented programmatic manipulation of MIDI streams. Using this framework, you can read MIDI files from disk, build new MIDI streams, process, or filter preexisting streams, and write your changes back to disk. If you install this package on a Linux platform with alsalib, you can take advantage of the ALSA kernel sequencer, which provides low latency scheduling and receiving of MIDI events. SWIG is required to compile the ALSA extension sequencer extension. Although OS-X and Windows provide similar sequencer facilities, the current version of the API does not yet support them. Some buggs are remaining in this package (for example when trying to delete a track), it has not been updated since 2006. This package is by Giles Hall. A sourceforge download.
  • midi.py - (DEAD LINK) - Python MIDI classes: meaningful data structures that represent MIDI events and other objects. You can read MIDI files to create such objects, or generate a collection of objects and use them to write a MIDI file.
  • MIDI.py - This module offers functions: concatenate_scores(), grep(), merge_scores(), mix_scores(), midi2opus(), midi2score(), opus2midi(), opus2score(), play_score(), score2midi(), score2opus(), score2stats(), score_type(), segment(), timeshift() and to_millisecs(). Uses Python3. There is a call-compatible Lua module.
  • PMIDI - The PMIDI library allows the generation of short MIDI sequences in Python code.The interface allows a programmer to specify songs, instruments, measures, and notes. Playback is handled by the Windows MIDI stream API so proper playback timing is handled by the OS rather than by client code. The library is especially useful for generating earcons.
... more are listed in the article...
 
  • Like
Likes Avatrin and Pepper Mint
Learn If you want to write code for Python Machine learning, AI Statistics/data analysis Scientific research Web application servers Some microcontrollers JavaScript/Node JS/TypeScript Web sites Web application servers C# Games (Unity) Consumer applications (Windows) Business applications C++ Games (Unreal Engine) Operating systems, device drivers Microcontrollers/embedded systems Consumer applications (Linux) Some more tips: Do not learn C++ (or any other dialect of C) as a...

Similar threads

  • · Replies 43 ·
2
Replies
43
Views
6K
Replies
86
Views
2K
  • · Replies 6 ·
Replies
6
Views
2K
  • · Replies 10 ·
Replies
10
Views
3K
  • · Replies 9 ·
Replies
9
Views
4K
  • · Replies 17 ·
Replies
17
Views
2K
  • · Replies 8 ·
Replies
8
Views
4K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
2K