#NEWLINE# def __generate_scale_tone( lastChord ) : #NEWLINE# #INDENT# scaleType = scale . WeightedHexatonicBlues ( ) #NEWLINE# if ( lastChord . quality == 'major' ) : #NEWLINE# #INDENT# scaleType = scale . MajorScale ( ) #NEWLINE# #UNINDENT# scales = scaleType . derive ( lastChord ) #NEWLINE# allPitches = list ( set ( [ pitch for pitch in scales . getPitches ( ) ] ) ) #NEWLINE# allNoteNames = [ i . name for i in allPitches ] #NEWLINE# sNoteName = random . choice ( allNoteNames ) #NEWLINE# lastChordSort = lastChord . sortAscending ( ) #NEWLINE# sNoteOctave = random . choice ( [ i . octave for i in lastChordSort . pitches ] ) #NEWLINE# sNote = note . Note ( ( '%s%s' % ( sNoteName , sNoteOctave ) ) ) #NEWLINE# return sNote