25 March 2018

Album "Gin & Heptatonic" by my band The Heptatonic Jazz Quintet

Now available on the big streaming services.

Gin & Heptatonic cover

(I promise to go back to writing about RDF and related technology with my next entry, which is tentatively titled "Reification is a red herring: you don't need property graphs to assign data to individual relationships.")

Along with the jazz bass playing that I've been working on since 2003, I've written a few jazz tunes to try with the people I played with, so I recently got together some of my favorite local musicians and recorded an album of these songs. As soon as I told my wife that I planned to call the band "The Heptatonic Jazz Quintet" she suggested calling the album "Gin & Heptatonic", and I couldn't argue with that. (A heptatonic scale is a scale with seven notes, like most scales in Western music. And of course, beginning with "hep" makes it a great name for a jazz band. I was thrilled to grab the domain name heptatonic.com for only $12.) The music is mostly hard bop, swing, and variations on those.

My brother Peter produced the album and did the excellent Prestige and Blue Note-inspired front cover using a picture that I found in a Flickr search for Creative Commons CC BY 2.0 images. I did the back cover myself with a deep dive into GIMP. (On the topic of open source Linux-Windows-Mac software that played a role, I love the MuseScore scoring program and used it for lead sheets, MIDI demos, and horn arrangements.)

Two songs have lyrics. I knew that the album's closing song "Let's" required greater lyrical skills than I was capable of, so for that I called in my old New York music friend Philip Shelley. His illustrious musical career included the production of a demo of the last serious rock band I was in many years ago, and he wrote a song on the other demo. (You can read more about my limited New York rock career in an older blog entry.) Because no one in the quintet had any singing ambitions, for those two songs we got special guest Dick Orange, a popular local singer who specializes in "the great American songbook", which generally means songs made famous by Frank Sinatra.

It was interesting to learn about the current infrastructure of getting music out where people can hear it. A former business partner of my brother's recommended TuneCore, so I had them print a hundred CDs and, more importantly, take care of the music publishing administration and distribute the album to Spotify, Tidal, Amazon, Apple Music, iTunes, and other services. (I can't provide you with Apple Music or iTunes links to the album; just search for "heptatonic" from inside of your favorite Apple walled garden.)

So if you like jazz, please check out the album and "Like" the band's Facebook page. If you're in the Charlottesville Virginia area on June 1st, come to our CD Release Party at Cville Coffee, which has wine and beer in addition to coffee.

And I promise: next I'll go back to blogging about triples!

Heptatonic Jazz Quintet with Dick Orange

Please add any comments to this Google+ post.

25 February 2018

Playing jazz bass

A brief crash course.

I enjoy writing short tutorials to get people started on something that may have seemed intimidating to them before, and I thought it might be fun to write up something that isn't related to software but that I have thought a lot about in the last 15 years: jazz bass playing.

A few basic patterns that you can repeat over nearly any chord will get you pretty far. Any rock or classical bass player should be able to pick these up quickly. It should also work for any guitar player, because both electric and upright basses are tuned like the low four strings of a guitar. (Of course, the upright lacks frets, so you have to put your left hand's fingers where the frets would be.) This crash course can be useful to keyboard players as well, who can treat it as a guide to what to play with their left hand for jazz tunes.

You can think of just about all jazz as being composed of 7th chords: major 7th, minor 7th, dominant 7th, and, less often, diminished seventh, or half diminished chords. These each consist of four notes, and the distances between the notes are what make them sound different--for example, the first two notes of a major 7th are a major third apart, and in a minor 7th they're a minor third apart. Jazz musicians who see a three note triad chord like D minor may just add the seventh anyway, treating it as a D minor 7th. For a dominant 7th such as G7 in the key of C, jazz musicians since the advent of bebop in the 1940s sometimes add more notes to the chord such as the 9th, 11th, and 13th notes of the root note's scale. They may even shift some of those added notes up or down a half step so that you see a fancy chord name like G#9. As a bass player, just think of that as a G7. To summarize, it's simplest to think of it all as 7th chords.

There are some classic patterns that bass players typically play over these 7th chords, and if you learn a few of them and the notes of the chords, you can play simple jazz bass lines. Guitar players know that if they play the notes of an A minor 7th chord and then move their left hand one fret up the neck and do the same thing, they'll be playing a Bb minor 7th, so learning how to play all the chords means learning only a few patterns that you can play up and down the neck. The same applies to these jazz bassline patterns.

A walking jazz bass line is nearly all quarter notes, so when you see "1357" below, for a given chord in a given bar played in 4/4 time, you would play these four notes as quarter notes: the root of the chord (the 1), the 3rd, the 5th, and the 7th. For example, over an A minor 7th chord, 1357 would mean playing A C E G.

For each of these patterns, we'll look at how you would play them on the first four bars of the jazz standard Autumn Leaves. (Compare Nat King Cole's version with Miles Davis's; Miles' fifty-second intro puts off the actual song a bit.)


