Sha256: 5889fe8d73373e510b73b33dc7ac5ab1b035d76554a1a77be765d39fb05d836c

Contents?: true

Size: 592 Bytes

Versions: 1

Compression:

Stored size: 592 Bytes

Contents

#!/usr/bin/env ruby

# frozen_string_literal: true

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), "..", "lib")

require "tablature_hero"

def time(filename)
  start = Time.now.to_f
  path = File.join(File.dirname(__FILE__), "..", "media", filename)
  `afplay #{path}`
  Time.now.to_f - start
end 

puts "running tablature_hero #{TablatureHero::VERSION}"
tempo = ARGV.shift.chomp
beat_duration = 60.0/tempo.to_i
loop do 
  duration = time("metro_high.mp3")
  sleep beat_duration - duration
  3.times do 
    duration = time("metro_low.mp3")
    sleep beat_duration - duration
  end 
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tablature_hero-0.1.2 exe/tablature_hero