O'Reilly logo

Making Music with Computers by Andrew R. Brown, Bill Manaris

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Appendix A: MIDI Constants

A.1 Overview

To simplify your coding, the Python Music Library defines many musical constants for you. These constants (words and abbreviations) can be used in place of numbers in your code. In many cases, each value is represented by several alternate constants (words). For example, the rhythm value 1.0 is equivalent to the constants QUARTER_NOTE and QN.

Notice that most of the constants are in upper case, which makes them easier to recognize in Python code. Python is a case-sensitive language, which means that these constants must be written using the case that appears here. Their numerical values are shown here, but you can also find them easily by typing the constants in the interpreter.

You should use these constants ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required