@kevin j m
ruby.social
kevinjmurphy.com
Technical Talk
class Guitar
end
Slide 10
Slide 10 text
@kevin j m
ruby.social
kevinjmurphy.com
Technical Talk
class Guitar
def initialize
end
end
Slide 11
Slide 11 text
π·: Bob Bissett
Stevie Ray Vaughan
CC BY-SA 4.0
I use heavy strings
Slide 12
Slide 12 text
@kevin j m
ruby.social
kevinjmurphy.com
Use Heavy Strings
class String
end
Slide 13
Slide 13 text
@kevin j m
ruby.social
kevinjmurphy.com
Use Heavy Strings
class GuitarString
end
Slide 14
Slide 14 text
@kevin j m
ruby.social
kevinjmurphy.com
Use Heavy Strings
class GuitarString
def heavy?
end
end
Slide 15
Slide 15 text
@kevin j m
ruby.social
kevinjmurphy.com
Use Heavy Strings
9
11
16
24
32
42
Common Gauge
Slide 16
Slide 16 text
@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
Slide 17
Slide 17 text
@kevin j m
ruby.social
kevinjmurphy.com
Use Heavy Strings
class GuitarString
def heavy?
end
end
Slide 18
Slide 18 text
@kevin j m
ruby.social
kevinjmurphy.com
Use Heavy Strings
class GuitarString
def heavy?
gauge_number > common_gauge_number
end
end
Slide 19
Slide 19 text
π·: Bob Bissett
Stevie Ray Vaughan
CC BY-SA 4.0
I use heavy strings
Slide 20
Slide 20 text
@kevin j m
ruby.social
kevinjmurphy.com
πΈUse Domain Terms
Slide 21
Slide 21 text
π·: Bob Bissett
Stevie Ray Vaughan
CC BY-SA 4.0
I use heavy strings,
tune low
Slide 22
Slide 22 text
@kevin j m
ruby.social
kevinjmurphy.com
Tune Low
Standard
E
B
G
D
A
E
Slide 23
Slide 23 text
@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
Slide 24
Slide 24 text
@kevin j m
ruby.social
kevinjmurphy.com
Tune Low
class Guitar
def tune
end
end
Slide 25
Slide 25 text
@kevin j m
ruby.social
kevinjmurphy.com
Tune Low
class Guitar
def tune(tuning = :standard)
end
end
Slide 26
Slide 26 text
@kevin j m
ruby.social
kevinjmurphy.com
Tune Low
class Guitar
def tune(tuning = :standard)
case tuning
end
end
Slide 27
Slide 27 text
@kevin j m
ruby.social
kevinjmurphy.com
Tune Low
class Guitar
def tune(tuning = :standard)
case tuning
when :standard
standard_tuning
end
end
Slide 28
Slide 28 text
@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
Slide 29
Slide 29 text
@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
Slide 30
Slide 30 text
@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
Slide 31
Slide 31 text
@kevin j m
ruby.social
kevinjmurphy.com
Tune Low
class Guitar
def tune(tuning = :standard); end
end
Slide 32
Slide 32 text
@kevin j m
ruby.social
kevinjmurphy.com
Tune Low
class Guitar
def tune(tuning = :standard); end
def standard_tuning; end
end
Slide 33
Slide 33 text
@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
Slide 34
Slide 34 text
@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
Slide 35
Slide 35 text
@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
Slide 36
Slide 36 text
@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
Slide 37
Slide 37 text
@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
Slide 38
Slide 38 text
@kevin j m
ruby.social
kevinjmurphy.com
Tune Low
class Guitar
def tune(tuning = :standard)
end
end
Slide 39
Slide 39 text
@kevin j m
ruby.social
kevinjmurphy.com
Tune Low
class Guitar
def tune(tuning = :standard)
Tuner.new
end
end
Slide 40
Slide 40 text
@kevin j m
ruby.social
kevinjmurphy.com
Tune Low
class Guitar
def tune(tuning = :standard)
Tuner.new(self)
end
end
Slide 41
Slide 41 text
@kevin j m
ruby.social
kevinjmurphy.com
Tune Low
class Guitar
def tune(tuning = :standard)
Tuner.new(self)
.tune(tuning)
end
end
Slide 42
Slide 42 text
π·: Bob Bissett
Stevie Ray Vaughan
CC BY-SA 4.0
I use heavy strings,
tune low
Slide 43
Slide 43 text
@kevin j m
ruby.social
kevinjmurphy.com
πΈExtract Related Behavior
Slide 44
Slide 44 text
π·: Bob Bissett
Stevie Ray Vaughan
CC BY-SA 4.0
I use heavy strings,
tune low,
play hard
Slide 45
Slide 45 text
@kevin j m
ruby.social
kevinjmurphy.com
Play Hard
> a_string = GuitarString.new
Slide 46
Slide 46 text
@kevin j m
ruby.social
kevinjmurphy.com
Play Hard
> a_string = GuitarString.new
> a_string.tune(note: :a)
Slide 47
Slide 47 text
@kevin j m
ruby.social
kevinjmurphy.com
> a_string.pluck(fret: 0)
Play Hard
Slide 48
Slide 48 text
@kevin j m
ruby.social
kevinjmurphy.com
Play Hard
A
> a_string.pluck(fret: 0) => :a
Slide 49
Slide 49 text
@kevin j m
ruby.social
kevinjmurphy.com
> a_string.pluck(fret: 1)
Play Hard
Slide 50
Slide 50 text
@kevin j m
ruby.social
kevinjmurphy.com
> a_string.pluck(fret: 1) => :b_flat
Play Hard
Bb
Slide 51
Slide 51 text
@kevin j m
ruby.social
kevinjmurphy.com
> a_string.pluck(fret: 2) => :b
Play Hard
B
Slide 52
Slide 52 text
@kevin j m
ruby.social
kevinjmurphy.com
> a_string.pluck(fret: 3) => :c
Play Hard
C
Slide 53
Slide 53 text
@kevin j m
ruby.social
kevinjmurphy.com
Play Hard
class Guitar
def pick(string:, fret:)
end
end
Slide 54
Slide 54 text
@kevin j m
ruby.social
kevinjmurphy.com
Play Hard
class Guitar
def pick(string:, fret:)
@strings[string -1].pluck(fret: fret)
end
end
Slide 55
Slide 55 text
π·: Bob Bissett
Stevie Ray Vaughan
CC BY-SA 4.0
I use heavy strings,
tune low,
play hard
Slide 56
Slide 56 text
@kevin j m
ruby.social
kevinjmurphy.com
πΈCompose Collaborators
Slide 57
Slide 57 text
π·: Bob Bissett
Stevie Ray Vaughan
CC BY-SA 4.0
I use heavy strings,
tune low,
play hard,
and
fl
oor it.
Slide 58
Slide 58 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
> guitar = Guitar.new
Slide 59
Slide 59 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
> guitar = Guitar.new
> guitar.restring(gauge_set: :srv)
Slide 60
Slide 60 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
> guitar = Guitar.new
> guitar.restring(gauge_set: :srv)
> guitar.tune(:down_half_step)
Slide 61
Slide 61 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
> song = Blues::Shuffle.new(guitar)
Slide 62
Slide 62 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
> song = Blues::Shuffle.new(guitar)
> song.play
Slide 63
Slide 63 text
@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
Slide 64
Slide 64 text
@kevin j m
ruby.social
kevinjmurphy.com
> guitar.pick(string: 5, fret: 1) => :a
Play Hard
A2
Slide 65
Slide 65 text
@kevin j m
ruby.social
kevinjmurphy.com
> guitar.pick(string: 3, fret: 3) => :a
Play Hard
A3
Slide 66
Slide 66 text
@kevin j m
ruby.social
kevinjmurphy.com
> guitar.pick(string: 3, fret: 3) => :a
Play Hard
A3
A2
Slide 67
Slide 67 text
π·: Bob Bissett
Stevie Ray Vaughan
CC BY-SA 4.0
I use heavy strings,
tune low,
play hard,
and
fl
oor it.
Slide 68
Slide 68 text
π·: Bob Bissett
Stevie Ray Vaughan
CC BY-SA 4.0
I use heavy strings,
tune low,
play hard,
and
fl
oor it.
Floor it.
Slide 69
Slide 69 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
> song = Blues::Shuffle.new(guitar)
Slide 70
Slide 70 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
> song = Blues::Shuffle.new(guitar)
> song.play
Slide 71
Slide 71 text
@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
Slide 72
Slide 72 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
class GuitarString
def pluck(fret:)
end
end
Slide 73
Slide 73 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
class GuitarString
def pluck(fret:)
[note, octave]
end
end
Slide 74
Slide 74 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
note = guitar.pick(hand_position)
Slide 75
Slide 75 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
note = guitar.pick(hand_position)
"#{note.first}#{note.last}"
Slide 76
Slide 76 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
note = guitar.pick(hand_position)
"#{note.first}#{note.last}"
unclear names
Pick
out
Slide 77
Slide 77 text
@kevin j m
ruby.social
kevinjmurphy.com
class GuitarString
def pluck(fret:)
end
end
[note, octave]
Floor It
Slide 78
Slide 78 text
@kevin j m
ruby.social
kevinjmurphy.com
class GuitarString
def pluck(fret:)
end
end
Note.new(self, fret)
Floor It
Slide 79
Slide 79 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
class Note
def value; end
def octave; end
end
Slide 80
Slide 80 text
@kevin j m
ruby.social
kevinjmurphy.com
note = guitar.pick(hand_position)
"#{note.first}#{note.last}"
Floor It
Slide 81
Slide 81 text
@kevin j m
ruby.social
kevinjmurphy.com
note = guitar.pick(hand_position)
"#{note.value}#{note.octave}"
Floor It
Slide 82
Slide 82 text
@kevin j m
ruby.social
kevinjmurphy.com
note = guitar.pick(hand_position)
"#{note.value}#{note.octave}"
Floor It
Slide 83
Slide 83 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
class Note
def value; end
def octave; end
end
Slide 84
Slide 84 text
@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
Slide 85
Slide 85 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
note = guitar.pick(hand_position)
"#{note.value}#{note.octave}"
Slide 86
Slide 86 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
guitar.pick(hand_position).to_s
Slide 87
Slide 87 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
> song = Blues::Shuffle.new(guitar)
Slide 88
Slide 88 text
@kevin j m
ruby.social
kevinjmurphy.com
Floor It
> song = Blues::Shuffle.new(guitar)
> song.play
Slide 89
Slide 89 text
@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
Slide 90
Slide 90 text
π·: Bob Bissett
Stevie Ray Vaughan
CC BY-SA 4.0
I use heavy strings,
tune low,
play hard,
and
fl
oor it.
Floor it.
Slide 91
Slide 91 text
@kevin j m
ruby.social
kevinjmurphy.com
πΈElevate Primitives to Objects
Slide 92
Slide 92 text
π·: 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.
Slide 93
Slide 93 text
π·: Paul Lannuier CC BY-NC-ND 2.0
Slide 94
Slide 94 text
@kevin j m
ruby.social
kevinjmurphy.com
π·: Tony Cuozzo CC BY 2.0
Slide 95
Slide 95 text
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
Slide 96
Slide 96 text
@kevin j m
ruby.social
kevinjmurphy.com
Amp
class Amplifier
end
Slide 97
Slide 97 text
@kevin j m
ruby.social
kevinjmurphy.com
Amp
class Amplifier
def amplify(sound)
end
end
Slide 98
Slide 98 text
@kevin j m
ruby.social
kevinjmurphy.com
Amp
class Amplifier
def amplify(sound)
pre_amp_stage(sound)
end
end
Slide 99
Slide 99 text
@kevin j m
ruby.social
kevinjmurphy.com
Amp
class Amplifier
def amplify(sound)
pre_amp_stage(sound)
power_amp_stage(sound)
end
end
Slide 100
Slide 100 text
@kevin j m
ruby.social
kevinjmurphy.com
Tube Amp
π·: Kevin Murphy
Slide 101
Slide 101 text
@kevin j m
ruby.social
kevinjmurphy.com
class TubeAmp
end
Tube Amp
Slide 102
Slide 102 text
@kevin j m
ruby.social
kevinjmurphy.com
class TubeAmp
def pre_amp_tone
end
end
Tube Amp
Slide 103
Slide 103 text
@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
Slide 104
Slide 104 text
@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
@kevin j m
ruby.social
kevinjmurphy.com
Tube Amp
class TubeAmp
end
Slide 107
Slide 107 text
@kevin j m
ruby.social
kevinjmurphy.com
Tube Amp
class TubeAmp < Amplifier
end
Slide 108
Slide 108 text
@kevin j m
ruby.social
kevinjmurphy.com
Tube Amp
class TubeAmp < Amplifier
end
> amp = TubeAmp.new
Slide 109
Slide 109 text
@kevin j m
ruby.social
kevinjmurphy.com
Tube Amp
class TubeAmp < Amplifier
end
> amp = TubeAmp.new
> amp.respond_to?(:amplify)
Slide 110
Slide 110 text
@kevin j m
ruby.social
kevinjmurphy.com
Tube Amp
class TubeAmp < Amplifier
end
> amp = TubeAmp.new
> amp.respond_to?(:amplify)
=> true
Slide 111
Slide 111 text
@kevin j m
ruby.social
kevinjmurphy.com
Solid State Amp
π·: Kevin Murphy
Slide 112
Slide 112 text
@kevin j m
ruby.social
kevinjmurphy.com
Solid State Amp
class SolidStateAmp
end
Slide 113
Slide 113 text
@kevin j m
ruby.social
kevinjmurphy.com
Solid State Amp
class SolidStateAmp
def pre_amp_tone
end
end
Slide 114
Slide 114 text
@kevin j m
ruby.social
kevinjmurphy.com
Solid State Amp
class SolidStateAmp
def pre_amp_tone
"π«"
end
end
Slide 115
Slide 115 text
@kevin j m
ruby.social
kevinjmurphy.com
Solid State Amp
class SolidStateAmp
def pre_amp_tone
"π«"
end
end
Volume
0 10
Gain
0 10
Slide 116
Slide 116 text
@kevin j m
ruby.social
kevinjmurphy.com
Solid State Amp
class SolidStateAmp
def pre_amp_tone
"π«"
end
end
Volume
0 10
Gain
0 10
Slide 117
Slide 117 text
@kevin j m
ruby.social
kevinjmurphy.com
Solid State Amp
> amp = SolidStateAmp.new
> amp.weight
=> :light
Slide 118
Slide 118 text
@kevin j m
ruby.social
kevinjmurphy.com
Solid State Amp
class SolidStateAmp
end
Slide 119
Slide 119 text
@kevin j m
ruby.social
kevinjmurphy.com
Solid State Amp
class SolidStateAmp < Amplifier
end
Slide 120
Slide 120 text
@kevin j m
ruby.social
kevinjmurphy.com
Solid State Amp
class SolidStateAmp < Amplifier
end
> amp = SolidStateAmp.new
Slide 121
Slide 121 text
@kevin j m
ruby.social
kevinjmurphy.com
Solid State Amp
class SolidStateAmp < Amplifier
end
> amp = SolidStateAmp.new
> amp.respond_to?(:amplify)
Slide 122
Slide 122 text
@kevin j m
ruby.social
kevinjmurphy.com
Solid State Amp
class SolidStateAmp < Amplifier
end
> amp = SolidStateAmp.new
> amp.respond_to?(:amplify)
=> true
Slide 123
Slide 123 text
@kevin j m
ruby.social
kevinjmurphy.com
πInherit to Specialize
Slide 124
Slide 124 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
π·: Kevin Murphy
Slide 125
Slide 125 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp
end
Slide 126
Slide 126 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp < TubeAmp
end
Slide 127
Slide 127 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp < TubeAmp, SolidStateAmp
end
Slide 128
Slide 128 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp < TubeAmp, SolidStateAmp
end
(irb):2: syntax error, unexpected ','
expecting ';' or '\n'
Slide 129
Slide 129 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class Amplifier
def amplify(sound)
pre_amp_stage(sound)
power_amp_stage(sound)
end
end
Slide 130
Slide 130 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class Amplifier
def amplify(sound)
pre_amp_stage(sound)
power_amp_stage(sound)
end
end
Slide 131
Slide 131 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
module TubePreAmp
end
Slide 132
Slide 132 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
module TubePreAmp
def pre_amp_tone
end
end
Slide 133
Slide 133 text
@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
Slide 134
Slide 134 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp
end
Slide 135
Slide 135 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp
include TubePreAmp
end
Slide 136
Slide 136 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp
include TubePreAmp
end
> amp = HybridAmp.new(volume: 10)
Slide 137
Slide 137 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp
include TubePreAmp
end
> amp = HybridAmp.new(volume: 10)
> amp.pre_amp_tone
Slide 138
Slide 138 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp
include TubePreAmp
end
> amp = HybridAmp.new(volume: 10)
> amp.pre_amp_tone
=> "π₯"
Slide 139
Slide 139 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class Amplifier
def amplify(sound)
pre_amp_stage(sound)
power_amp_stage(sound)
end
end
Slide 140
Slide 140 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
module SolidStatePowerAmp
end
Slide 141
Slide 141 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
module SolidStatePowerAmp
def power_amp_weight
end
end
Slide 142
Slide 142 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
module SolidStatePowerAmp
def power_amp_weight
:light
end
end
Slide 143
Slide 143 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp
include TubePreAmp
end
Slide 144
Slide 144 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp
include TubePreAmp, SolidStatePowerAmp
end
Slide 145
Slide 145 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp
include TubePreAmp, SolidStatePowerAmp
end
> amp = HybridAmp.new(volume: 10)
Slide 146
Slide 146 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp
include TubePreAmp, SolidStatePowerAmp
end
> amp = HybridAmp.new(volume: 10)
> amp.power_amp_weight
Slide 147
Slide 147 text
@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
Slide 148
Slide 148 text
@kevin j m
ruby.social
kevinjmurphy.com
πCompose to Share Behavior
Slide 149
Slide 149 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp
include TubePreAmp, SolidStatePowerAmp
end
Slide 150
Slide 150 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp < Amplifier
include TubePreAmp, SolidStatePowerAmp
end
Slide 151
Slide 151 text
@kevin j m
ruby.social
kevinjmurphy.com
Hybrid Amp
class HybridAmp < Amplifier
include TubePreAmp, SolidStatePowerAmp
end
> amp = HybridAmp.new(volume: 10)
Slide 152
Slide 152 text
@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)
Slide 153
Slide 153 text
@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
Slide 154
Slide 154 text
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
Slide 155
Slide 155 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
> amp = SolidStateAmp.new(volume: 5)
β¨
Slide 156
Slide 156 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
> amp = SolidStateAmp.new(volume: 5)
> amp.turn_on
β¨
Slide 157
Slide 157 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
> amp = SolidStateAmp.new(volume: 5)
> amp.turn_on
β¨
> guitar = Guitar.new
Slide 158
Slide 158 text
@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)
Slide 159
Slide 159 text
@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) }
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
> guitar = Guitar.new
Slide 166
Slide 166 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
> guitar = Guitar.new
> song = Blues::Shuffle.new(guitar)
Slide 167
Slide 167 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
> guitar = Guitar.new
> song = Blues::Shuffle.new(guitar)
> song.play
Slide 168
Slide 168 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
class Guitar
def initialize
end
end
Slide 169
Slide 169 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
class Guitar
def initialize
@amplifier = SolidStateAmp.new(volume: 5)
end
end
Slide 170
Slide 170 text
@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
Slide 171
Slide 171 text
@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
Slide 172
Slide 172 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
> guitar = Guitar.new
Slide 173
Slide 173 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
> guitar = Guitar.new
> song = Blues::Shuffle.new(guitar)
Slide 174
Slide 174 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
> guitar = Guitar.new
> song = Blues::Shuffle.new(guitar)
> song.play
Slide 175
Slide 175 text
@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]
Slide 176
Slide 176 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
class Guitar
def initialize
@amplifier = SolidStateAmp.new(volume: 5)
end
end
Slide 177
Slide 177 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
class Guitar
def initialize
@amplifier = TubeAmp.new(volume: 9)
end
end
Slide 178
Slide 178 text
@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]
Slide 179
Slide 179 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
class Guitar
def initialize
@amplifier = TubeAmp.new(volume: 9)
end
end
Slide 180
Slide 180 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
class Guitar
def initialize
end
end
Slide 181
Slide 181 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
class Guitar
def initialize(amplifier: nil)
end
end
Slide 182
Slide 182 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
class Guitar
def initialize(amplifier: nil)
@amplifier = amplifier
end
end
Slide 183
Slide 183 text
@kevin j m
ruby.social
kevinjmurphy.com
Hear the Rumble
> solid_state_amp = SolidStateAmp.new(volume: 5)
> Guitar.new(amplifier: solid_state_amp)
@kevin j m
ruby.social
kevinjmurphy.com
πInject for Flexibility
Slide 186
Slide 186 text
π·: Bob Bissett CC BY-SA 4.0
Slide 187
Slide 187 text
@kevin j m
ruby.social
kevinjmurphy.com
Choices, Choices, Choices
class HybridAmp < Amplifier
Slide 188
Slide 188 text
@kevin j m
ruby.social
kevinjmurphy.com
Choices, Choices, Choices
class HybridAmp < Amplifier
include TubePreAmp
Slide 189
Slide 189 text
@kevin j m
ruby.social
kevinjmurphy.com
Choices, Choices, Choices
class HybridAmp < Amplifier
include TubePreAmp
class Guitar
def tune = Tuner.new(self).tune
Slide 190
Slide 190 text
@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:)
Slide 191
Slide 191 text
@kevin j m
ruby.social
kevinjmurphy.com
Model YOUR Reality
> amp = HybridAmp.new
β¨
Slide 192
Slide 192 text
@kevin j m
ruby.social
kevinjmurphy.com
Model YOUR Reality
> amp = HybridAmp.new
β¨
Consistency
0 10
Slide 193
Slide 193 text
@kevin j m
ruby.social
kevinjmurphy.com
Model YOUR Reality
> amp = HybridAmp.new
β¨
Flexibility
0 10
Slide 194
Slide 194 text
@kevin j m
ruby.social
kevinjmurphy.com
Model YOUR Reality
> amp = HybridAmp.new
> guitar = Guitar.new(amplifier: amp)
β¨
Slide 195
Slide 195 text
@kevin j m
ruby.social
kevinjmurphy.com
Model YOUR Reality
> amp = HybridAmp.new
> guitar = Guitar.new(amplifier: amp)
β¨
0 10
Flexibility
Slide 196
Slide 196 text
@kevin j m
ruby.social
kevinjmurphy.com
Model YOUR Reality
> amp = HybridAmp.new
> guitar = Guitar.new(amplifier: amp)
β¨
> guitar.tune(:down_half_step)
Slide 197
Slide 197 text
@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
Slide 198
Slide 198 text
@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)
Slide 199
Slide 199 text
@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
Slide 200
Slide 200 text
@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]
Slide 201
Slide 201 text
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
Slide 202
Slide 202 text
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
Slide 203
Slide 203 text
@kevin j m
ruby.social
kevinjmurphy.com
Make the Sounds
> guitar.plug_in(amplifier: SonicPiAmp.new)
Slide 204
Slide 204 text
@kevin j m
ruby.social
kevinjmurphy.com
Make the Sounds
> guitar.plug_in(amplifier: SonicPiAmp.new)
> song.play
Slide 205
Slide 205 text
No content
Slide 206
Slide 206 text
π·: Kevin Murphy
kevinjmurphy.com/play-guitar
@kevin j m
@kevin j [email protected]
Slide 207
Slide 207 text
π·: Kevin Murphy
kevinjmurphy.com/play-guitar
@kevin j m
@kevin j [email protected]