Developing a heuristic for evolving guitar blues licks

Towards the development of a pseudo simulated annealing genetic heuristic for evolving blues ideas

Architecture, graphic design, your projects.

Moderators: Calilasseia, Blip, ADParker

Developing a heuristic for evolving guitar blues licks

#1  Postby John Platko » Nov 11, 2015 6:35 pm

Some time ago, while a thread I was contributing to was locked for review, I wrote a paper titled: On the Origin of Ideas: The Evolutionary Theory of Ideas, as Developed Though the Study of Religious Ideas (and Why I'm a Theist). I started a thread to discuss that paper. The ideas discussed in that thread motivated me to attempt to put some of them to actual use in a domain that was bounded enough to be practical to work with and yet expansive enough to be interesting and challenging. I chose guitar blues licks because that domain fit my criteria, I'm interested in it, and I thought it would be fun. I suppose this thread could be titled: The Evolutionary Theory of Ideas, as Developed Though the Study of Blues Ideas (and Why Clapton is God) – but I won't do that. :nono:

This thread will discuss the work I've done and present new work as it develops – over time. The ultimate goal is to develop a heuristic that will take in an initial set of blues licks, some guidance on the evolutionary space to explore along with a fitness function and then output a new set of licks evolved from the founder set through multiple generations.

The project is eclectic in that it involves music theory, especially as it applies to lead blues guitar, music engraving (because I want input and output to be formatted in standard lead blues guitar music notation), computer programing, artificial intelligence, genetic algorithms/heuristics, and evolution of ideas (memes if you prefer) – and who knows what else ...

I'm hoping that this thread can be of interest to anyone who is curious about any of those topics. You don't need to be an expert in any or all of them – I'm certainly not.

If your only interested in lead guitar playing then you could focus on that aspect of the thread, suggest input set licks, explain how you go about developing your own licks etc.. Maybe even play some of the licks presented.

If you're interested in computer programing of this sort but you know nothing about guitar playing or blues then no worries, I plan to give a blues primer and explain the music notation involved. If you know nothing about music theory and always wanted to learn then that's ok too because we can cover that as we go. And we seem to have a lot of musicians as forum members, perhaps one of them could start a thread teaching music theory.

If you're interested in serious study of evolution then I'm hoping you can help me develop the naive evolutionary principles I'm using into something more developed.

I'll end the kick-off post with an example of what I'm talking about. Here's an output example of a simple one generation run. I input 16 different licks (each lick is one or two bars long), they are numbered on the top left of each lick. The program outputs the original set followed by various mutations of that set. Some of the mutations are simple changes to the original lick, some mutations (where you see a “+” ) are the offspring of the merger of two different licks. Each lick is output in standard music notation as well as Tab. Tab is a notation for guitar players. Unlike a piano, you can play the same note in multiple places on a guitar and Tab tells you exactly where to play. I'll explain all of this in more detail in future posts but I thought this example would be helpful to give the idea of what I'm going on about.

Edit: I thought an example of actual blues licks in action might be useful too.

https://www.youtube.com/watch?v=F_rRJIAQapg
I like to imagine ...
User avatar
John Platko
THREAD STARTER
 
Name: John Platko
Posts: 9411
Male

Country: US
United States (us)
Print view this post

Ads by Google


Re: Developing a heuristic for evolving guitar blues licks

#2  Postby Adco » Nov 11, 2015 8:27 pm

I love blues. I am a hacker when it comes to technical skills but I am able to keep up with a jam session. I just need the key, which I normally pick up quickly. I use box shapes from all over the frets board to improvise. My favourite is YouTube Blues Backing track in any key. I can jam to that for hours on end, always coming up with new licks to suit the various styles.

Typical session for me. Choose a sad song backing track, have a puff of inspiration and loosing myself for an hour or two of blues heaven.

I wish I has enough connections and/or money to have a live band waiting in a studio so I could jam whenever I wanted to. :smoke:
god must love stupid people - he made so many of them
User avatar
Adco
 
Posts: 1295
Age: 60
Male

South Africa (za)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#3  Postby John Platko » Nov 12, 2015 1:32 pm

Adco wrote:I love blues. I am a hacker when it comes to technical skills but I am able to keep up with a jam session. I just need the key, which I normally pick up quickly. I use box shapes from all over the frets board to improvise. My favourite is YouTube Blues Backing track in any key. I can jam to that for hours on end, always coming up with new licks to suit the various styles.

Typical session for me. Choose a sad song backing track, have a puff of inspiration and loosing myself for an hour or two of blues heaven.

I wish I has enough connections and/or money to have a live band waiting in a studio so I could jam whenever I wanted to. :smoke:


Nice. Maybe you can suggests some licks at some point.

How did you learn the box system and how do you go about improvising?
I like to imagine ...
User avatar
John Platko
THREAD STARTER
 
Name: John Platko
Posts: 9411
Male

Country: US
United States (us)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#4  Postby Adco » Nov 12, 2015 1:58 pm

John Platko wrote:
Adco wrote:I love blues. I am a hacker when it comes to technical skills but I am able to keep up with a jam session. I just need the key, which I normally pick up quickly. I use box shapes from all over the frets board to improvise. My favourite is YouTube Blues Backing track in any key. I can jam to that for hours on end, always coming up with new licks to suit the various styles.

Typical session for me. Choose a sad song backing track, have a puff of inspiration and loosing myself for an hour or two of blues heaven.

I wish I has enough connections and/or money to have a live band waiting in a studio so I could jam whenever I wanted to. :smoke:


Nice. Maybe you can suggests some licks at some point.

How did you learn the box system and how do you go about improvising?
Not good enough to make any suggestions that are different from what is out there. This is my level; Give me almost any backing track, preferably slow blues, and put me in a pub or restaurant and I will make you happy with background music. Just pleasant listening. Normally I sing and play Golden Oldies type music in pubs or restaurants for the fun of it.

I learnt the box system, if that is the name for it, from trial and error. When I saw an tutorial on the net, I thought Hey! I do that. So it seems like a natural progression. If you play enough, you will stumble across it.

My improvisations are my own playing to backing tracks. I have a feel for the music and indulge a bit. Like getting lost in your mind for a while. Nothing else matters. If I'm brave enough on day, I'll post a recording.

I don't know all the notes on the fretboard of by heart. A lot but not all. I do know all the chord position up and down in the different shapes and I know most of the box patterns for any key. I am not interested in learning notes. Better things to do.
god must love stupid people - he made so many of them
User avatar
Adco
 
Posts: 1295
Age: 60
Male

South Africa (za)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#5  Postby John Platko » Nov 12, 2015 3:09 pm

I thought it best to cover the basic structure of blues music and put the concept of a "blues lick" in that perspective.

From
The basic 12-bar lyric framework of a blues composition is reflected by a standard harmonic progression of 12 bars in a 4/4 time signature. The blues chords associated to a twelve-bar blues are typically a set of three different chords played over a 12-bar scheme. They are labeled by Roman numbers referring to the degrees of the progression. For instance, for a blues in the key of C, C is the tonic chord (I) and F is the subdominant (IV).

The last chord is the dominant (V) turnaround, marking the transition to the beginning of the next progression. The lyrics generally end on the last beat of the tenth bar or the first beat of the 11th bar, and the final two bars are given to the instrumentalist as a break; the harmony of this two-bar break, the turnaround, can be extremely complex, sometimes consisting of single notes that defy analysis in terms of chords.


This shows the most basic 12 bar chord structure.

Image

You can keep looping those 12 bars for as long as you like. It's most commont to play the V chord in the 12th bar if you want to loop - the V chord has a lot of tension and there is a resolution of that tension when you restart the loop back on the I chord. You end the song on with the I chord.

There are of course lots of variations of the this basic pattern. One, called quick change substitutes a IV chord in the second bar.

Here's a version of the chord progression in the key of E (which I'll be using a lot)

