Class: Gitara::Voice

Inherits:
Valuable
  • Object
show all
Defined in:
lib/gitara/voice.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#$1($1) ⇒ Object



5
# File 'lib/gitara/voice.rb', line 5

has_value :id

Instance Method Details

#call_nameObject



8
9
10
# File 'lib/gitara/voice.rb', line 8

def call_name
  "\\#{definition_name}"
end

#definition_nameObject



12
13
14
# File 'lib/gitara/voice.rb', line 12

def definition_name
  "v#{id_as_word}"
end

#idObject



5
# File 'lib/gitara/voice.rb', line 5

has_value :id

#id_as_wordObject



16
17
18
# File 'lib/gitara/voice.rb', line 16

def id_as_word
  Utilities.id_as_word(id)
end

#octaveObject



20
21
22
# File 'lib/gitara/voice.rb', line 20

def octave
  (self.parent.max_number_of_voices - self.id) + 1
end

#parentObject



6
# File 'lib/gitara/voice.rb', line 6

has_value :parent

#stem_typeObject



24
25
26
# File 'lib/gitara/voice.rb', line 24

def stem_type
  "\\voice#{id_as_word}"
end

#transpositionObject



28
29
30
# File 'lib/gitara/voice.rb', line 28

def transposition
  "#{self.parent.transposition}#{"'" * self.octave}" if self.parent.transposition
end