From e890075e4fc05651cf842186cb5dac8ca6955363 Mon Sep 17 00:00:00 2001 From: KatieButler Date: Mon, 28 Mar 2016 21:07:43 -0400 Subject: [PATCH 1/2] it plays some notes --- blues_solo.py | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/blues_solo.py b/blues_solo.py index 45791ad..d54f24d 100644 --- a/blues_solo.py +++ b/blues_solo.py @@ -33,4 +33,22 @@ def add_note(out, instr, key_num, duration, bpm, volume): add_note(solo, bass, blues_scale[0], 1.0, beats_per_minute, 1.0) -solo >> "blues_solo.wav" \ No newline at end of file +curr_note = 0 +add_note(solo, bass, blues_scale[curr_note], 1.0, beats_per_minute, 1.0) + +licks = [ [ [1,0.5], [1,0.5], [1, 0.5], [1, 0.5] ],[ [-1, 0.5], [-1, 0.5], [-1, 0.5], [-1, 0.5] ] ] + +for lick in range(8): + lick = choice(licks) + curr_beat = 0 + for note in lick: + prev_note = curr_note + curr_note += note[0] + duration = note[1] + if curr_note < 0 or curr_note > len(blues_scale) - 1: + curr_note = prev_note + duration = 2 - curr_beat + add_note(solo, bass, blues_scale[curr_note], note[1], beats_per_minute, 1.0) + curr_beat+=note[1] + +solo >> "blues_solo.wav" From 0ff4db3a05a1295694ae3b10eadcf5e6c75b4eed Mon Sep 17 00:00:00 2001 From: KatieButler Date: Mon, 28 Mar 2016 21:11:35 -0400 Subject: [PATCH 2/2] it plays some swingy notes --- blues_solo.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/blues_solo.py b/blues_solo.py index d54f24d..166b0ba 100644 --- a/blues_solo.py +++ b/blues_solo.py @@ -36,7 +36,7 @@ def add_note(out, instr, key_num, duration, bpm, volume): curr_note = 0 add_note(solo, bass, blues_scale[curr_note], 1.0, beats_per_minute, 1.0) -licks = [ [ [1,0.5], [1,0.5], [1, 0.5], [1, 0.5] ],[ [-1, 0.5], [-1, 0.5], [-1, 0.5], [-1, 0.5] ] ] +licks = [ [ [1,0.5*1.1], [1,0.5*.9], [1, 0.5*1.1], [1, 0.5*.9] ],[ [-1, 0.5*.9], [-1, 0.5*1.1], [-1, 0.5*.9], [-1, 0.5*1.1] ] ] for lick in range(8): lick = choice(licks)