Image

You see a lot of 7 chords in that progression - which brings out an important aspect of the blues - there's a lot of mixing of major and minor scales and chords- it's often described as what gives the blues its sweet and sour sound.

7 chords are composed of 4 notes. the root, + major 3rd, + perfect 5th + minor 7th.

So and E7 is E + G# + B + D

And just focusing on the instrumental part, often the Bass and Rhythm guitar will be playing those chords while a lead guitar or other instrument is soloing. It's the soloing that I'm focusing on in this thread. And one way of thinking about the solo is that it is composed of basic musical ideas or "licks", these licks are the "words" and the musician puts them together in various ways with different variations to make the whole "idea" be communicated.

Here's a backing track I found on youtube that demonstrates how this rhythm progression lays the foundation for the blues.

I like to imagine ...
User avatar
John Platko
THREAD STARTER
 
Name: John Platko
Posts: 9411
Male

Country: US
United States (us)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#6  Postby John Platko » Nov 12, 2015 3:16 pm

Adco wrote:
John Platko wrote:
Adco wrote:I love blues. I am a hacker when it comes to technical skills but I am able to keep up with a jam session. I just need the key, which I normally pick up quickly. I use box shapes from all over the frets board to improvise. My favourite is YouTube Blues Backing track in any key. I can jam to that for hours on end, always coming up with new licks to suit the various styles.

