class Metronome::OddBar

Attributes

beat_array[RW]
tempo[RW]

Public Class Methods

new(tempo, in_beat) click to toggle source
# File lib/metronome-odd.rb, line 123
def initialize(tempo, in_beat)
  data_dir = Gem.datadir("metronome-odd")
  data_dir = data_dir ? data_dir : ""
  @upbeat_sound_file = data_dir + "/beat_upbeat.aiff"
  @downbeat_sound_file = data_dir + "/beat_downbeat.aiff"

  @beat_array = Array.new
  @in_beat = in_beat
  @tempo = tempo

  upbeat_b = true
  time = 1
  prev_beat = 1
  in_beat.each do |t|
    if upbeat_b
      beat = Beat.new(tempo/t, @upbeat_sound_file)
      upbeat_b = false
    else
      beat = Beat.new(tempo/t, @downbeat_sound_file)
    end
    @beat_array.push(beat)
  end

end

Public Instance Methods

print_sign() click to toggle source