-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
modules for each stage of a tube amp
- Loading branch information
Showing
4 changed files
with
65 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# frozen_string_literal: true | ||
|
||
module Blues | ||
module TubePower | ||
def turn_on | ||
if @warm_up.nil? | ||
@warm_up = TubeWarmUp.new | ||
end | ||
|
||
super | ||
end | ||
|
||
def turn_off | ||
@warm_up = nil | ||
|
||
super | ||
end | ||
|
||
def warm_up_complete? | ||
return false unless @warm_up | ||
|
||
@warm_up.complete? | ||
end | ||
|
||
def volume | ||
return @volume if warm_up_complete? | ||
return 0 unless @warm_up | ||
|
||
(@volume * @warm_up.volume_scale).floor | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# frozen_string_literal: true | ||
|
||
module Blues | ||
module TubePowerAmp | ||
include TubePower | ||
|
||
def power_amp_weight | ||
:heavy | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# frozen_string_literal: true | ||
|
||
module Blues | ||
module TubePreAmp | ||
include TubePower | ||
|
||
def pre_amp_tone | ||
if low_volume? || mid_volume? | ||
"💡" | ||
elsif high_volume? | ||
"🔥" | ||
else | ||
" " | ||
end | ||
end | ||
|
||
def pre_amp_weight | ||
:heavy | ||
end | ||
end | ||
end |