class Webern::Formatters::BaseFormatter
Constants
- DEFAULT_OPTS
- PITCH_CLASSES
Public Class Methods
new(row, opts={})
click to toggle source
# File lib/webern/formatters/base_formatter.rb, line 6 def initialize(row, opts={}) opts = DEFAULT_OPTS.merge(opts) @prime_row = row @show_pitches = opts[:show_pitches] @path = opts[:path].sub(/\/$/, '') @filename = opts[:filename] || 'row' @filepath = "#{@path}/#{@filename}" end
Public Instance Methods
pitch_value(n)
click to toggle source
# File lib/webern/formatters/base_formatter.rb, line 15 def pitch_value(n) @show_pitches ? PITCH_CLASSES[n] : n.to_s end