07.28.07

pcsets-2.0.0 official release

Posted in Jamendo, La vie sous la mer, dandelife, music theory, python at 6:47 am by bmccosar

It’s ready.  My Python module pcsets 2.0.0 is available at the project website, in both .tar.gz and .zip versions.

Whenever I reach a milestone in my life, I make sure to post it to my Dandelife blog; there’s a little more inside information in the article I posted today.

07.25.07

The Songwriting Storm

Posted in Jamendo, La vie sous la mer, music theory, python at 10:37 pm by bmccosar

Since July 17th, I’ve been recording for probably about 10 hours a day [when I'm not sitting in some doctor's office, that is]. The CPAP therapy is working — my sleep apnea problem is under control. I know this; I am back to my old self.

How else to explain the fact that not only is my next Jamendo album underway, but my Python module pcsets is about ready for its official 2.0.0 release. Not only did I write it — I’m actively using it. At least four of the songs I’ve written so far used concepts I developed through musical set theory, using my module to turn Python into a sort of music calculator.

I do not mean computer generated music — I mean computer facilitated harmony and chord progressions. The music, I play myself . . . once I have a basic idea.

One of the issues facing pcsets-2.0.0 is documentation. I’m still deciding on a format. In the past, I used LaTeX, but there’s something new I was considering trying . . . reStructured text (docutils). It creates very clean looking web pages, which is one of my pet peeves about reading things on the internet.

Which reminds me: I’ve been compiling a list of “Things I Never Want to Hear or Read Again.” It’s pretty much self-explanatory. Here goes–

Things I Never Want to Hear or Read Again

Postage Required.  The Post Office will not deliver without proper postage.

Do you think?  What happened to the good old fashioned “PLACE STAMP HERE”?  Never use 3 words when 11 will do, huh?

You’re Pre-Approved

And you’re pre-stuffed-into-the-shredder.

This site looks best at 800 x 600

Most sites look best when they have someone who knows something about web design creating them . . . this basically says, “Help, we can’t figure out how to design a page, and we’re offloading the responsibility of making it not look like crap to you.”

Can I speak to Mr. Mc . . . Mc . . . Mc Cosker?

No, you can’t, silly telemarketer.  Can I speak to your first grade teacher?  You know, the one who should have taught you about phonics?

See, I am back to normal!

07.20.07

Jamendo: 1000 total downloads

Posted in Jamendo, evolution, handmade at 7:09 pm by bmccosar

I’ve been really focusing on my summer projects for the past week — the Pitch Class Set module for Python, you’ve heard about. Every now and then I mention the third Jamendo album, which I’m in the process of recording — but I try not to say too much, because with the luck I’ve had this summer, all I need is to hex it ;-)

Well, while my attention was focused on these projects, things kept moving along on the internet. I reached another milestone. As of today, my albums on Jamendo have been downloaded more than 1000 times!


.mp3 .ogg total
evolution 428 150 578
handmade 358 66 424
as of 20-jul-07: 1002

07.19.07

pcsets-2.0.0, beta 2

Posted in music theory, python at 8:16 pm by bmccosar

Well, I’ve been busier. Somehow, while recording around 5-6 hours a day, I found the time to finish most of the pcsets module. It’s fully functional. Here’s an excerpt from the info I sent out in the package README file; you can download the actual package from here: pcsets-2.0.0b2.tar.gz

Pitch Class Sets for Python, version 2.0.0b2

Pitch Class Sets are a mathematical model for analyzing and composing music. Each note ‘C’ through ‘B’ has an equivalent pitch class number 0 through 11. Sets of these numbers may be operated on by mathematical functions such as transpose and invert.

The goal of this project is to, eventually, have:

  • A Python library capable of fully implementing Pitch Class Sets and their common operations, as well as several convenience functions to bring these abstract concepts to the real world. (Mapping pitch classes to note names, for instance).
  • A tool for composition. Some applications are harmonization, chord voicing generation, and melodic motif creation.
  • More exotic goals — creation of new chordal elements, musical progressions, and harmonic relationships.

As you can see, these goals range from easy (already implemented) to insanely difficult!

This is a beta release. The API will not change for any of the included modules. Bugs will be fixed and new modules will be added, but these four make up the core:

pcsets.pcset

The base class. Includes methods that operate on single sets, such as inversion and transposition.

pcsets.pcops

Operations on two or more sets, such as subset_of(a,b).

pcsets.catalog