Typical session for me. Choose a sad song backing track, have a puff of inspiration and loosing myself for an hour or two of blues heaven.

I wish I has enough connections and/or money to have a live band waiting in a studio so I could jam whenever I wanted to. :smoke:


Nice. Maybe you can suggests some licks at some point.

How did you learn the box system and how do you go about improvising?
Not good enough to make any suggestions that are different from what is out there. This is my level; Give me almost any backing track, preferably slow blues, and put me in a pub or restaurant and I will make you happy with background music. Just pleasant listening. Normally I sing and play Golden Oldies type music in pubs or restaurants for the fun of it.

I learnt the box system, if that is the name for it, from trial and error. When I saw an tutorial on the net, I thought Hey! I do that. So it seems like a natural progression. If you play enough, you will stumble across it.

My improvisations are my own playing to backing tracks. I have a feel for the music and indulge a bit. Like getting lost in your mind for a while. Nothing else matters. If I'm brave enough on day, I'll post a recording.

I don't know all the notes on the fretboard of by heart. A lot but not all. I do know all the chord position up and down in the different shapes and I know most of the box patterns for any key. I am not interested in learning notes. Better things to do.



Well that's the way to really learn and play the blues - maybe with someone passing down some licks to you too.

I hope you'll excuse my rather nerdie and certainly overthought approach to blues licks that I'm delving into in this thread.

I thought I should start just giving some background context to blues music so anyone not familiar but interested could follow along but I'm sure latter on you'll be able to take some example licks I give and suggests ways to mutate it that I can "teach" my program do the same.
I like to imagine ...
User avatar
John Platko
THREAD STARTER
 
Name: John Platko
Posts: 9411
Male

Country: US
United States (us)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#7  Postby Adco » Nov 12, 2015 3:23 pm

I'm going to follow with interest. I will learn something.
god must love stupid people - he made so many of them
User avatar
Adco
 
Posts: 1295
Age: 60
Male

South Africa (za)
Print view this post

Ads by Google


Re: Developing a heuristic for evolving guitar blues licks

#8  Postby chairman bill » Nov 12, 2015 3:23 pm

As a blues player (more enthusiasm than skill), who plays wholly by ear (no theoretical musical knowledge), this certainly interests me, and I'm keen to see what arises from it.
Socialists: winning the fight against people-hating fascists of the right & (alleged) centre.
User avatar
chairman bill
RS Donator
 
Posts: 28091
Male

Country: UK: fucked since 2010
United Kingdom (uk)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#9  Postby Adco » Nov 12, 2015 3:25 pm

chairman bill wrote:As a blues player (more enthusiasm than skill), who plays wholly by ear (no theoretical musical knowledge), this certainly interests me, and I'm keen to see what arises from it.
Stand in the queue....
god must love stupid people - he made so many of them
User avatar
Adco
 
Posts: 1295
Age: 60
Male

South Africa (za)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#10  Postby Shrunk » Nov 12, 2015 3:39 pm

I remember reading an anecdote a while back, but I can't recall the details. I think it was about Leonard Bernstein, but I'm not even sure about that. Anway, Bernstein (or whomever) was giving a lecture on the blues to a group of classical musicians and scholars where he gave a description of the structure of a blues form much as what you describe in #5. Someone asked him "But isn't the blues just a feeling?" to which he replied "Only if you think the sonata form is a 'feeling.'"

I'm not sure I entirely agree with that. I wouldn't go as far as saying it's just a feeling, but I also don't think it can be reduced to the chord sequence. You could play a song using those exact chords without it sounding anything like the blues. OTOH, how many notes to you have to hear of this before you know it's the blues you're listening to? You certainly don't have to hear all 12 bars of the structure.



The analogy I would use is that the blues (or any other musical idiom) is a language. The chord structure is like the grammar and licks or riffs are like idiomatic phrases that identify a fluent speaker of the language from someone who can do no more than speak the language well enough to get his thoughts across, but not with fluency.
"A community is infinitely more brutalised by the habitual employment of punishment than it is by the occasional occurrence of crime." -Oscar Wilde
User avatar
Shrunk
 
Posts: 26170
Age: 54
Male

Country: Canada
Canada (ca)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#11  Postby Shrunk » Nov 12, 2015 3:43 pm

And here's a blues standard that follows the 32 bar structure:

"A community is infinitely more brutalised by the habitual employment of punishment than it is by the occasional occurrence of crime." -Oscar Wilde
User avatar
Shrunk
 
Posts: 26170
Age: 54
Male

Country: Canada
Canada (ca)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#12  Postby John Platko » Nov 12, 2015 6:46 pm

