From 0af243616ea2870796382d778dc1281121714288 Mon Sep 17 00:00:00 2001 From: "B. Watson" Date: Sun, 5 Jul 2020 21:13:12 -0400 Subject: Minor updates from ~/bin --- chordspeller.pl | 2 +- find_key | 4 ++-- find_tuning | 2 +- renumfiles | 16 +++++++++++++--- 4 files changed, 17 insertions(+), 7 deletions(-) diff --git a/chordspeller.pl b/chordspeller.pl index 66b498d..d4215d1 100755 --- a/chordspeller.pl +++ b/chordspeller.pl @@ -393,7 +393,7 @@ our @tuning_list = ( [ 'cv', 'cgda', 'Cello or Viola' ], [ 'v', 'gdae', 'Violin' ], [ 'vs', 'adae', 'Violin (scordatura)' ], - [ 'u', 'gcae', 'Ukulele' ], + [ 'u', 'gcea', 'Ukulele' ], [ 'ub', 'dgbe', 'Baritone Ukulele' ], ); diff --git a/find_key b/find_key index 485e728..5e5e035 100755 --- a/find_key +++ b/find_key @@ -55,8 +55,8 @@ $0: Find key of music in audio (or maybe video) files. Usage: $0 [-m|-M] file.wav [file.wav ...] --m: Force all keys to minor --M: Force all keys to major +-m: Force major keys to relative minor +-M: Force minor keys to relative major EOF exit 0; } diff --git a/find_tuning b/find_tuning index cbb4d73..aee1be3 100755 --- a/find_tuning +++ b/find_tuning @@ -28,7 +28,7 @@ for(@ARGV) { $infile = $_; } else { $infile = "/tmp/find_tuning_$$.wav"; - $rm_infile = 1; + #$rm_infile = 1; warn "Decoding $_ with mplayer\n" unless $quiet; system("mplayer -really-quiet -benchmark -vo null -ao pcm:fast:file=\"$infile\" \"$_\""); } diff --git a/renumfiles b/renumfiles index 28ff2b9..1f57776 100755 --- a/renumfiles +++ b/renumfiles @@ -16,11 +16,21 @@ if($ARGV[0] =~ /^\d+$/) { } $pattern = $ARGV[0] || usage; -$pattern =~ s/\%d/%02d/; +usage if -f $pattern; + +shift; +if(@ARGV >= 1000) { + $places = 4; +} elsif (@ARGV >= 100) { + $places = 3; +} else { + $places = 2; +} + +$pattern =~ s/\%d/%0${places}d/; if($pattern !~ /\%\d+d/) { - $pattern = "${pattern}_\%02d.jpg"; + $pattern = "${pattern}_\%0${places}d.jpg"; } -shift; @files = @ARGV; usage unless @files; -- cgit v1.2.3