• Home
  • About
  • Archives
  • Colophon
  • Resume
  • Tags
  • Tumblr

zanshin.net

because not enough websites start with the letter “Z”

Feed on
Posts
Comments
Tumblr
« The Last Slice
Using rsync to Update Wordpress »

Polymorphism: Music is Like Programming

Apr 27th, 2008 by mark

In his seminal book, Object-Oriented Technology: A Manager’s Guide, the author, David A. Tayor, describes polymorphism as

Hiding alternative procedures behind a common interface.

The word, polymorphism, is a Greek term meaning “many forms.”  A common example of this in the programming world is a routine that calculates state sales tax.  The calling process is unaware of the different implementations (one for each state) behind the sales tax interface.

In my recent efforts to learn music, specifically the piano, I have started seeing striking parallels between some object-oriented technology concepts and music.  Polymorphism occurs in different chords derived from scales.

Each octave scale is comprised of eight steps, with the first and last step being the same note.  A C Major scale is C D E F G A B C.  Chords are combinations of three or more notes, for example C-E-G is the I chord in C Major scale.  It is called the I Chord because the lowest note of the chord is the first note of the scale.  A IV Chord is built on the 4th note of the scale. (The chords are denoted with Roman numerals, I, IV, V; but in speech are pronounced “one chord,” “four chord,” and “five chord.”)

There are three primary chords in an octave scale: the I chord, the IV chord, and the V chord. These are the primary chords because with them you play all the notes within the scale.  The patterns for these chords is as follows: I Chord - 1 3 5, IV Chord 4 6 8, V Chord 5 7 2, where the number represents the step in the scale that is played.

For a C Major scale the I Chord is C E G, the IV Chord is F A C, and the V Chord is G B D.  The chord patterns are polymorphic.  While the pattern remains the same regardless of the scale being played, the notes do change for each scale.  The implementation of the I Chord in C Major scale is C E G, but in a D Major scale it would be D F# A.

The chords are also polymorphic in that a C Chord (C E G) occurs in multiple scales, as the I Chord in C Major, and as the IV Chord in G Major, for example.

Tags: music, polymorphism

Posted in life

Comments are closed.

  • Welcome!

    Mark H. Nichols is an enterprise architect, martial artist, nerd, and all around good guy. Currently he works in Kansas City, and lives in the suburbs with his fiancée, three cats, a couple pianos, and nearly a dozen computers. You can read more about Mark, and this site, or explore the archives.
  • Pages

    • About
    • Archives
    • Colophon
    • Resume
    • Tags
    • Tumblr
  • Popular

    • Shotski's Ring (part I)
    • Shotski's Ring (part II)
    • 10 Mac Apps
    • What is Zanshin?
  • Categories

    • diversions
    • elsewhere
    • family
    • health
    • life
    • links
    • meme
    • nerdliness
    • photography
    • random
    • relationships
    • social issues
    • Uncategorized
  • Archives

    • Blogroll

      • Elfenbein Klaviermusik Notes
      • Shawn Blanc
      • Sibylle Kuder
  • Vote

    Obama 08
  • last.fm

    1. cd cover
    2. cd cover
    3. cd cover
    4. cd cover
    5. cd cover
    6. cd cover
  • Meta

    • Log in
    • Entries RSS
    • Comments RSS
    • WordPress.org

zanshin.net © 1996 - 2008 All Rights Reserved.

Policies | WordPress Themes | Web Hosting Blue Host