Class: Stave::Theory::Degree
Instance Attribute Summary
Attributes inherited from Core::Lookup
#variant
Instance Method Summary
collapse
#==, each_key, find_by, #initialize, keys, string_keys, variant, variant?, variant_lookup, variants, where, with_options
Instance Method Details
#+(other) ⇒ Object
104
105
106
107
108
|
# File 'lib/stave/theory/degree.rb', line 104
def +(other)
new_interval = interval + other.interval
Degree.find_by(interval: new_interval)
end
|
#-(other) ⇒ Object
110
111
112
113
114
|
# File 'lib/stave/theory/degree.rb', line 110
def -(other)
new_interval = interval - other.interval
Degree.find_by(interval: new_interval)
end
|
#symbol ⇒ Object
94
95
96
97
98
|
# File 'lib/stave/theory/degree.rb', line 94
def symbol
return "R" if (to_i % 12).zero?
"#{accidental.symbol}#{interval.number.symbol}"
end
|
#to_i ⇒ Object
100
101
102
|
# File 'lib/stave/theory/degree.rb', line 100
def to_i
interval.to_i
end
|