chairman bill wrote:As a blues player (more enthusiasm than skill), who plays wholly by ear (no theoretical musical knowledge), this certainly interests me, and I'm keen to see what arises from it.


I couldn't learn to play like that, it just didn't work for me, I had several abortive attempts at learning to play because: I didn't have much rhythm, had no clue what I was hearing, and found it pretty hard to find books that helped me. I eventually decided I needed lessons but the teacher I had wasn't all that much help either.

But I kept trying to work through the theory, I don't really understand why that was so hard for me, I think it was some combination of not being very good at language and the confusing terminology. Eventually I sorted out the basics, and found a series of books that explained the CAGED system, called Fretboard Logic - then things started to fall into place. So, in short, I lead with trying to figure out what I'm trying to do then try to do - not so much if I'm just playing or noodling, then I just do what I feel - but to raise the bar a bit I have to think first. Not that that helps as much as I'd like but it seems to be my only way forward.

If there's any theory you want to learn then I suggest you ask here in this thread and someone will cover it.
I like to imagine ...
User avatar
John Platko
THREAD STARTER
 
Name: John Platko
Posts: 9411
Male

Country: US
United States (us)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#13  Postby John Platko » Nov 12, 2015 7:08 pm

Shrunk wrote:I remember reading an anecdote a while back, but I can't recall the details. I think it was about Leonard Bernstein, but I'm not even sure about that. Anway, Bernstein (or whomever) was giving a lecture on the blues to a group of classical musicians and scholars where he gave a description of the structure of a blues form much as what you describe in #5. Someone asked him "But isn't the blues just a feeling?" to which he replied "Only if you think the sonata form is a 'feeling.'"

I'm not sure I entirely agree with that. I wouldn't go as far as saying it's just a feeling, but I also don't think it can be reduced to the chord sequence. You could play a song using those exact chords without it sounding anything like the blues. OTOH, how many notes to you have to hear of this before you know it's the blues you're listening to? You certainly don't have to hear all 12 bars of the structure.


Yeah - the blues isn't confined to such a rigid structure. I'm just trying to open the door a crack for someone who might not know anything about the blues, or music for that matter, and give them an idea of where blues licks fit in the picture and give them a clue of what I'm talking about.





The analogy I would use is that the blues (or any other musical idiom) is a language. The chord structure is like the grammar and licks or riffs are like idiomatic phrases that identify a fluent speaker of the language from someone who can do no more than speak the language well enough to get his thoughts across, but not with fluency.


But then the question is which licks and riffs? Who defines them? How rigid are these phrases? And what about variations on the phrases? And what about different accents? And how dogmatic could/should one be about these things? My favorite example about the last point, one I imagine all players here are familiar with but which might be new to some is Chuck Berry schooling Keith Richards on "fluent speaking" of one of his idiomatic phrases.

https://vimeo.com/18623223
I like to imagine ...
User avatar
John Platko
THREAD STARTER
 
Name: John Platko
Posts: 9411
Male

Country: US
United States (us)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#14  Postby John Platko » Nov 13, 2015 3:34 pm

In the first part of my very brief overview of blues music I covered the typical structure - 12 bars based on I, IV, and V chords. I also posted a backing track that give the general idea of the musical foundation that a blues solo is often layered on top of- of course you can just play the blues solo without the rest.

One way of looking at the make-up of the blues solo is to see it as a concatenation of blues licks - I'm simplifying but that's the relevant part for where I'm going with this thread.

I think it best to present a few licks in the wild next just so we're all on the same page.



And here's Marty presenting a lick and showing how to use it along with a basic scale to play some blues. I posted this video because Marty shows how you start with a lick idea and then change it around, modify it, bury it with other licks and make something new - that's were I'm going with this thread.



In case you're new to guitars, here's the basics. Normal guitars have 6 strings. And although there are many ways to tune them, standard tuning, from lowest note to highest is, E (82.2 Hz.) A (5 semitones higher) D (5 semitones higher) G ( 5 semitones higher), B (4 semitones higher), E (5 semitones higher (and two octaves higher than the low E)).

Every fret up on the fretboard is a semitone higher. Here's the fretboard layout for standard tuning.

Image

I'll be happy to go into this in more details if there's any interest. The internet and youtube makes this a lot easier to learn then it once was - especially if you have some help sorting through it all. (I'll just mention, if I post a guitar lesson from someone then I think they are great teachers and it's worthwhile checking out their other stuff - I have no affiliation with any of them.)

Now it's time to look at how a lick is represented musically. (ummm. many blues players learned by ear and never learned to read music but I'll be using music notation.

