Syllabus 20091006 Loredana

From XPUB & Lens-Based wiki
Revision as of 20:32, 23 September 2010 by Migratebot (talk | contribs) (Created page with " <source lang="text"> from os import system import time system('sox -c2 -r44100 -n -t wav - synth 0.2 pinknoise vol 1.0 fade l 0 0.2 0.19 > pink.wav') system('sox -c2 -r441...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
from os import system
import time

system('sox -c2 -r44100 -n -t wav - synth 0.2 pinknoise vol 1.0 fade l 0 0.2 0.19 > pink.wav')
system('sox -c2 -r44100 -n -t wav - synth 0.2 brownnoise vol 1.0 fade l 0 0.2 0.19 > brown.wav')
system('sox -c2 -r44100 -n -t wav - synth 0.2 noise vol 1.0 fade l 0 0.2 0.19 > white.wav')
system('sox pink.wav --rate 44100 --bits 16 --channels 2 --encoding signed-integer pink.raw')
system('sox brown.wav --rate 44100 --bits 16 --channels 2 --encoding signed-integer brown.raw')
system('sox white.wav --rate 44100 --bits 16 --channels 2 --encoding signed-integer white.raw')

n=3

for i in range(3):
    for i in range(3):
	
	system("cat pink.raw >> song.raw")
	system("cat white.raw >> song.raw")

	for i in range(n):
	    system("cat brown.raw >> song.raw")
	    system("cat brown.raw >> song.raw")
	    if n > 6:
	        for i in range(4):
		    system("cat white.raw >> song.raw")    
		    time.sleep(1)
    
    for i in range(4):
	system("cat pink.raw >> song.raw")
	system("cat white.raw >> song.raw")    
	time.sleep(1)
    n=n+3

system("cat pink.raw >> song.raw")
system("cat pink.raw >> song.raw")

# print("goodbye")

system("sox --rate 44100 --bits 16 --channels 2 --encoding signed-integer song.raw song.wav")
system("rm song.raw")
system("play song.wav")


Attachments