#!perl -w %noteoff = ( 'C', 0, 'C#', 1, 'D', 2, 'D#', 3, 'E', 4, 'F', 5, 'F#', 6, 'G', 7, 'G#', 8, 'A', 9, 'A#', 10, 'B', 11 ); while(<>) { chop; /([A-G]#?)(-?\d).wav$/i ? ($note = $1, $oct = $2) : next; $notenum = $noteoff{$note} + ( $oct * 12 ) + 24; $key = sprintf("%03i", $notenum); print " lokey=$key hikey=$key pitch_keycenter=$key sample=$_\n"; }