diff --git a/Ragtime_Piano_SCOTT_JOPLIN_.wav b/Ragtime_Piano_SCOTT_JOPLIN_.wav new file mode 100644 index 0000000..41e1d5c Binary files /dev/null and b/Ragtime_Piano_SCOTT_JOPLIN_.wav differ diff --git a/blues_solo.py b/blues_solo.py index 45791ad..8d8f207 100644 --- a/blues_solo.py +++ b/blues_solo.py @@ -19,6 +19,8 @@ def add_note(out, instr, key_num, duration, bpm, volume): stream *= volume out << stream + + # this controls the sample rate for the sound file you will generate sampling_rate = 44100.0 Wavefile.setDefaults(sampling_rate, 16) @@ -31,6 +33,27 @@ def add_note(out, instr, key_num, duration, bpm, volume): blues_scale = [25, 28, 30, 31, 32, 35, 37, 40, 42, 43, 44, 47, 49, 52, 54, 55, 56, 59, 61] beats_per_minute = 45 # Let's make a slow blues solo -add_note(solo, bass, blues_scale[0], 1.0, beats_per_minute, 1.0) +curr_note = 0 +add_note(solo, bass, blues_scale[curr_note], 1.0, beats_per_minute, 1.0) + + + +licks = [ [ [1,0.5*1.1], [1,0.5*0.9], [1, 0.5*1.1], [1, 0.5*0.9] ], [ [-1, 0.5*1.1], [-1, 0.5*0.9], [-1, 0.5*1.1], [-1, 0.5*0.9] ], [ [-2, 0.5*0.9], [3, 0.5*0.9], [4, 0.5*1.1], [1, 0.5*0.9] ] ] +for i in range(4): + lick = choice(licks) + for note in lick: + curr_note += note[0] + add_note(solo, bass, blues_scale[curr_note], note[1], beats_per_minute, 1.0) + +backing_track = AudioStream(sampling_rate, 1) +Wavefile.read('Ragtime_Piano_SCOTT_JOPLIN_.wav', backing_track) + +m = Mixer() + +solo *= 0.4 # adjust relative volumes to taste +backing_track *= 2.0 + +m.add(2.25, 0, solo) # delay the solo to match up with backing track +m.add(0, 0, backing_track) -solo >> "blues_solo.wav" \ No newline at end of file +m.getStream(500.0) >> "slow_blues.wav" \ No newline at end of file diff --git a/slow_blues.wav b/slow_blues.wav new file mode 100644 index 0000000..11e89e0 Binary files /dev/null and b/slow_blues.wav differ