Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,26 @@
package require Tcl 8.5
lassign $argv bpm bpb
if {$argc < 2} {set bpb 4}
if {$argc < 1} {set bpm 60}
fconfigure stdout -buffering none
set intervalMS [expr {round(60000.0 / $bpm)}]
set ctr 0
proc beat {} {
global intervalMS ctr bpb
after $intervalMS beat ;# Reschedule first, to encourage minimal drift
if {[incr ctr] == 1} {
puts -nonewline "\r\a[string repeat { } [expr {$bpb+4}]]\rTICK"
} else {
puts -nonewline "\rtick[string repeat . [expr {$ctr-1}]]"
}
if {$ctr >= $bpb} {
set ctr 0
}
}
# Run the metronome until the user uses Ctrl+C...
beat
vwait forever

View file

@ -0,0 +1 @@
tclsh8.5 metronome.tcl 90 4