SimpleAlgorithmicSequencing

From XPUB & Lens-Based wiki
Revision as of 20:32, 23 September 2010 by Migratebot (talk | contribs) (Created page with "= Simple Algorithmic Sequencing = <source lang="python"> #!/usr/bin/python import os pat1 = "ooo.oo.o.oo." pat2 = pat1 def do (cmd): os.system(cmd) do("rm tmp.raw...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Simple Algorithmic Sequencing

#!/usr/bin/python
import os

pat1 = "ooo.oo.o.oo."
pat2 = pat1

def do (cmd):
	os.system(cmd)

do("rm tmp.raw")

for i in range(13):
	print pat1
	print pat2
	print "----"

	for i in range(4):
		for (a, b) in zip(pat1, pat2):
			if a=="o" and b=="o":
				do("cat tones/sample.raw >> tmp.raw")
			elif a=="o" or b=="o":
				do("cat tones/lo.raw >> tmp.raw")
			else:
				do("cat tones/silence.raw >> tmp.raw")

	pat2 = pat2[1:]+pat2[0]

do("cat tmp.raw | sox -t raw -r 44100 -sw -c 2 - -t .wav pat.wav")
do("rm tmp.raw")