evanlenz / bwv-846-prelude

Experiments in analytical extractions of Bach's Prelude No. 1 in C Major (BWV 846)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An experiment in musical transformations

This little project is an attempt to automate some analysis I was doing of Bach's Prelude in C Major (BWV 846) by transforming a MusicXML representation of the piece into separate summary documents, each of which is itself a MusicXML file.

This particular analysis takes advantage of the Prelude's simple structure: a series of broken chords, each repeated in its measure. Each chord consists of five notes. The bass line is probably the most important, but the resulting analysis extracts all five "lines" as if they were separate voices. Each roughly corresponds to a finger, generally two fingers of the left hand (bass clef) and three of the right hand (treble clef).

Can you just show me the results?

Sure. You can see and listen to them here on my MuseScore.com account (going from bottom to top):

Now the script will additionally output every possible combination of voices, plus the pitch-changes version of each, for a total of 62 output files. For example, the output also includes:

  • summary-12 (voices 1 and 2 together)
  • summary-145.pitch-changes (voices 1, 4, and 5 together, with repeated notes turned into tied notes)
  • etc.

And here's the original score for comparison.

Okay, tell me more

These musical transformations represent a simple ad hoc example of the kinds of automated transformations I am interested in exploring for purposes of progressively teaching a piece of music to a piano student (such as myself). For example, a practice plan could exist entirely of extractions from a piece of music and put in order.

I use MuseScore to aurally render the resulting summaries so I can get each of them into my ear for purposes of grokking the musical information.

In addition, after generating the individual "voice" summaries, I combine them into a chord summary, which consists simply of the unbroken chords, one per measure (an obvious way to practice the piece). Thus a total of six summaries are generated, each of which can be opened and listened to in MuseScore (or presumably any other MusicXML reader).

How it works

The XSLT code for each transformation is quite small. The rules for stripping out notes (and turning all the preserved notes into whole notes) are in:

The rules for selectively preserving some notes for the treble and bass summaries are respectively in:

Finally, the results of the other summaries are combined into chords using:

Generating the results

To generate the results, invoke run.sh or run.bat after putting the Saxon-HE jar file in your CLASSPATH environment variable. The results will appear in an "output" subdirectory.

About

Experiments in analytical extractions of Bach's Prelude No. 1 in C Major (BWV 846)


Languages

Language:XSLT 99.8%Language:Shell 0.1%Language:Batchfile 0.1%