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

From XPUB & Lens-Based wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Steve Reich's Clapping Music

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

I thought it might be nice to play around with different tones. After all, that's left up to the performers!

pat=xxx_xx_x_xx_

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

#change the tone during the play with a loop
	
	for i in g a+ c+ d+ f+ g+ a b c d e f
	do
	echo $pat | sed "s/x/$i /g; s/_/r /g"
	done

cat <<END

	}

	@channel 2 {
		\$patch 116
		\$octave 3
		\$length 12
		\$pan 0

END

#pattern2 with the shift
	
	for i in a b c d e f g a+ c+ d+ f+ g+
	do
	echo $pat | sed "s/x/$i /g; s/_/r /g"
	pat=${pat:1}${pat:0:1}
	done 


cat <<END

	}
}

END