Because guitar tuning is such that there is usually more than one place to play the same note it is helpful to augment standard music notation with another notation that shows exactly where to play a given note. TAB is a guitar music notation designed to do just that. I'll be presenting licks in both standard notation and TAB, there are advantages to each of them.

Here's lick 0, that was in the founder set of licks that I linked to in the OP.

Image

Standard music notation is directly above the TAB notation. From the standard notation we learn the key - signaled by 4 sharps here- so we're in the key of E (Just ask if you want a more detailed explanation of any of this.) The '0" is the lick name I'm giving it. It's to the right of the key signature. The "C" signals we're in common or 4/4 time. That means there are 4 beats to the bar and each beat has the duration of a quarter note. Everything else is pretty basic standard music notation which I imagine everyone is familiar with - but I can find some good links to explain it if necessary.

Below the standard music notation is the TAB staff. Unlike standard music notation where each line represents a note, with TAB each line represents a guitar string. The string tuned the lowest is represented by the lowest line, the string tuned the highest is represented by the highest line - well you get the idea. When we refer to these strings we number them from the top (1) to the bottom (6). (those numbers don't usually appear on TAB- you're just supposed to remember what the lines are refering to.)

The numbers on the line tell you which fret to press down, counting 0 as "open" or don't press anything and 1 as press down the first fret - and so on. Soooo the first 3 we see on the TAB is signaling to press down on the third fret of the high E string - also known as the first string.

But there's also a funny looking curly symbol next to the 3- that's a bend. Guitar players don't always just play the note that you get by fretting a string but sometimes also raise the pitch of that note by bending the string - this add tension and the note goes sharp. The 1/2 means - bend the note one semitone. a 1 would be a whole tone - two semitones - etc. There are lots of different little articulations like this used in blues, and other music, that gives the styles a certain flavor. I'll cover some of these and there notations next.

Lick 3:

Image

The first thing to notice about lick three is that it's only one bar in length. The double lines signal the end of the lick. Then there's the / before the 5. That's an articulation that means to slide your finger into the 5th fret as you pluck the note. Finally, there's the little wavy symbol above the note on the standard notation staff - that means add vibrato to the note as it rings out- B.B King was a master at this. (It probably helped that he was a left handed guy playing a right handed.)

Lick15:

Image

Lick 15 is very similar to lick 0 except that when you get to playing the notes on the second string you pluck the 3rd fret note and then pull you're finger off the fret in a way to make the open string note ring out. This is known as a pull-off. It gives a unique sound and it's one way to help play fast licks.

Similar but different from a pull-off is a hammer-on. So if the notes on the second string were reversed, that is, if you played the open note (B) followed by the third fret (D), then, for the notation I'm using, the same symbol would mean strike the open string and then hammer on the third fret with your finger to make the note ring. It's another unique sound and another way to play faster licks.

I'll stop there and cover some more notation as I go along.

Here's a more complete tutorial of TAB

And if anyone has some favorite licks, I'll try to incorporate them into the thread.
I like to imagine ...
User avatar
John Platko
THREAD STARTER
 
Name: John Platko
Posts: 9411
Male

Country: US
United States (us)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#15  Postby Blip » Nov 14, 2015 2:06 pm

I pointed my OH (a non-member) in the direction of this thread, which he's following with interest.

He wondered if contributors might be interested in this link on blues boxes?
Evolving wrote:Blip, intrepid pilot of light aircraft and wrangler with alligators.
User avatar
Blip
Moderator
 
Posts: 20446
Female

Country: United Kingdom
United Kingdom (uk)
Print view this post

Ads by Google


Re: Developing a heuristic for evolving guitar blues licks

#16  Postby John Platko » Nov 14, 2015 4:51 pm

Blip wrote:I pointed my OH (a non-member) in the direction of this thread, which he's following with interest.

He wondered if contributors might be interested in this link on blues boxes?


The video on that link wouldn't play for me - it said it was unavailable.

I would recommend that someone new to this start by learning what is often called the CAGED system. For people interested in the blues then minor pentatonic scales with and without blue notes. The boxes in the link above are subsets or minor variations of notes found in the CAGED system of "boxes" but the advantage of starting with the pentatonic scale patterns is that you get a bigger picture or map of the fretboard. It gives you the layout of the whole towns, while the smaller boxes are more like zooming in on a neighborhood in a particular town. Once you get the layout of the whole town down, learning the local neighborhoods various artists liked to hang out in makes more sense and you have a context to understand them in, and a way to get from one neighborhood to another - at least that's my way of thinking about this. And once you learn the minor pentatonic CAGED system it's easy to learn how to shift it into the major pentatonic system. And you learn how to move those 5 basic patterns around to play in any key.