This is probably the most important pattern, but not the one you'll use the most. It's just an arpeggio of the chord--that is, the playing of each note of the 7th chord from the root up. It's an important pattern to practice with any given song because it helps you to really understand the song's structure. Over the first four bars of Autumn Leaves, this pattern would look like this on a bass staff (click the play button underneath it to hear the bass line with a piano and drums generated by the excellent open source scoring program MuseScore):

Repeating the same pattern for four bars is not something you'd want to do when playing with other people, but for this pattern it's something worth doing for an entire song while practicing on your own because it helps you to get to know the song's chords better.


This one is so useful that I use it too often when I'm on automatic pilot. You can't go wrong with it. I mentioned above that the main difference between a major seventh chord and a minor seventh chord is the "3" note; this pattern really brings that out while still hitting the most important notes of the chord from a bass player's perspective--the root and the fifth--on the crucial first and third beats of the bar. Here it is over the start of Autumn Leaves:


This seems almost too simple, but it sounds great if you give it a strong swing feel on a song like Duke Ellington's Satin Doll. Here it is over Autumn Leaves:


The 2nd note of the chord's scale is not a chord tone, but here it leads to a chord tone on the crucial third beat. This is the first pattern we've seen that doesn't always have either a 1 or a 5 on the first and third beat; the 3 on the third beat brings out the color of the chord more. In Autumn Leaves:


Similar to the last one, and similarly useful. In Autumn Leaves:


The 8 here really refers to the 1, but an octave higher. This is our first pattern with a 7th in it. In Autumn Leaves:

If you replace each quarter note in that with two swung eighth notes, you'd have a classic Chicago blues bass line, although major seventh chords don't come up in Chicago blues very often:

(John Paul Jones' bass line in Led Zeppelin's How Many More Times is a variation on this: 1 8757 1 8 7 5.)


Going down from the root of the chord through the chord's other notes is also great. Again, you have the 1 (an octave higher this time) and the 5 on the first and third beat. In Autumn Leaves:

Half bars

Jazz songs typically have one chord per bar. There are songs ranging from I Got Rhythm (and the hundreds of songs based on it) to John Coltrane's Giant Steps that are mostly two chords per bar, but in most jazz you'll see one chord per bar with the occasional two-chord bar at the end of a four- or eight-bar phrase. If you play the chord notes 13, 15, or 85 over each half bar, you'll be fine. Here are the first four bars of "I Got Rhythm" using 13 13 15 85 13 85 15 85:

Putting some together

Good bass playing mixes and matches these (and more) patterns. Below I've written out a bass line for the first eight bars of Autumn Leaves, labeling which of the patterns above is used in each bar:

Note how all the patterns listed above start with the root note of the chord. This is a solid, dependable thing to do, and greatly aids the jazz bass player's job of showing the others what chord is being played. A step toward more advanced bass playing is getting away from this--for example, starting on the 3 or the 5 of the chord--while still making it clear to the rest of the group exactly which chord is happening. (They should already know, but still, you and the drummer and the piano or guitar player are providing the cake of which the other player's solos are the frosting.)

Using more non-chord tones, the way 1232 and 1235 do above, is also a way to move past beginner status, as is moving beyond playing four quarter notes for every bar. As a first step to moving beyond the patterns above, try substituting 8 for 1 in more of the patterns, and try coming up with your own combinations of 1, 3, 5, 7, and 8. And, listen to great bass players. My favorites are Paul Chambers and Ray Brown, but if you listen to older, pre-bebop jazz, you'll hear more of these simple patterns come up more often.

Jaye, Bob, and Victor of Jazz Collective #9

