#!/bin/bash ######################################################################### # # THEMEMAKER # ######################################################################### # # Programmed by: David Huron Date: 16 Oct. 1999 # Copyright (c) 1999 David Huron # (written with the assistance of Craig Sapp.) # # Modifications: # Date: Programmer: Description: # # # This program generates "themes" from monophonic inputs. # More correctly, this program generates incipits from monophonic inputs. # For any input file, the program selects the first 30 notes, # and then trims the output so that it coincides with a phrase ending. # mkdir $TMPDIR/thm # Process each input file independently: for i in $* do PHRASES=`rid -GLId $i | head -30 | grep -c '}'` if [ $PHRASES = "0" ] then yank -c -l -r 1-20 $i > $TMPDIR/thm/`basename $i .krn`.thm else yank -c -o '{' -r "1-$PHRASES" $i > $TMPDIR/thm/`basename $i .krn`.thm fi # extract the reference records at the end of the folksongs: grep -C15 '\*-' $i | grep '^\!\!\!' >> $TMPDIR/thm/`basename $i .krn`.thm done