Chapter 2

Elements of Music and Code

Topics: Fundamentals of music, the Python music library, notes, rests, variables, integers and floats, arithmetic operations, input and output, coding a program.

2.1 Overview

This chapter provides an overview of music representations, and corresponding ways to represent data and information in Python. It is mainly for people with little or no background in music or computer programming. What we call sound results from vibrations of air molecules. The air molecules are moving forwards backwards a short distance, then forwards and backwards again, repeatedly. There are other instances of the phenomenon of repeated forwards and backwards motions in nature. An electrical current is the movement of electrons through ...

Get Making Music with Computers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.