User:Megan Hoogenboom/song

From XPUB & Lens-Based wiki

Song

#!/usr/bin/env python

from os import system

system('sox -c1 -r8000 -n sweep_up.wav synth 0.25 sine 220-440 vol 0.7')
system('sox -c1 -r8000 -n -t wav sweep_down.wav synth 0.25 sine 440-220 vol 0.7')
system('sox -c1 -r8000 -n laag.wav synth 0.25 sine 220 vol 0.7')
system('sox -c1 -r8000 -n ch.wav synth 0.25 noise vol 0.7')
system('sox -c1 -r8000 -n hoog.wav synth 0.5 square 330 vol 0.7')
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 sweep_up.wav --rate 44100 --bits 16 --channels 2 --encoding signed-integer sweep_up.raw')
system('sox sweep_down.wav --rate 44100 --bits 16 --channels 2 --encoding signed-integer sweep_down.raw')
system('sox laag.wav --rate 44100 --bits 16 --channels 2 --encoding signed-integer laag.raw')
system('sox ch.wav --rate 44100 --bits 16 --channels 2 --encoding signed-integer ch.raw')
system('sox hoog.wav --rate 44100 --bits 16 --channels 2 --encoding signed-integer hoog.raw')
system('sox white.wav --rate 44100 --bits 16 --channels 2 --encoding signed-integer white.raw')

for i in range(3):
    for i in range(1):
        #system("cat sweep_down.raw >> song2.raw")
        system("cat sweep_up.raw >> song2.raw")
        for i in range(1):
            system("cat laag.raw >> song2.raw")
        for i in range(1):
            system("cat pink.raw >> song2.raw")

    system("cat sweep_up.raw >> song2.raw")
    system("cat laag.raw >> song2.raw")
    system("cat hoog.raw >> song2.raw")

    for i in range(2):
        system("cat hoog.raw >> song2.raw")
        system("cat laag.raw >> song2.raw")
        system("cat ch.raw >> song2.raw")
        system("cat white.raw >> song2.raw")




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

system("play song2.wav")


Attachments