Class: GuitarProParser::ChordDiagram

Inherits:
Object
  • Object
show all
Defined in:
lib/guitar_pro_parser/chord_diagram.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeChordDiagram

Returns a new instance of ChordDiagram.



26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 26

def initialize
  @name = ''
  @base_fret = 0
  @frets = []
  @display_as = :sharp
  @root = nil
  @type = 'M'
  @nine_eleven_thirteen = 0
  @bass = nil
  @tonality = :perfect
  @add = false
  @fifth_tonality = :perfect
  @ninth_tonality = :perfect
  @eleventh_tonality = :perfect
  @barres = []
  @intervals = []
  @fingers = []
  @display_fingering = false
end

Instance Attribute Details

#addObject

Returns the value of attribute add.



15
16
17
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 15

def add
  @add
end

#barresObject

Returns the value of attribute barres.



15
16
17
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 15

def barres
  @barres
end

#base_fretObject

Returns the value of attribute base_fret.



5
6
7
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 5

def base_fret
  @base_fret
end

#bassObject

Returns the value of attribute bass.



15
16
17
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 15

def bass
  @bass
end

#display_asObject

Returns the value of attribute display_as.



5
6
7
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 5

def display_as
  @display_as
end

#display_fingeringObject

Returns the value of attribute display_fingering.



15
16
17
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 15

def display_fingering
  @display_fingering
end

#eleventh_tonalityObject

Returns the value of attribute eleventh_tonality.



15
16
17
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 15

def eleventh_tonality
  @eleventh_tonality
end

#fifth_tonalityObject

Returns the value of attribute fifth_tonality.



15
16
17
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 15

def fifth_tonality
  @fifth_tonality
end

#fingersObject

Returns the value of attribute fingers.



15
16
17
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 15

def fingers
  @fingers
end

#fretsObject

Returns the value of attribute frets.



5
6
7
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 5

def frets
  @frets
end

#intervalsObject

Returns the value of attribute intervals.



15
16
17
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 15

def intervals
  @intervals
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 5

def name
  @name
end

#nine_eleven_thirteenObject

Determines if the chord goes until the ninth, the eleventh, or the thirteenth.



13
14
15
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 13

def nine_eleven_thirteen
  @nine_eleven_thirteen
end

#ninth_tonalityObject

Returns the value of attribute ninth_tonality.



15
16
17
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 15

def ninth_tonality
  @ninth_tonality
end

#rootObject

Returns the value of attribute root.



5
6
7
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 5

def root
  @root
end

#tonalityObject

Returns the value of attribute tonality.



15
16
17
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 15

def tonality
  @tonality
end

#typeObject

Returns the value of attribute type.



5
6
7
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 5

def type
  @type
end

Instance Method Details

#add_barre(fret, start_string, end_string) ⇒ Object



46
47
48
# File 'lib/guitar_pro_parser/chord_diagram.rb', line 46

def add_barre(fret, start_string, end_string)
  @barres << { fret: fret, start_string: start_string, end_string: end_string }
end