Class: Stave::Theory::ScaleType

Inherits:
Core::DegreeCollection show all
Defined in:
lib/stave/theory/scale_type.rb

Instance Attribute Summary

Attributes inherited from Core::Lookup

#variant

Instance Method Summary collapse

Methods inherited from Core::DegreeCollection

class_key, #count, #degrees, #intervals, #relative_rotate, #rotate, #steps, #uniq

Methods inherited from Core::Lookup

#==, each_key, find_by, #initialize, keys, string_keys, variant, variant?, variant_lookup, variants, where, with_options

Constructor Details

This class inherits a constructor from Stave::Core::Lookup

Instance Method Details

#hexatonic?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/stave/theory/scale_type.rb', line 50

def hexatonic?
  count == 7
end

#mode_type_at(position) ⇒ Object



70
71
72
73
74
# File 'lib/stave/theory/scale_type.rb', line 70

def mode_type_at(position)
  position -= 7 while position >= 8

  mode_types[position - 1]
end

#mode_typesObject



66
67
68
# File 'lib/stave/theory/scale_type.rb', line 66

def mode_types
  ModeType.where(scale_type: self).sort_by(&:position)
end

#pentatonic?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/stave/theory/scale_type.rb', line 46

def pentatonic?
  count == 5
end

#seventh_typesObject



60
61
62
63
64
# File 'lib/stave/theory/scale_type.rb', line 60

def seventh_types
  Core::ScaleHarmoniser
    .new(scale_type: self, chord_set: ChordType::Set.seventh)
    .harmonise!
end

#triad_typesObject



54
55
56
57
58
# File 'lib/stave/theory/scale_type.rb', line 54

def triad_types
  Core::ScaleHarmoniser
    .new(scale_type: self, chord_set: ChordType::Set.triad)
    .harmonise!
end