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

- (Matrix) initialize(row)

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

- (Object) prime_row

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

- (Object) inversions



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

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

- (Object) primes



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

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

- (Object) retrograde_inversions



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

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

- (Object) retrogrades



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

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