Class: Webern::Matrix

Inherits:
Object
  • Object
show all
Defined in:
lib/webern/matrix.rb

Constant Summary

BASIC_ROW =
Array(0..11)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(row) ⇒ Matrix

Returns a new instance of Matrix



6
7
8
# File 'lib/webern/matrix.rb', line 6

def initialize(row)
  @prime_row = row
end

Instance Attribute Details

#prime_rowObject

Returns the value of attribute prime_row



3
4
5
# File 'lib/webern/matrix.rb', line 3

def prime_row
  @prime_row
end

Instance Method Details

#inversionsObject



14
15
16
# File 'lib/webern/matrix.rb', line 14

def inversions
  BASIC_ROW.map{|note| @prime_row.transpose(note).inversion }
end

#primesObject



10
11
12
# File 'lib/webern/matrix.rb', line 10

def primes
  BASIC_ROW.map{|note| @prime_row.transpose(note) }
end

#retrograde_inversionsObject



22
23
24
# File 'lib/webern/matrix.rb', line 22

def retrograde_inversions
  BASIC_ROW.map{|note| @prime_row.transpose(note).retrograde_inversion }
end

#retrogradesObject



18
19
20
# File 'lib/webern/matrix.rb', line 18

def retrogrades
  BASIC_ROW.map{|note| @prime_row.transpose(note).retrograde }
end