User:Lieven Van Speybroeck/Prototyping/1-Clapping Music

From XPUB & Lens-Based wiki
pat=xxx_xx_x_xx_

cat <<END
@head {
	\$time_sig 4/4
	\$tempo 120
}
@body {
	@channel 1 {
		\$patch 116
		\$octave 3
		\$length 16
		\$pan 127
END

#repeat this 16 times
	
	for ((i=0; i<13; i++))
	do
	echo $pat | sed 's/x/c /g; s/_/r /g'
	done

cat <<END

	}

	@channel 2 {
		\$patch 116
		\$octave 8
		\$length 16
		\$pan 0

END

#pattern2 with the shift
	
	for ((i=0; i<13; i++))
	do
	echo $pat | sed 's/x/c /g; s/_/r /g'
	pat=${pat:1}${pat:0:1}
	done

cat <<END

	}
}

END