Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Metronome/Ruby/metronome.rb
Normal file
14
Task/Metronome/Ruby/metronome.rb
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
#!/usr/bin/ruby
|
||||
|
||||
bpm = Integer(ARGV[0]) rescue 60 # sets BPM by the first command line argument, set to 60 if none provided
|
||||
msr = Integer(ARGV[1]) rescue 4 # sets number of beats in a measure by the second command line argument, set to 4 if none provided
|
||||
i = 0
|
||||
|
||||
loop do
|
||||
(msr-1).times do
|
||||
puts "\a"
|
||||
sleep(60.0/bpm)
|
||||
end
|
||||
puts "\aAND #{i += 1}"
|
||||
sleep(60.0/bpm)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue