Ch. 1 – Introduction and History

Topics:  Pythagoras (music, nature, and number), the Antikythera mechanism, Kepler’s harmony of the world, cymatics, fractals, electronic music, computers and programming, the computer as a musical instrument, running Python programs.

This chapter provides a quick tour of some of the major technological landmarks in Western music history and computer science. For more information, see the reference textbook.

Here is code from this chapter.

Play a musical note

This code sample (Ch. 1, p. 22) demonstrates how to play a single musical note.

Run it to test your JythonMusic installation.

# Demonstrates how to play a single note.

from music import *        # import music library

note = Note(C4, HN)        # create a middle C half note
Play.midi(note)            # and play it!

It should generate this sound:


NOTE: To play a melody, see code in chapter 3.