Music AI Program

Patrick W patrickw106 at yahoo.com.au
Sun Dec 15 00:19:02 EST 2002


"Joel" <unimatrix001au at yahoo.com.au> writes:

>     I've been trying to get a genetic algorithm program started, for
> creating guitar riffs. You train it by telling it if the riff is good or
> bad, and what notes make it sound good or bad, and it adjusts its algorithms
> accordingly. It selects different scales and styles, different moods etc.
> 
>     I'm trying to find a way to give the computer all the strings. I've
> tried variables such as e4=4 for E string fret 4, with a dummy value of
> 4...all 22 of them for every string, but I'm not really sure what would work
> best. I only finished a Python tutorial a few weeks back!
> 
>     If anyone has any ideas, hints or help on declaring the strings,
>     and

You could represent the guitar neck as a simple 6 x 12 array (or "list
of lists" in Python), one dimension being the strings, the other
dimension being the frets.

But, rather than composing the riffs in terms of positions on the
guitar neck, why not have your algorithm compose riffs in terms of
*notes*, randomly generating melodies from scales and arpeggios that
work over a given set of chord changes.  You could then have a
separate dictionary that maps each musical note to a list of possible
string & fret positions on the neck.

Based on what you've written, it's hard to say whether you've
considered this and rejected it, or whether it hasn't occurred to you.



More information about the Python-list mailing list