Exploring Algorithmic Composition and MIDI Programming with Python

Click For Summary
SUMMARY

This discussion focuses on utilizing Python for algorithmic composition and MIDI programming. Key tools mentioned include pygame.midi, which allows for MIDI input and output across multiple operating systems, and MIDI.py, which provides a range of functions for manipulating MIDI data. The conversation emphasizes the need for resources to learn about MIDI and algorithmic composition, highlighting the importance of specific Python libraries for effective music programming. Participants seek recommendations for books that cover these topics comprehensively.

PREREQUISITES
  • Familiarity with Python programming language
  • Understanding of MIDI music concepts
  • Knowledge of algorithmic composition techniques
  • Basic experience with audio programming libraries in Python
NEXT STEPS
  • Research "pygame.midi" for MIDI input and output handling in Python
  • Explore "MIDI.py" for advanced MIDI data manipulation functions
  • Study algorithmic composition techniques through recommended literature
  • Investigate machine learning applications in music generation
USEFUL FOR

Musicians, audio programmers, and developers interested in algorithmic composition and MIDI programming using Python.

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   Reactions: 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   Reactions: Avatrin and Pepper Mint

Similar threads

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