Here is an example with score statements, `bash' and external. sr = 44100 ksmps = 1 nchnls = 1 0dbfs = 1 instr 1 kamp expon ampdb(p5), p3, 0.001 aosc poscil3 kamp, p4, 2 aw1 poscil3 1, 1/p3, 1 acnv dconv aw1, 64, 3 aout dcblock2 aw1 + acnv*0.002 aout butlp aout + aosc, 12000 out aout*0.3 endin # redirect stdout to score file exec > "$1" # shortcuts for the used score statements f() { echo "f $@"; } i() { echo "i $@"; } TEMPO="t" BPM="" fsize=8192 # usage: tempo at bpm tempo() { if [ -n "$BPM" ]; then TEMPO="$TEMPO $1 $BPM $1 $2" else TEMPO="$TEMPO $1 $2" fi BPM=$2 } # waveform from score file f 1 0 256 1 \"$1\" 0 1 0 # usage: ftable at name ftable() { if [[ "$2" == "sine" ]]; then f 2 $1 $fsize 10 1 else f 2 $1 $fsize 10 5 4 3 2 1 fi } tempo 0 30 ftable 0 blabla ftable 6.4 sine f 3 0 $fsize 11 10 1 .75 # normal i-statement i 1 0 1 880 -12 # usage: arpeggio at dur freq amp arpeggio() { i 1 $1 $2 $3 $4 i 1 + . [$3 \* 5/4] . i 1 + . [$3 \* 1.5] . i 1 + . [$3 \* 7/4] . i 1 + . [$3 \* 12/5] . } arpeggio 0 0.5 440 -8 arpeggio 2.5 0.25 1216 -9 arpeggio 4.6 0.29 700 . tempo 4 135 tempo 7 30 for i in 0.11 0.27 0.56 0.79; do frq=`echo "377 * (1 + $i)"|bc -l` arpeggio "[2.6 + $i]" $i $frq -9 done i 1 4 3 4777 -12 i 1 4.8 3 6666 -9 # usage: bass at [skip] bass() { i 1 $1 1 75 -7 i 1 + . 44 . if [ -z "$2" ]; then i 1 + . 33 -12 i 1 + . 66 -8 fi } bass 0 bass 4 skip_tail # external python < tito