#!/bin/csh -f
set TUNE = $1
set tunetoc = dt.tunetoc
set tunes = dt.tunes
set orc = tune.orc
set char = `awk -F';' "/^$TUNE/"'{print $3}' $tunetoc`
@ char++
tail +${char}c $tunes | awk '/^===DOCUMENT BOUNDARY===/ {exit} {print}' > /tmp/tune.songwright
set parts = `tuneparts /tmp/tune.songwright`
tune2scot nparts=$parts /tmp/tune.songwright > /tmp/tune.scot
csound -m0 -duho /dev/audio $orc -S /tmp/tune.scot