Generates the entire catalog of 224 prime sets as a Python object. Since this takes a while to generate, it saves the catalog in a pickle file (catalog.pkl) for future use.

pcsets.noteops

The ‘universal translator’ from PcSets to named notes and vice versa.

Barring a flood of bug reports, this is likely the last beta version before the actual 2.0.0 release. New modules are being worked on (operations on the familiar chords and scales — sort of a noteops for the common language of chord-scale theory). However, these new modules will be experimental until the 2.1 release.

Certainly one of the most pressing needs is documentation, a tutorial in particular. However, one of the most useful experimental modules — connected to chord/scale theory — is in the works. Which will win? Stay tuned, and check back at the project website for future releases:

http://code.google.com/p/pcsets/

07.16.07

pcsets-2.0.0, beta 1

Posted in music theory, python at 10:52 am by bmccosar

Well, I’ve been busy.

I completely rewrote the version 1 series code for my Pitch Class Sets modules (last featured in this article).  I redesigned the interface completely, making it much easier to use.

The big news is:  instead of posting the code here, where the sheer text size was on the verge of becoming unmanageable, I signed up for project hosting at Google Code.   Now, you can download the entire pcsets package (pcsets-2.0.0b1.tar.gz) from the brand-new project homepage.  It even uses Python’s distutils now, so you can install the library directly into your site packages.

Major changes from the version 1 series:

Basic operations

All PcSet methods return NEW PcSets instead of modifying the original in place. This makes it possible to chain calls together, such as:

 newpcs = pcs.invert().transpose(4).reverse()

Numerical base

The basic PcSet class does not understand note names, only numerical pitch classes.  Note operations have been moved out of the central class and will now be in a later, separate module (noteops.py). There are two ways to define pitch classes:

  •  As a specificiation string.  Fast and easy, this is simply a string containing the numerical values for the pitch classes, with A = 10 and B = 11.  Example: PcSet(’0146A’)
  • As a list of integers.  Example: [0,1,3,4,6,7,9,10]

“Magic” Python methods

The PcSet class supports __len__, __str__, and __iter__, making the following calls possible (and replacing some of the version 1 methods):

  • len(pcs) — replaces pcs.card()
  • str(pcs) — replaces pcs.toString()
  • list(pcs) — replaces pcs.toList()

I don’t anticipate a whole lot of downloads.  Let’s face it: the only people who would get this would be interested in both 1.) musical set theory and 2.) Python.

And you thought the Ivory Billed Woodpecker was a rare bird.

07.12.07

Waiting for that next Zeta Ray

Posted in DMusic, Jamendo, family at 10:26 am by bmccosar

When I was younger, I read comics.

One of the characters I always liked was Adam Strange.  An archeologist, Strange found himself transported to the planet Rann by a “zeta ray.”  He’d go there and have adventures, and even find romance.  But then, the beam’s effects would wear off, and he’d find himself back on Earth.

Well, my zeta beam wore off.

By that, I mean I was in that magical place where I can compose and play music fluently.  It’s not all the time, but sometimes, I’m in “the groove” and can create music all day.

Everything was going fine last week, and then . . . bad things happened.

My Mom called, and there was a medical problem.  This eventually took me out of town for a few days; I just got back yesterday.  Everything turned out alright, and she’s fine now.  (I’m telling the story of the trip on my Dandelife blog.)

So here I am, home again — and no zeta beam.

Maybe I’m just exhausted from the trip.  Maybe the stress of the past few days has just put me into a different sort of funk.  But the magic isn’t there today.  I’m definitely Earthbound.

And waiting for that next Zeta Ray.

My third Jamendo album, apparently, is going to be a long struggle to complete.  This is, or was, my first free summer since I became a teacher.  I thought I’d have lots of time to play and record.  Life intervened.

I guess it’s like I said online to my friend Henri Roger.  When I told him about my previous crisis (the sleep apnea), he expressed sympathy.  Then, I said

Mais oui, pour des musiciens tels que nous, les épreuves nous font plus qualifiés de jouer “the blues”.

In English:

Yes, for musicians such as us, the hardships make us more qualified to play “the blues”.

So it looks like if ever I finally get around to recording a blues album, I’ll have plenty to talk about.

07.06.07

The Recording Light is on . . . .

Posted in Jamendo at 5:15 pm by bmccosar

Yes, after all these health battles, I am finally back to recording. Looks like my third Jamendo album might just happen after all. Life is still hitting me with obstacles, but I’m making progress.

07.01.07

The Tetrachords and “Familiarity”

