From e3f4cdfbb68b0004868f7122c1c4fe0dfeb3ca48 Mon Sep 17 00:00:00 2001 From: William Derksen Date: Sat, 29 Apr 2017 15:53:02 -0400 Subject: [PATCH] finished Toolbox --- blues_solo.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/blues_solo.py b/blues_solo.py index 0408e06..3ec1ec7 100644 --- a/blues_solo.py +++ b/blues_solo.py @@ -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