$30 off During Our Annual Pro Sale. View Details »

Anyone Can Play Guitar

Anyone Can Play Guitar

I’ve got the blues. I’ve been looking for the perfect guitar tone, but haven’t found it. To amp up my mood, let’s teach a computer to play the guitar through an amplifier.

Let’s string together object-oriented principles to orchestrate a blues shuffle. We’ll model our domain with the help of inheritance, composition, and dependency injection. This talk will strike a chord with you, whether you’ve strummed a guitar before or not.

Kevin Murphy

November 09, 2022
Tweet

More Decks by Kevin Murphy

Other Decks in Programming

Transcript

  1. @kevin j m ruby.social kevinjmurphy.com Anyone Can Play Guitar Kevin

    Murphy 🎸 🔊 🎛
  2. @kevin j m ruby.social kevinjmurphy.com Anyone Can Play Guitar Kevin

    Murphy 🎸 🔊 🎛
  3. 📷: Fred Seibert CC BY-NC-ND 2.0

  4. 📷: Jason Lam CC BY 2.0

  5. 📷: Paul Lannuier CC BY-NC-ND 2.0

  6. 📷: Bob Bissett Stevie Ray Vaughan CC BY-SA 4.0 I

    use heavy strings, tune low, play hard, and fl oor it. Floor it. That's technical talk.
  7. Technical Talk

  8. Kevin Murphy @kevin j m @kevin j m@ruby.social

  9. @kevin j m ruby.social kevinjmurphy.com Technical Talk class Guitar end

  10. @kevin j m ruby.social kevinjmurphy.com Technical Talk class Guitar def

    initialize end end
  11. 📷: Bob Bissett Stevie Ray Vaughan CC BY-SA 4.0 I

    use heavy strings
  12. @kevin j m ruby.social kevinjmurphy.com Use Heavy Strings class String

    end
  13. @kevin j m ruby.social kevinjmurphy.com Use Heavy Strings class GuitarString

    end
  14. @kevin j m ruby.social kevinjmurphy.com Use Heavy Strings class GuitarString

    def heavy? end end
  15. @kevin j m ruby.social kevinjmurphy.com Use Heavy Strings 9 11

    16 24 32 42 Common Gauge
  16. @kevin j m ruby.social kevinjmurphy.com Use Heavy Strings 9 11

    16 24 32 42 13 15 19 28 38 58 Common Gauge SRV Gauge
  17. @kevin j m ruby.social kevinjmurphy.com Use Heavy Strings class GuitarString

    def heavy? end end
  18. @kevin j m ruby.social kevinjmurphy.com Use Heavy Strings class GuitarString

    def heavy? gauge_number > common_gauge_number end end
  19. 📷: Bob Bissett Stevie Ray Vaughan CC BY-SA 4.0 I

    use heavy strings
  20. @kevin j m ruby.social kevinjmurphy.com 🎸Use Domain Terms

  21. 📷: Bob Bissett Stevie Ray Vaughan CC BY-SA 4.0 I

    use heavy strings, tune low
  22. @kevin j m ruby.social kevinjmurphy.com Tune Low Standard E B

    G D A E
  23. @kevin j m ruby.social kevinjmurphy.com Tune Low Eb Bb Gb

    Db Ab Eb Standard Down Half Step E B G D A E
  24. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune end end
  25. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard) end end
  26. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard) case tuning end end
  27. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard) case tuning when :standard standard_tuning end end
  28. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard) case tuning when :standard standard_tuning when :down_half_step down_half_step_tuning end end
  29. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard) case tuning when :standard standard_tuning when :down_half_step down_half_step_tuning … end end
  30. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard) case tuning when :standard when :down_half_step when :drop_d when :open_a when :modal_c end end
  31. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard); end end
  32. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard); end def standard_tuning; end end
  33. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard); end def standard_tuning; end def down_half_step_tuning; end end methods with similar names Pick out
  34. @kevin j m ruby.social kevinjmurphy.com class Guitar def tune(tuning =

    :standard); end def standard_tuning; end def down_half_step_tuning; end def drop_d_tuning; end end Tune Low methods with similar names Pick out
  35. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard); end def standard_tuning; end def down_half_step_tuning; end def drop_d_tuning; end def open_a_tuning; end end grouped related behavior Pick out
  36. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard); end def standard_tuning; end def down_half_step_tuning; end def drop_d_tuning; end def open_a_tuning; end def modal_c_tuning; end end grouped related behavior Pick out
  37. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard); end def standard_tuning; end def down_half_step_tuning; end def drop_d_tuning; end def open_a_tuning; end def modal_c_tuning; end … end grouped related behavior Pick out
  38. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard) end end
  39. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard) Tuner.new end end
  40. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard) Tuner.new(self) end end
  41. @kevin j m ruby.social kevinjmurphy.com Tune Low class Guitar def

    tune(tuning = :standard) Tuner.new(self) .tune(tuning) end end
  42. 📷: Bob Bissett Stevie Ray Vaughan CC BY-SA 4.0 I

    use heavy strings, tune low
  43. @kevin j m ruby.social kevinjmurphy.com 🎸Extract Related Behavior

  44. 📷: Bob Bissett Stevie Ray Vaughan CC BY-SA 4.0 I

    use heavy strings, tune low, play hard
  45. @kevin j m ruby.social kevinjmurphy.com Play Hard > a_string =

    GuitarString.new
  46. @kevin j m ruby.social kevinjmurphy.com Play Hard > a_string =

    GuitarString.new > a_string.tune(note: :a)
  47. @kevin j m ruby.social kevinjmurphy.com > a_string.pluck(fret: 0) Play Hard

  48. @kevin j m ruby.social kevinjmurphy.com Play Hard A > a_string.pluck(fret:

    0) => :a
  49. @kevin j m ruby.social kevinjmurphy.com > a_string.pluck(fret: 1) Play Hard

  50. @kevin j m ruby.social kevinjmurphy.com > a_string.pluck(fret: 1) => :b_flat

    Play Hard Bb
  51. @kevin j m ruby.social kevinjmurphy.com > a_string.pluck(fret: 2) => :b

    Play Hard B
  52. @kevin j m ruby.social kevinjmurphy.com > a_string.pluck(fret: 3) => :c

    Play Hard C
  53. @kevin j m ruby.social kevinjmurphy.com Play Hard class Guitar def

    pick(string:, fret:) end end
  54. @kevin j m ruby.social kevinjmurphy.com Play Hard class Guitar def

    pick(string:, fret:) @strings[string -1].pluck(fret: fret) end end
  55. 📷: Bob Bissett Stevie Ray Vaughan CC BY-SA 4.0 I

    use heavy strings, tune low, play hard
  56. @kevin j m ruby.social kevinjmurphy.com 🎸Compose Collaborators

  57. 📷: Bob Bissett Stevie Ray Vaughan CC BY-SA 4.0 I

    use heavy strings, tune low, play hard, and fl oor it.
  58. @kevin j m ruby.social kevinjmurphy.com Floor It > guitar =

    Guitar.new
  59. @kevin j m ruby.social kevinjmurphy.com Floor It > guitar =

    Guitar.new > guitar.restring(gauge_set: :srv)
  60. @kevin j m ruby.social kevinjmurphy.com Floor It > guitar =

    Guitar.new > guitar.restring(gauge_set: :srv) > guitar.tune(:down_half_step)
  61. @kevin j m ruby.social kevinjmurphy.com Floor It > song =

    Blues::Shuffle.new(guitar)
  62. @kevin j m ruby.social kevinjmurphy.com Floor It > song =

    Blues::Shuffle.new(guitar) > song.play
  63. @kevin j m ruby.social kevinjmurphy.com Floor It > song =

    Blues::Shuffle.new(guitar) > song.play => a, e, g_flat, e, g, e, g_flat, e d, a, b, a, c, a, b, a
  64. @kevin j m ruby.social kevinjmurphy.com > guitar.pick(string: 5, fret: 1)

    => :a Play Hard A2
  65. @kevin j m ruby.social kevinjmurphy.com > guitar.pick(string: 3, fret: 3)

    => :a Play Hard A3
  66. @kevin j m ruby.social kevinjmurphy.com > guitar.pick(string: 3, fret: 3)

    => :a Play Hard A3 A2
  67. 📷: Bob Bissett Stevie Ray Vaughan CC BY-SA 4.0 I

    use heavy strings, tune low, play hard, and fl oor it.
  68. 📷: Bob Bissett Stevie Ray Vaughan CC BY-SA 4.0 I

    use heavy strings, tune low, play hard, and fl oor it. Floor it.
  69. @kevin j m ruby.social kevinjmurphy.com Floor It > song =

    Blues::Shuffle.new(guitar)
  70. @kevin j m ruby.social kevinjmurphy.com Floor It > song =

    Blues::Shuffle.new(guitar) > song.play
  71. @kevin j m ruby.social kevinjmurphy.com Floor It > song =

    Blues::Shuffle.new(guitar) > song.play => a2, e3, g_flat3, e3, g3, e3, g_flat3, e3 d3, a3, b3, a3, c4, a3, b3, a3
  72. @kevin j m ruby.social kevinjmurphy.com Floor It class GuitarString def

    pluck(fret:) end end
  73. @kevin j m ruby.social kevinjmurphy.com Floor It class GuitarString def

    pluck(fret:) [note, octave] end end
  74. @kevin j m ruby.social kevinjmurphy.com Floor It note = guitar.pick(hand_position)

  75. @kevin j m ruby.social kevinjmurphy.com Floor It note = guitar.pick(hand_position)

    "#{note.first}#{note.last}"
  76. @kevin j m ruby.social kevinjmurphy.com Floor It note = guitar.pick(hand_position)

    "#{note.first}#{note.last}" unclear names Pick out
  77. @kevin j m ruby.social kevinjmurphy.com class GuitarString def pluck(fret:) end

    end [note, octave] Floor It
  78. @kevin j m ruby.social kevinjmurphy.com class GuitarString def pluck(fret:) end

    end Note.new(self, fret) Floor It
  79. @kevin j m ruby.social kevinjmurphy.com Floor It class Note def

    value; end def octave; end end
  80. @kevin j m ruby.social kevinjmurphy.com note = guitar.pick(hand_position) "#{note.first}#{note.last}" Floor

    It
  81. @kevin j m ruby.social kevinjmurphy.com note = guitar.pick(hand_position) "#{note.value}#{note.octave}" Floor

    It
  82. @kevin j m ruby.social kevinjmurphy.com note = guitar.pick(hand_position) "#{note.value}#{note.octave}" Floor

    It
  83. @kevin j m ruby.social kevinjmurphy.com Floor It class Note def

    value; end def octave; end end
  84. @kevin j m ruby.social kevinjmurphy.com Floor It class Note def

    value; end def octave; end def to_s "#{value[0].upcase}#{'b' if flat?}#{octave}" end end
  85. @kevin j m ruby.social kevinjmurphy.com Floor It note = guitar.pick(hand_position)

    "#{note.value}#{note.octave}"
  86. @kevin j m ruby.social kevinjmurphy.com Floor It guitar.pick(hand_position).to_s

  87. @kevin j m ruby.social kevinjmurphy.com Floor It > song =

    Blues::Shuffle.new(guitar)
  88. @kevin j m ruby.social kevinjmurphy.com Floor It > song =

    Blues::Shuffle.new(guitar) > song.play
  89. @kevin j m ruby.social kevinjmurphy.com Floor It > song =

    Blues::Shuffle.new(guitar) > song.play => A2, E3, Gb3, E3, G3, E3, Gb3, E3 D3, A3, B3, A3, C4, A3, B3, A3
  90. 📷: Bob Bissett Stevie Ray Vaughan CC BY-SA 4.0 I

    use heavy strings, tune low, play hard, and fl oor it. Floor it.
  91. @kevin j m ruby.social kevinjmurphy.com 🎸Elevate Primitives to Objects

  92. 📷: Bob Bissett Stevie Ray Vaughan CC BY-SA 4.0 I

    use heavy strings, tune low, play hard, and fl oor it. Floor it. That's technical talk.
  93. 📷: Paul Lannuier CC BY-NC-ND 2.0

  94. @kevin j m ruby.social kevinjmurphy.com 📷: Tony Cuozzo CC BY

    2.0
  95. Stevie Ray Vaughan @kevin j m The problem with taking

    amps to a shop is that they come back sounding like another amp. 📷: Paul Lannuier CC BY-NC-ND 2.0
  96. @kevin j m ruby.social kevinjmurphy.com Amp class Amplifier end

  97. @kevin j m ruby.social kevinjmurphy.com Amp class Amplifier def amplify(sound)

    end end
  98. @kevin j m ruby.social kevinjmurphy.com Amp class Amplifier def amplify(sound)

    pre_amp_stage(sound) end end
  99. @kevin j m ruby.social kevinjmurphy.com Amp class Amplifier def amplify(sound)

    pre_amp_stage(sound) power_amp_stage(sound) end end
  100. @kevin j m ruby.social kevinjmurphy.com Tube Amp 📷: Kevin Murphy

  101. @kevin j m ruby.social kevinjmurphy.com class TubeAmp end Tube Amp

  102. @kevin j m ruby.social kevinjmurphy.com class TubeAmp def pre_amp_tone end

    end Tube Amp
  103. @kevin j m ruby.social kevinjmurphy.com class TubeAmp def pre_amp_tone if

    low_volume? || mid_volume? "💡" end end end Tube Amp Volume 0 10 Gain 0 10
  104. @kevin j m ruby.social kevinjmurphy.com class TubeAmp def pre_amp_tone if

    low_volume? || mid_volume? "💡" elsif high_volume? "🔥" end end end Tube Amp Volume 0 10 Gain 0 10
  105. @kevin j m ruby.social kevinjmurphy.com Tube Amp > amp =

    TubeAmp.new > amp.weight => :heavy
  106. @kevin j m ruby.social kevinjmurphy.com Tube Amp class TubeAmp end

  107. @kevin j m ruby.social kevinjmurphy.com Tube Amp class TubeAmp <

    Amplifier end
  108. @kevin j m ruby.social kevinjmurphy.com Tube Amp class TubeAmp <

    Amplifier end > amp = TubeAmp.new
  109. @kevin j m ruby.social kevinjmurphy.com Tube Amp class TubeAmp <

    Amplifier end > amp = TubeAmp.new > amp.respond_to?(:amplify)
  110. @kevin j m ruby.social kevinjmurphy.com Tube Amp class TubeAmp <

    Amplifier end > amp = TubeAmp.new > amp.respond_to?(:amplify) => true
  111. @kevin j m ruby.social kevinjmurphy.com Solid State Amp 📷: Kevin

    Murphy
  112. @kevin j m ruby.social kevinjmurphy.com Solid State Amp class SolidStateAmp

    end
  113. @kevin j m ruby.social kevinjmurphy.com Solid State Amp class SolidStateAmp

    def pre_amp_tone end end
  114. @kevin j m ruby.social kevinjmurphy.com Solid State Amp class SolidStateAmp

    def pre_amp_tone "🫙" end end
  115. @kevin j m ruby.social kevinjmurphy.com Solid State Amp class SolidStateAmp

    def pre_amp_tone "🫙" end end Volume 0 10 Gain 0 10
  116. @kevin j m ruby.social kevinjmurphy.com Solid State Amp class SolidStateAmp

    def pre_amp_tone "🫙" end end Volume 0 10 Gain 0 10
  117. @kevin j m ruby.social kevinjmurphy.com Solid State Amp > amp

    = SolidStateAmp.new > amp.weight => :light
  118. @kevin j m ruby.social kevinjmurphy.com Solid State Amp class SolidStateAmp

    end
  119. @kevin j m ruby.social kevinjmurphy.com Solid State Amp class SolidStateAmp

    < Amplifier end
  120. @kevin j m ruby.social kevinjmurphy.com Solid State Amp class SolidStateAmp

    < Amplifier end > amp = SolidStateAmp.new
  121. @kevin j m ruby.social kevinjmurphy.com Solid State Amp class SolidStateAmp

    < Amplifier end > amp = SolidStateAmp.new > amp.respond_to?(:amplify)
  122. @kevin j m ruby.social kevinjmurphy.com Solid State Amp class SolidStateAmp

    < Amplifier end > amp = SolidStateAmp.new > amp.respond_to?(:amplify) => true
  123. @kevin j m ruby.social kevinjmurphy.com 🔊Inherit to Specialize

  124. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp 📷: Kevin Murphy

  125. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp end

  126. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp <

    TubeAmp end
  127. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp <

    TubeAmp, SolidStateAmp end
  128. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp <

    TubeAmp, SolidStateAmp end (irb):2: syntax error, unexpected ',' expecting ';' or '\n'
  129. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class Amplifier def

    amplify(sound) pre_amp_stage(sound) power_amp_stage(sound) end end
  130. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class Amplifier def

    amplify(sound) pre_amp_stage(sound) power_amp_stage(sound) end end
  131. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp module TubePreAmp end

  132. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp module TubePreAmp def

    pre_amp_tone end end
  133. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp module TubePreAmp def

    pre_amp_tone if low_volume? || mid_volume? "💡" elsif high_volume? "🔥" end end end
  134. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp end

  135. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp include

    TubePreAmp end
  136. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp include

    TubePreAmp end > amp = HybridAmp.new(volume: 10)
  137. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp include

    TubePreAmp end > amp = HybridAmp.new(volume: 10) > amp.pre_amp_tone
  138. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp include

    TubePreAmp end > amp = HybridAmp.new(volume: 10) > amp.pre_amp_tone => "🔥"
  139. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class Amplifier def

    amplify(sound) pre_amp_stage(sound) power_amp_stage(sound) end end
  140. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp module SolidStatePowerAmp end

  141. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp module SolidStatePowerAmp def

    power_amp_weight end end
  142. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp module SolidStatePowerAmp def

    power_amp_weight :light end end
  143. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp include

    TubePreAmp end
  144. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp include

    TubePreAmp, SolidStatePowerAmp end
  145. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp include

    TubePreAmp, SolidStatePowerAmp end > amp = HybridAmp.new(volume: 10)
  146. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp include

    TubePreAmp, SolidStatePowerAmp end > amp = HybridAmp.new(volume: 10) > amp.power_amp_weight
  147. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp include

    TubePreAmp, SolidStatePowerAmp end > amp = HybridAmp.new(volume: 10) > amp.power_amp_weight => :light
  148. @kevin j m ruby.social kevinjmurphy.com 🔊Compose to Share Behavior

  149. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp include

    TubePreAmp, SolidStatePowerAmp end
  150. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp <

    Amplifier include TubePreAmp, SolidStatePowerAmp end
  151. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp <

    Amplifier include TubePreAmp, SolidStatePowerAmp end > amp = HybridAmp.new(volume: 10)
  152. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp <

    Amplifier include TubePreAmp, SolidStatePowerAmp end > amp = HybridAmp.new(volume: 10) > amp.respond_to?(:amplify)
  153. @kevin j m ruby.social kevinjmurphy.com Hybrid Amp class HybridAmp <

    Amplifier include TubePreAmp, SolidStatePowerAmp end > amp = HybridAmp.new(volume: 10) > amp.respond_to?(:amplify) => true
  154. Stevie Ray Vaughan @kevin j m I fi gured out

    how to get the guitar to rumble. 📷: Paul Lannuier CC BY-NC-ND 2.0
  155. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > amp

    = SolidStateAmp.new(volume: 5) 

  156. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > amp

    = SolidStateAmp.new(volume: 5) > amp.turn_on 

  157. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > amp

    = SolidStateAmp.new(volume: 5) > amp.turn_on 
 > guitar = Guitar.new
  158. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > amp

    = SolidStateAmp.new(volume: 5) > amp.turn_on 
 > guitar = Guitar.new > song = Blues::Shuffle.new(guitar)
  159. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > amp

    = SolidStateAmp.new(volume: 5) > amp.turn_on 
 > guitar = Guitar.new > song = Blues::Shuffle.new(guitar) > song.play { |sound| amp.amplify(sound) }
  160. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > amp

    = SolidStateAmp.new(volume: 5) > amp.turn_on 
 > guitar = Guitar.new > song = Blues::Shuffle.new(guitar) > song.play { |sound| amp.amplify(sound) } => A2
  161. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > amp

    = SolidStateAmp.new(volume: 5) > amp.turn_on 
 > guitar = Guitar.new > song = Blues::Shuffle.new(guitar) > song.play { |sound| amp.amplify(sound) } => A2🫙
  162. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > amp

    = SolidStateAmp.new(volume: 5) > amp.turn_on 
 > guitar = Guitar.new > song = Blues::Shuffle.new(guitar) > song.play { |sound| amp.amplify(sound) } => A2🫙🔊[5]
  163. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > amp

    = SolidStateAmp.new(volume: 5) > amp.turn_on 
 > guitar = Guitar.new > song = Blues::Shuffle.new(guitar) > song.play { |sound| amp.amplify(sound) } => A2🫙🔊[5]…D3🫙🔊[5]…A2🫙🔊[5]…E3🫙🔊[5]
  164. 📷: Kevin Murphy

  165. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > guitar

    = Guitar.new
  166. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > guitar

    = Guitar.new > song = Blues::Shuffle.new(guitar)
  167. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > guitar

    = Guitar.new > song = Blues::Shuffle.new(guitar) > song.play
  168. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble class Guitar

    def initialize end end
  169. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble class Guitar

    def initialize @amplifier = SolidStateAmp.new(volume: 5) end end
  170. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble class Guitar

    def pick(string:, fret:) note = @strings[string -1].pluck(fret: fret) end end
  171. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble class Guitar

    def pick(string:, fret:) note = @strings[string -1].pluck(fret: fret) @amplifier.amplify(note) end end
  172. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > guitar

    = Guitar.new
  173. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > guitar

    = Guitar.new > song = Blues::Shuffle.new(guitar)
  174. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > guitar

    = Guitar.new > song = Blues::Shuffle.new(guitar) > song.play
  175. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > guitar

    = Guitar.new > song = Blues::Shuffle.new(guitar) > song.play => A2🫙🔊[5]…D3🫙🔊[5]…A2🫙🔊[5]…E3🫙🔊[5]
  176. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble class Guitar

    def initialize @amplifier = SolidStateAmp.new(volume: 5) end end
  177. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble class Guitar

    def initialize @amplifier = TubeAmp.new(volume: 9) end end
  178. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > guitar

    = Guitar.new > song = Blues::Shuffle.new(guitar) > song.play => 🔇🔇[0]…D3💡🔈[1]…A2💡🔉[6]…E3🔥🔊[9]
  179. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble class Guitar

    def initialize @amplifier = TubeAmp.new(volume: 9) end end
  180. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble class Guitar

    def initialize end end
  181. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble class Guitar

    def initialize(amplifier: nil) end end
  182. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble class Guitar

    def initialize(amplifier: nil) @amplifier = amplifier end end
  183. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > solid_state_amp

    = SolidStateAmp.new(volume: 5) > Guitar.new(amplifier: solid_state_amp)
  184. @kevin j m ruby.social kevinjmurphy.com Hear the Rumble > solid_state_amp

    = SolidStateAmp.new(volume: 5) > Guitar.new(amplifier: solid_state_amp) > tube_amp = TubeAmp.new(volume: 9) > Guitar.new(amplifier: tube_amp)
  185. @kevin j m ruby.social kevinjmurphy.com 🎛Inject for Flexibility

  186. 📷: Bob Bissett CC BY-SA 4.0

  187. @kevin j m ruby.social kevinjmurphy.com Choices, Choices, Choices class HybridAmp

    < Amplifier
  188. @kevin j m ruby.social kevinjmurphy.com Choices, Choices, Choices class HybridAmp

    < Amplifier include TubePreAmp
  189. @kevin j m ruby.social kevinjmurphy.com Choices, Choices, Choices class HybridAmp

    < Amplifier include TubePreAmp class Guitar def tune = Tuner.new(self).tune
  190. @kevin j m ruby.social kevinjmurphy.com Choices, Choices, Choices class HybridAmp

    < Amplifier include TubePreAmp class Guitar def tune = Tuner.new(self).tune class Guitar def initialize(amplifier:)
  191. @kevin j m ruby.social kevinjmurphy.com Model YOUR Reality > amp

    = HybridAmp.new 

  192. @kevin j m ruby.social kevinjmurphy.com Model YOUR Reality > amp

    = HybridAmp.new 
 Consistency 0 10
  193. @kevin j m ruby.social kevinjmurphy.com Model YOUR Reality > amp

    = HybridAmp.new 
 Flexibility 0 10
  194. @kevin j m ruby.social kevinjmurphy.com Model YOUR Reality > amp

    = HybridAmp.new > guitar = Guitar.new(amplifier: amp) 

  195. @kevin j m ruby.social kevinjmurphy.com Model YOUR Reality > amp

    = HybridAmp.new > guitar = Guitar.new(amplifier: amp) 
 0 10 Flexibility
  196. @kevin j m ruby.social kevinjmurphy.com Model YOUR Reality > amp

    = HybridAmp.new > guitar = Guitar.new(amplifier: amp) 
 > guitar.tune(:down_half_step)
  197. @kevin j m ruby.social kevinjmurphy.com Model YOUR Reality > amp

    = HybridAmp.new > guitar = Guitar.new(amplifier: amp) 
 > guitar.tune(:down_half_step) collaborators to extract Pick out
  198. @kevin j m ruby.social kevinjmurphy.com Model YOUR Reality > amp

    = HybridAmp.new > guitar = Guitar.new(amplifier: amp) 
 > guitar.tune(:down_half_step) > song = Blues::Shuffle.new(guitar)
  199. @kevin j m ruby.social kevinjmurphy.com Model YOUR Reality > amp

    = HybridAmp.new > guitar = Guitar.new(amplifier: amp) 
 > guitar.tune(:down_half_step) > song = Blues::Shuffle.new(guitar) > song.play
  200. @kevin j m ruby.social kevinjmurphy.com Model YOUR Reality > amp

    = HybridAmp.new > guitar = Guitar.new(amplifier: amp) 
 > guitar.tune(:down_half_step) > song = Blues::Shuffle.new(guitar) > song.play => 🔇🔇[0]…D3💡🔈[1]…A2💡🔉[6]…E3🔥🔊[9]
  201. Stevie Ray Vaughan @kevin j m I don't know the

    names of what it is I'm doing. 📷: Paul Lannuier CC BY-NC-ND 2.0
  202. Stevie Ray Vaughan @kevin j m I learned how to

    make the sounds with my mouth and then copied that with my guitar. 📷: Paul Lannuier CC BY-NC-ND 2.0
  203. @kevin j m ruby.social kevinjmurphy.com Make the Sounds > guitar.plug_in(amplifier:

    SonicPiAmp.new)
  204. @kevin j m ruby.social kevinjmurphy.com Make the Sounds > guitar.plug_in(amplifier:

    SonicPiAmp.new) > song.play
  205. None
  206. 📷: Kevin Murphy kevinjmurphy.com/play-guitar @kevin j m @kevin j m@ruby.social

  207. 📷: Kevin Murphy kevinjmurphy.com/play-guitar @kevin j m @kevin j m@ruby.social

  208. None