And when you're ready for a bigger picture you can see the rest of the county by adding the notes for major/minor scales. And you'll already know how to move those around to play in any key. And then ...

This guy is a good teacher. Here's his basic "5 box" lesson.

http://www.justinguitar.com/en/SC-304-M ... tterns.php

One problem I've found with all this is that people don't use the same names for the same boxes. And even with the CAGED system, where they use the same patterns, they don't label the patterns the same way. For example Justin's C pattern is called a different letter in the system I learned from the Fretboard logic series of books. The patterns are the same but the letter used to name them is different. I think Justin named his by root note position and Bill Edwards, the author of Fretboard logic used the chord shapes he sees in the patterns to name them. This can be very confusing to a beginner, or anyone really. I once contacted both of them about this, they both think their system makes the most sense - such is life. Just beware.
I like to imagine ...
User avatar
John Platko
THREAD STARTER
 
Name: John Platko
Posts: 9411
Male

Country: US
United States (us)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#17  Postby John Platko » Nov 14, 2015 7:24 pm

I mention hammer-ons previously so I thought I'd show a lick that uses one.

Image

The hammer-on is where a finger mashes down on the second fret after the open B string, the second string is picked for the second time. This lick also shows and interesting rhythm figure that plays a big role in blues music and that's the triplet. The triplet can be seen on the standard music staff, It is made up of the last three notes shown that are ganged together with a 3 underneath. Even though the notes look like eight notes, when presented this way you play all three in the time you would play a quarter note. That is, you divide the quarter note into there equal parts.

So at this point you might be asking, how does John make those nice lick music scores - well maybe not but that's what I'm going to talk about next.

I use and LilyPond for music engraving. LilyPond is - well I'll just let the pond people describe it.

LilyPond came about when two musicians wanted to go beyond the soulless look of computer-printed sheet music. Musicians prefer reading beautiful music, so why couldn’t programmers write software to produce elegant printed parts?

From

The result is a program that creates beautiful sheet music following the best traditions of classical music engraving. It takes care of the details of layout programmatically, allowing composers, transcribers and publishers to focus on the music instead of improving their software’s default output. Performers will get parts that let them concentrate on playing music instead of reading it.


It's a free software music engraving program that is very powerful. Even if you have no real interest in blues licks you might want to check out LilyPond if you have any interest in creating music scores in any style. You can learn all about it here. You can download a free copy. Read the manuals etc.

To use LilyPond you describe your music in a text file and then dump that file into LilyPond which then creates a PDF or other format of your score. Now music scores can be complicated and the folks at LilyPond wanted to be able to handle pretty much anything, so LilyPond text files can get pretty complicated - it all depends on what you want to do. Examples of what you can create with LilyPond can be found here. I'll post a few.

Image

Image

The kind of stuff I'm using it for in this thread.

Image

This:

Image

And complex stuff too:

Image

You get the idea ...

I don't plan to get into all the specifics of how I create text input for LilyPond unless there's some specific interest for that but I'll show some LilyPond code so you can get the idea of how it works.

It can be as simple as creating a text file with:

\relative c'' {
c' e' g' e'
}

which will enable LilyPond to create:
Image

That created a simply staff in common time with the notes C E G and E, (the ' above the notes were part of the note octave specification - there are a couple of ways LilyPond handles specifying which octave a given note is in.)

You add numbers after each note to specify note duration.
("4 " means quarter note, "8" means eight note, etc. - and add a "." and you get a dotted note.)

\relative c'' {
a4 a a4. a8
a8. a16 a a8. a8 a4.
}

Creates:
Image

If you have further interest you can start reading here.

Of course guitar players have special needs. And LilyPond takes care of them. You can learn about how here.

Any Flamenco players?

Image

Although LilyPond code is important to my process it's not so important to the concepts that I'll discuss or the actual licks but I thought it worthwhile explaining how these music scores are being produced.

I'll just add, that there's a LilyPond add on for OpenOffice so you can add music scores or snippets to any document you create with OpenOffice (which is a free document editing package). And that's pretty cool! In fact I used it for a tutorial on basic music theory that I wrote a while back. You can get that here and see how LilyPond integrates into a document starting on page 38. (and although there are some errors here and there - you could find a worse introduction to music theory than mine)
I like to imagine ...
User avatar
John Platko
THREAD STARTER
 
Name: John Platko
Posts: 9411
Male

Country: US
United States (us)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#18  Postby Shrunk » Nov 14, 2015 8:23 pm

Blip wrote:I pointed my OH (a non-member) in the direction of this thread, which he's following with interest.

He wondered if contributors might be interested in this link on blues boxes?


I can vividly remember the exact moment when I discovered, just by accident, that moving the "box" patterns for the minor pentatonic scale down three frets, you got the major pentatonic scale. I felt like I had discovered fire.
"A community is infinitely more brutalised by the habitual employment of punishment than it is by the occasional occurrence of crime." -Oscar Wilde
User avatar
Shrunk
 
Posts: 26170
Age: 54
Male

Country: Canada
Canada (ca)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#19  Postby John Platko » Nov 15, 2015 3:51 pm

So far I discussed.

1) The general chord structure commonly used in blues music
2) Examples of guitar blues licks just to give the idea of the thread subject
3) How blues licks are scored with standard music notation and Tab.
4) An overview of LilyPond, a free music engraving software package.