Posted in music theory, python at 9:51 am by bmccosar

I’ve developed an interest in the pitch class sets of cardinality 4, the tetrachords. The other day, as I was experimenting with these sets in my practice sessions, I noticed something: some of the pc sets felt more “familiar” than others.

This makes sense; tetrachords are the basis of jazz harmony. For example, the C major 7th chord “C E G B”, as a pitch class set, is [0, 1, 5, 8] in prime form. (This can also be written 0158 in compressed notation.) When you are used to playing jazz, hearing the pitch class set 0158 makes you think “major seventh.” Even if the set is inverted, in this case it retains the same sound — 0158 happens to have an inversion axis, that is, a number n so that the operation T(n)I returns the same group of pitch classes. In this case, for 0158, n = 1.

On the other hand, some of the tetrachords sound very unfamiliar. A good example would be 0347. If I tried to make sense of this as a jazz chord, I’d have to translate to notes: C Eb E G. Now, this could have a number of names, depending on the inversion: “C major add flat 3″, “E minor major 7th flat 6″, “Eb major sixth flat 9″, and even some crazy combination of G sus 4, G6, and G+. Just as the standard terminology fails at precisely identifying this chord, so the ear finds it unfamiliar.

My intuition was that there was a mathematical reason for this, and I was right. It has to do with subsets.

If you take a familiar scale, for instance the C major scale, you can find the equivalent prime form pitch class set: 013568A. If I take any tetrachord from the C major scale, for instance 6A15, I can reduce it to prime form: the familiar 0158. This makes sense; we know that the major scale contains major seventh chords. What is different here is that I can say that 0158 is a prime subset of 013568A — there exists some operation Tn or TnI which will make 0158 a literal subset. (In this case, the operation T(5) gives 56A1 — and [5,6,A,1] is a literal subset of [0,1,3,5,6,8,A].)

That’s how I came to write a short Python program to provide clues about familiarity. Here’s the basic algorithm:

  1. Take any one of the 29 prime tetrachords. [See this article for the reason there are only 29.]
  2. Take any of the following familiar scales: major, jazz minor, harmonic minor, pentatonic, diminished, augmented, and whole tone.
  3. Find out if the given tetrachord is a prime subset of the given scale. If it is, make note of it.
  4. Repeat the above until all the possibilities are exhausted.

It was instruction #4, above, that made me turn this over to Python.

In case you’re not interested in the programming end, though, here’s a table of the results. I’ve listed each of the 29 possible tetrachord pitch class sets in the first column. The second column, inv, is the number of inversion axes for the given pitch class. The last columns are only filled in if they match the scales above.

One note: I sorted these by the number of inversion axes. Some, you will notice, have none — this means that if you perform a pitch class inversion on the set, you get a new pattern.

Case in point: the prime form for dominant 7th chords is exactly the same as for half-diminished (minor 7th flat 5) chords — 0258. On the table, 0258 has no inversion axis; therefore, one pattern corresponds to the notes in the half diminished (025 8) and its inverse to the dominant 7th (0368, if you invert, normalize, and transpose so the first note is zero).

On the other hand, the more inversion axes a set has, the more symmetrical it will be — and, for the improviser, harder to generate unique melodies.

pc set inv






0124 0 . . . . . . .
0125 0 . . . . . . .
0126 0 . . . . . . .
0135 0 major jazz harm . . . .
0136 0 major jazz harm . dim . .
0137 0 major jazz harm . dim . .
0146 0 . jazz harm . dim . .
0147 0 . . harm . dim . .
0148 0 . jazz harm . . aug .
0157 0 major jazz harm . . . .
0236 0 . jazz harm . dim . .
0237 0 major jazz harm . . . .
0247 0 major jazz harm penta . . .
0258 0 major jazz harm . dim . .
0123 1 . . . . . . .
0127 1 . . . . . . .
0134 1 . jazz harm . dim . .
0145 1 . . harm . . aug .
0156 1 major . harm . . . .
0158 1 major . harm . . aug .
0235 1 major jazz harm . dim . .
0246 1 major jazz . . . . wtone
0248 1 . jazz harm . . . wtone
0257 1 major jazz harm penta . . .
0347 1 . . harm . dim aug .
0358 1 major jazz harm penta dim . .
0167 2 . . . . dim . .
0268 2 . jazz . . dim . wtone
0369 4 . . harm . dim . .

If you want the details of how I generated this table, the program is simple, and is given below.

Read the rest of this entry »