Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions blues_solo.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ def stop():

# These are the piano key numbers for a 3-octave blues scale in A. See: http://en.wikipedia.org/wiki/Blues_scale
blues_scale = [40, 43, 45, 46, 47, 50, 52, 55, 57, 58, 59, 62, 64, 67, 69, 70, 71, 74, 76]
beats_per_minute = 45 # Let's make a slow blues solo

play_note(blues_scale[0], beats=1, bpm=beats_per_minute)
beats_per_minute = 180 # Let's make a slow blues solo

curr_note = 0
play_note(blues_scale[curr_note], 1, beats_per_minute)
licks = [[(1, 0.5*1.2), (1, 0.5*.8), (1, 0.5*1.2), (1, 0.5*.8)],[(-1, 0.5*1.2), (-1, 0.5*.8), (-1, 0.5*1.2), (-1, 0.5*.8)],[(1, 0.5*1.2), (1, 0.5*.8), (-3, 0.5*1.2), (1, 0.5*.8)]]
dynamics = [[1.2, 1.4, 1.6, 1.8], [1, 1, 1, 1], [.8, .6, .4, .2]]
for a in range(20):
lick = choice(licks)
dynam = choice(dynamics)
i = 0
for note in lick:
curr_note += note[0]
curr_vol = dynam[i]
play_note(blues_scale[curr_note], note[1], beats_per_minute, curr_vol)
i+=1