Please add any comments to this Google+ post.

28 January 2018

JavaScript SPARQL

With rdfstore-js.

... all in the world's most popular programming language.

I finally had a chance to play with rdfstore-js by Antonio Garrote and it was all pretty straightforward. I already had node.js installed, so a simple npm install js installed his library. Then, I was ready to include the library in a JavaScript script that would read some RDF and query it with SPARQL. I just ran my script from the command line, but node.js fans know that they can take advantage of this library's features in much more interesting application architectures. (Before I go on, I wanted to mention that after I tweeted yesterday that this blog entry was coming, Andy Seaborne reminded me about Apache Jena's ability to load and run JavaScript functions. I tried the example from the feature's home page and it worked great right out of the box.)

My sample script starts with a function I wrote for general-purpose output of SPARQL SELECT queries, then creates an rdfstore object and saves a query that will be used twice later in the script. After loading some RDF data about my book Learning SPARQL from the OCLC's Worldcat online library catalog into the rdfstore, it runs the saved query against the loaded data to list ISBN numbers. The script then loads data about another book, runs the same query, and you can see the additional ISBN numbers in the new output.

// Utility function for outputting SELECT results
function outputSPARQLResults(results) {
    for (row in results) {
        printedLine = ''
        for (column in results[row]) {
            printedLine = printedLine + results[row][column].value + ' '

// Create an rdfstore
var rdfstore = require('rdfstore') 

// Define a query to execute.
var listISBNs = 'PREFIX s: <http://schema.org/> \
PREFIX ls: <http://learningsparql.com/ns/data#> \
PREFIX wco: <http://www.worldcat.org/title/-/oclc/> \
PREFIX wci: <http://worldcat.org/isbn/> \
SELECT ?isbn \
FROM ls:g1 WHERE { ?book s:isbn ?isbn } '

rdfstore.create(function(err, store) {   // no error handling
        // Load data about the book Learning SPARQL into named graph g1 in the rdfstore.
        'LOAD <http://worldcat.org/oclc/890467322.ttl> \
        INTO GRAPH <http://learningsparql.com/ns/data#g1>', function(err) {

            store.setPrefix('s', 'http://schema.org/')
            store.setPrefix('ls', 'http://learningsparql.com/ns/data#')
            store.setPrefix('wco', 'http://www.worldcat.org/title/-/oclc/')
            store.setPrefix('wci', 'http://worldcat.org/isbn/')
	    store.execute(listISBNs, function(err, results) {
                console.log("=== ISBN value ===")

        // Load data about the book "XML: The Annotated Specification" into the same graph
        'LOAD <http://worldcat.org/oclc/40768745.ttl> \
        INTO GRAPH <http://learningsparql.com/ns/data#g1>', function(err) {
	    store.execute(listISBNs, function(err, results) {
                console.log("\n=== ISBN values after adding 2nd book's data ===")

The script produces this output:

=== ISBN value ===

=== ISBN values after adding 2nd book's data ===

I loaded the data into a named graph because the library documentation's sample query for loading remote data did. I briefly tried loading the data into the default graph, but had no luck; I'm all for the use of name graphs, anyway. I also tried deleting triples from and inserting them into the g1 named graph and then querying again to see the results, and I didn't have much luck there either (no error messages--I just didn't see the query results I expected after the deletion and insertion) , but my minimal understanding of node.js asynchronous behavior was probably to blame. The library's github page shows that it does support INSERT and DELETE queries.

I wouldn't use this library's triplestore for ongoing production maintenance of a set of triples, anyway; I see it as a great lightweight way to grab triples from one or more sources and then perform SPARQL queries on those triples to look for subsets and patterns that can contribute to an application, all in the world's most popular programming language.

The rdfstore-js github page also shows that it offers many ways to query and manipulate the loaded data that, for a JavaScript programmer, would be more direct. If Antonio's ultimate goal was to bring RDF to JavaScript developers, I won't complain; I'm just glad that he brought a useful JavaScript library to RDF (and SPARQL) developers.

Please add any comments to this Google+ post.

"Learning SPARQL" cover

Recent Tweets



    [What are these?]
    Atom 1.0 (summarized entries)
    Atom 1.0 (full entries)
    RSS 1.0
    RSS 2.0
    Gawker Artists