Next I need a software package so that I can write a program to input a set of licks and create new ones from that set. The software package that I'll be using is Python - I'll just let the Python people describe what Python is:

From
What is Python? Executive Summary

Python is an interpreted, object-oriented, high-level programming language with dynamic semantics. Its high-level built in data structures, combined with dynamic typing and dynamic binding, make it very attractive for Rapid Application Development, as well as for use as a scripting or glue language to connect existing components together. Python's simple, easy to learn syntax emphasizes readability and therefore reduces the cost of program maintenance. Python supports modules and packages, which encourages program modularity and code reuse. The Python interpreter and the extensive standard library are available in source or binary form without charge for all major platforms, and can be freely distributed.

Often, programmers fall in love with Python because of the increased productivity it provides. Since there is no compilation step, the edit-test-debug cycle is incredibly fast. Debugging Python programs is easy: a bug or bad input will never cause a segmentation fault. Instead, when the interpreter discovers an error, it raises an exception. When the program doesn't catch the exception, the interpreter prints a stack trace. A source level debugger allows inspection of local and global variables, evaluation of arbitrary expressions, setting breakpoints, stepping through the code a line at a time, and so on. The debugger is written in Python itself, testifying to Python's introspective power. On the other hand, often the quickest way to debug a program is to add a few print statements to the source: the fast edit-test-debug cycle makes this simple approach very effective.


In short, it's a free very comprehensive software environment for noodling around with code. And there are many third party add on packages that can quickly bring more functionality to the basic environment. If you don't know anything/much about programming than this would be a fine place to start (just an opinion - I'm not a programmer - I don't even like programming much ...)

An excellent course in programming where Python is used can be found here

And while I'm recommending courses you might want to check out this course on artificial intelligence. The teacher is not a fan of genetic algorithms but it's still a good course. ;)

And even if you're not interested in all of that but are a chess player who is a bit curious about how computers go about playing so well then you might enjoy the AI lecture on that, which can be found here.

Python's home is here. That will enable you to download the software, get tutorials, manuals, etc.. The nice thing about programming in the world we live in today is that it's easy to get help doing whatever you imagine you want to do. I use Python sporadically, and am as terrible at remembering the exact syntax as I am at spelling but a quick google python question usually turns up the exact code I'm looking for. I'm hoping this will inspire you to start your own Python project and start a thread telling us all about it - no matter what it is.

You can find simple programming examples here.

Python is rather good at working with lists or sets. for example:

friends = ['john', 'pat', 'gary', 'michael']
for i, name in enumerate(friends):
print "iteration {iteration} is {name}".format(iteration=i, name=name)


And it has a nice dictionary capability:

prices = {'apple': 0.40, 'banana': 0.50}
my_purchase = {
'apple': 1,
'banana': 6}
grocery_bill = sum(prices[fruit] * my_purchase[fruit]
for fruit in my_purchase)
print 'I owe the grocer $%.2f' % grocery_bill


