September 2017 Update

This commit is contained in:
Ingy döt Net 2017-09-23 10:01:46 +02:00
parent bba7bfd280
commit ba8067c3b7
14570 changed files with 153136 additions and 63871 deletions

View file

@ -0,0 +1,16 @@
// version 1.1.2
fun metronome(bpm: Int, bpb: Int, maxBeats: Int = Int.MAX_VALUE) {
val delay = 60_000L / bpm
var beats = 0
do {
Thread.sleep(delay)
if (beats % bpb == 0) print("\nTICK ")
else print("tick ")
beats++
}
while (beats < maxBeats)
println()
}
fun main(args: Array<String>) = metronome(120, 4, 20) // limit to 20 beats

View 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