Class: OutroRails::Theory::Scale::DiatonicChord
- Inherits:
-
Struct
- Object
- Struct
- OutroRails::Theory::Scale::DiatonicChord
- Defined in:
- lib/outro_rails/theory/scale.rb
Overview
A triad built on a scale degree, with its display forms.
Instance Attribute Summary collapse
-
#degree ⇒ Object
Returns the value of attribute degree.
-
#quality ⇒ Object
Returns the value of attribute quality.
-
#root ⇒ Object
Returns the value of attribute root.
Instance Method Summary collapse
-
#in_library? ⇒ Boolean
Whether the chord library has this root - the app only generates chords for NoteName::CANONICAL_ROOTS, so degrees spelled with double accidentals or E#/B#-style names (F# major's E#dim) have no library page to link to.
-
#nashville ⇒ Object
Key-agnostic arabic form, e.g.
-
#roman ⇒ Object
Key-agnostic roman form, e.g.
-
#slug ⇒ Object
URL slug matching Chord#slug in the chord library.
-
#symbol ⇒ Object
The chord symbol, e.g.
Instance Attribute Details
#degree ⇒ Object
Returns the value of attribute degree
45 46 47 |
# File 'lib/outro_rails/theory/scale.rb', line 45 def degree @degree end |
#quality ⇒ Object
Returns the value of attribute quality
45 46 47 |
# File 'lib/outro_rails/theory/scale.rb', line 45 def quality @quality end |
#root ⇒ Object
Returns the value of attribute root
45 46 47 |
# File 'lib/outro_rails/theory/scale.rb', line 45 def root @root end |
Instance Method Details
#in_library? ⇒ Boolean
Whether the chord library has this root - the app only generates chords for NoteName::CANONICAL_ROOTS, so degrees spelled with double accidentals or E#/B#-style names (F# major's E#dim) have no library page to link to.
63 64 65 |
# File 'lib/outro_rails/theory/scale.rb', line 63 def in_library? NoteName::CANONICAL_ROOTS.include?(root.to_s) end |
#nashville ⇒ Object
Key-agnostic arabic form, e.g. "2m"
68 69 70 |
# File 'lib/outro_rails/theory/scale.rb', line 68 def nashville NashvilleNumber.format(degree: degree, quality: quality) end |
#roman ⇒ Object
Key-agnostic roman form, e.g. "ii"
73 74 75 |
# File 'lib/outro_rails/theory/scale.rb', line 73 def roman NashvilleNumber.roman(degree: degree, quality: quality) end |
#slug ⇒ Object
URL slug matching Chord#slug in the chord library.
55 56 57 |
# File 'lib/outro_rails/theory/scale.rb', line 55 def slug ChordVocabulary.slug(symbol) end |
#symbol ⇒ Object
The chord symbol, e.g. "Dm"
50 51 52 |
# File 'lib/outro_rails/theory/scale.rb', line 50 def symbol ChordVocabulary.symbol(root_name: root, quality: quality) end |