I don't plan on going into all the details of the code I'll be talking about (unless that's of interest to someone), I'll be talking more about licks and how to break them down into smaller gestures and mutate them, group them, analyze them individually and collectively - that sort of thing. But the rubber has to hit the road in this thread so the idea is to check the validity of ideas and - well let's just say, it's hard to bullshit a computer.

Any questions about anything I talked about up till now?
I like to imagine ...
User avatar
John Platko
THREAD STARTER
 
Name: John Platko
Posts: 9411
Male

Country: US
United States (us)
Print view this post

Re: Developing a heuristic for evolving guitar blues licks

#20  Postby John Platko » Nov 16, 2015 4:14 pm

At this point we have an overview of "typical" blues music structure and blues licks. LilyPond is my music engraving software and Python provides a software environment and language to develop code that mutates and creates new licks.

Next I'll describe how I'm using all of these pieces.

I'll call the program I develop in Python "LickMaker". LickMaker takes an input set of licks (I'll call that BluesLicks.0) and outputs a new set of licks (I'll call that BluesLicks.1); at this point the output set contains the original licks along with new licks that LickMaker created, but that doesn't always have to be the case. With more advanced heuristics, LickMaker may eliminate licks that were input in the output set.

I wanted the input format of LickMaker to be compatible with the input format of LilyPond. This allows me to create an input set of licks in a text format and then use LilyPond to engrave the text into music notation, which allows me to check that the text file accurately represents the licks I'm going for.

Sooooo.

BluesLicks.0 -> (goes into) LilyPond and LilyPond creates Music Score (e.g. PDF file with music notation)

also

BluesLicks.0 -> LickMaker (my program) and LickMaker creates BluesLicks.1 (which contains the new set of licks.)

And the output of LickMaker is in the same format as the input of LickMaker so.

BluesLicks.1 -> LilyPond creates a Music Score for the new set of licks.

And since BlueLicks.1 is in the same format as BluesLicks.0

BluesLicks.1 -> LickMaker creates BluesLicks.2 which is the next generation of licks ... and so on.

I'm not thinking we're going to get into all the nitty gritty details of this (unless someone is interested in that) but I think it will be helpful to get an idea of the process that is going on so I'll talk a bit more about the format of the BluesLicks.x files.

BluesLicks.x must provide all the information that LilyPond needs to engrave the software, and that is sufficient information to describe the licks to my software too. However, in order to save me some work making a complex parser and, at least to my way of thinking, to make reading licks a bit easier (I find LilyPond code can be cryptic) I use the comment capability in the LilyPond language to embed directives for my software as well as providing places in the output file for my software to tag licks with additional information like, who the licks parents were or what kind of mutation occurred to create it - other information can be saved too, like how many generations old is this lick, is this lick part of the founder set (original set of licks), etc. etc.

I'll give an example of the code that specifies a lick in BluesLicks.X format.

I showed this lick earlier in the thread:

Image

Here's the code for that lick:

%{c%}% 11
%{i%} \mark "11"
% .95 1
%{n%} r2
%{n%} r8
%{n%} b8\2
%{ttt%} \tuplet 3/2 { %{n%} b8\2( %{n%} cis'8\2) %{n%} e'8\1 }
%{bar%} \bar "||"

I'll go though this one line by line but that's just to give the idea of what's going on.

The LilyPond text input language indicates the start of a comment with "%{" and the end of a comment with "%}".
so LickMaker special directives can be found between those markers.

For example, in the first line of the lick (the header) we're covering:

%{c%}% 11

There is a "c" directive which indicates the start of a lick and it's lineage follows. The "11" indicates that it's the 11th member of the founder set. For comparison I'll show the header of a lick LickMaker created:

%{c%}% 1+0(23)

This lick was the offspring of founder set lick member 0 and 1, and it's name is lick 23.

Back to the lick we were discussing - 11.

%{i%} \mark "11"

The second line of all licks is the identity that will be printed on the music score - I change that from time to time to provide more or less information.

Next line:

% .95 1

LilyPond also supports comments where everything on the line after "%" is a comment. That's used on the third line. It's a place where additional information about the lick can be stored. There's only two pieces of information shown here. the .95 is the probability that this is really a blues lick - I call that the Idea True Probability (ITP). The 1 indicates the position on the guitar fretboard the lick is located at. (absent is the key the lick is in, at this point I transpose all licks to the key of E, so far that seems reasonable for the goal of the program but it might change.

Now we get to the meat of the lick.

%{n%} r2

This line specifies a note - it's a rest with half-note duration.

%{n%} r8

Another rest - this time 8th note duration.

%{n%} b8\2

This specifies a second string open string B note of 8th note duration. (the \2 is the string indicator)

Finally we get to

%{ttt%} \tuplet 3/2 { %{n%} b8\2( %{n%} cis'8\2) %{n%} e'8\1 }

Which specifies the triplet. (the %{n%}s just helps my lame parser find the notes. "is" is LilyPond's sharp indicator, ("en" is flat - not used here).

' and , help get the octave of the note right.

The "(" and ")" specify the hammer-on

And finally a lick ends with a double bar terminator.
%{bar%} \bar "||"

That was a simple lick just to give the idea of how licks are specified in BluesLick.x

Besides licks there is some music score header information (key, format size, some definitions, et.) and a footer (guitar tab request, etc..) in BluesLicks.x LickMaker copies this information and pastes it appropriately in the output file it creates.

Any questions?
I like to imagine ...
User avatar
John Platko
THREAD STARTER
 
Name: John Platko
Posts: 9411
Male

Country: US
United States (us)
Print view this post

Next

Return to Technical Design and Engineering.

Who is online

Users viewing this topic: No registered users and 1 guest