gyorgy@0: import dircache, subprocess, random gyorgy@0: from math import sin, cos, pi gyorgy@0: gyorgy@0: sourceDir = '.' gyorgy@0: gyorgy@0: def getFilesWav(): gyorgy@0: _dirlist = dircache.listdir(sourceDir) gyorgy@0: dirlist = [] gyorgy@0: for item in _dirlist: gyorgy@0: if item.split('.')[-1] == 'wav' and item.split('.')[0].split('_')[-1] != 'pad': gyorgy@0: dirlist.append(item) gyorgy@0: return dirlist gyorgy@0: gyorgy@0: gyorgy@0: def getFilesPad(): gyorgy@0: _dirlist = dircache.listdir(sourceDir + '/padded') gyorgy@0: dirlist = [] gyorgy@0: for item in _dirlist: gyorgy@0: if item.split('.')[-1] == 'wav' and item.split('.')[0].split('_')[-1] == 'pad': gyorgy@0: dirlist.append('./padded/%s'%item) gyorgy@0: return dirlist gyorgy@0: gyorgy@0: gyorgy@0: def soxNorm(infile): gyorgy@0: outfile = "%s%s" %("_", infile) gyorgy@0: com = "sox %s %s gain -n -6" %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: gyorgy@0: gyorgy@0: #-----------FX gyorgy@0: gyorgy@0: gyorgy@0: def mwChorus(infile): gyorgy@0: outfile = infile.split('.')[0] + '_chorus' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:bbMC:beBU -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: def soxPad(infile): gyorgy@0: outfile = infile.split('.')[0] + '_pad' + '.wav' gyorgy@0: com = "sox %s %s pad 0 3" %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwDelay(infile): gyorgy@0: outfile = infile.split('.')[0] + '_echo' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:Pong:ExSl -parameter=0:0.2,1:40,2:-0.25,3:1,4:0.8,5:8000,6:0.01,7:0,8:0,9:0 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwDistortion(infile): gyorgy@0: outfile = infile.split('.')[0] + '_distortion' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:afs1:Aura -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwLoPass(infile): gyorgy@0: outfile = infile.split('.')[0] + '_lopass' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aumf:FSim:FabF -parameter=1:0.5,5:2 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwHiPass(infile): gyorgy@0: outfile = infile.split('.')[0] + '_hipass' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aumf:FSim:FabF -parameter=1:0.5,4:1,5:2 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwBandPass(infile): gyorgy@0: outfile = infile.split('.')[0] + '_bandpass' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aumf:FSim:FabF -parameter=1:0.5,4:2,5:2 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: def mwCompressor(infile): gyorgy@0: outfile = infile.split('.')[0] + '_compressor' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:dcmp:appl -parameter=0:-41,1:36,2:1,3:-120,4:0.03,5:0.03,6:0 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwComb(infile): gyorgy@0: outfile = infile.split('.')[0] + '_comb' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:CmFB:MNor -parameter=0:420,1:1,2:1,3:75,4:100,5:0 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwLeslie(infile): gyorgy@0: outfile = infile.split('.')[0] + '_leslie' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:mdaH:mdaX -parameter=0:2,1:50,2:60,3:70:4:60,5:70,6:450,7:0,8:50 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwRingMod(infile): gyorgy@0: outfile = infile.split('.')[0] + '_ringmod' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:mdaR:mdaX -parameter=0:1000,1:0,2:0 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwFuzz(infile): gyorgy@0: outfile = infile.split('.')[0] + '_fuzz' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:Pass:AuDa -parameter=0:0.4,1:14000,2:-5,3:1 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def soxGain(infile): gyorgy@0: outfile = infile.split('.')[0] + '_gain' + '.wav' gyorgy@0: com = "sox %s %s gain 5.8" %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwBitCrush(infile): gyorgy@0: outfile = infile.split('.')[0] + '_bitcrush' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:CRS1:Togu -parameter=1:0.25,2:0.5,3:0.5,4:1,5:0.5,6:0,7:0 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwMonoPhaser(infile): gyorgy@0: outfile = infile.split('.')[0] + '_monophaser' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:Phas:ExSl -parameter=0:0.85,1:0.75,2:0,3:1500,4:7000,5:10,6:0 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwStereoPhaser(infile): gyorgy@0: outfile = infile.split('.')[0] + '_stereophaser' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:Phas:ExSl -parameter=0:0.85,1:0.75,2:0,3:1500,4:7000,5:10,6:0.3 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: def soxSpeedUp(infile): gyorgy@0: outfile = infile.split('.')[0] + '_speedup' + '.wav' gyorgy@0: com = "sox %s %s speed 1.2" %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: def soxSpeedDown(infile): gyorgy@0: outfile = infile.split('.')[0] + '_speeddown' + '.wav' gyorgy@0: com = "sox %s %s speed 0.8" %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: def mwDoppler(infile): gyorgy@0: outfile = infile.split('.')[0] + '_doppler' + '.wav' gyorgy@0: com = 'sox %s -n stat' %infile gyorgy@0: #print com gyorgy@0: #proc = subprocess.Popen(com,shell= True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) gyorgy@0: #proc.wait() gyorgy@0: #output = proc.stdout.read() gyorgy@0: #output = output.split('):') gyorgy@0: #output = output[1].split('Scaled') gyorgy@0: length = 600 #float(output[0]) * 100 gyorgy@0: gyorgy@0: print length gyorgy@0: com = 'MissWatson -plugin=aufx:DPAS:ksWV -parameter=5:%f -input-file=%s -output-file=%s' %(length, infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: gyorgy@0: def soxTremolo(infile): gyorgy@0: outfile = infile.split('.')[0] + '_tremolo' + '.wav' gyorgy@0: com = "sox %s %s tremolo 6 75" %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: def mwVibrato(infile): gyorgy@0: outfile = infile.split('.')[0] + '_vibrato' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aumf:MAe8:Meld -parameter=0:0.15,1:0.78,3:0.12 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: def soxPan(infile): gyorgy@0: _p = random.random() * 0.7 + 0.2 gyorgy@0: p = pi * (_p + 2) / 4 gyorgy@0: i = random.choice([-1, 1]) gyorgy@0: l = i * (cos(p) + sin(p)) gyorgy@0: r = i * (cos(p) - sin(p)) gyorgy@0: print [l, r] gyorgy@0: outfile = infile.split('.')[0] + '_pan' + '.wav' gyorgy@0: com = "sox %s %s remix 1v%f 2v%f" %(infile, outfile, l, r) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: def mwReverb(infile): gyorgy@0: outfile = infile.split('_pad.')[0] + '_reverb' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:JzR3:DreP -parameter=0:0,1:0.86,2:20,3:75,4:1,5:1 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: def mlabRobot(infile): gyorgy@0: outfile = infile.split('.')[0] + '_robot' + '.wav' gyorgy@0: com = '''matlab -nodesktop -nosplash - nojvm -r "robotization('%s','%s')"'''%(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: def mlabWhisper(infile): gyorgy@0: outfile = infile.split('.')[0] + '_whisper' + '.wav' gyorgy@0: com = '''matlab -nodesktop -nosplash - nojvm -r "whisperization('%s','%s')"'''%(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwEnhancer(infile): gyorgy@0: outfile = infile.split('.')[0] + '_enhancer' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:SPVT:SPL1 -parameter=2:0.75,3:0.75,4:0.5,5:0.6,6:0.75,7:0.75,8:0.7,9:0,10:0.5 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwFlanger(infile): gyorgy@0: outfile = infile.split('.')[0] + '_flanger' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:Flan:Togu -parameter=1:0.5,2:0,3:0.75,4:0.6,5:0,6:0.75,7:1,8:0.55 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: def mwGraindelay(infile): gyorgy@0: outfile = infile.split('_pad.')[0] + '_graindelay' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aumf:+bub:SDHKu -parameter=0:233,1:48,2:85,3:18,4:50,6:0,7:0,8:0,10:20000,11:0,12:70 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: gyorgy@0: gyorgy@0: gyorgy@0: def mwPitchUp(infile): gyorgy@0: outfile = infile.split('.')[0] + '_pitchup' + '.wav' gyorgy@0: com = 'MissWatson -plugin=aufx:shft:Awsh -parameter=0:300,1:0,2:0,3:3,4:8 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: print com gyorgy@0: proc = subprocess.Popen(com,shell= True) gyorgy@0: proc.wait() gyorgy@0: gyorgy@0: #def mwPitchDown(infile): gyorgy@0: # outfile = infile.split('.')[0] + '_pitchdown' + '.wav' gyorgy@0: # com = 'MissWatson -plugin=aufx:shft:Awsh -parameter=0:-300,1:0,2:0,3:3,4:8 -input-file=%s -output-file=%s' %(infile, outfile) gyorgy@0: # print com gyorgy@0: # proc = subprocess.Popen(com,shell= True) gyorgy@0: # proc.wait() gyorgy@0: gyorgy@0: wav_files = getFilesWav() gyorgy@0: #wav_files = getFilesPad() gyorgy@0: print wav_files gyorgy@0: gyorgy@0: for item in wav_files: gyorgy@0: #print item gyorgy@0: #soxNorm(item) gyorgy@0: #mwChorus(item) gyorgy@0: #soxPad(item) gyorgy@0: #mwDelay(item) gyorgy@0: #mwDistortion(item) gyorgy@0: #mwLoPass(item) gyorgy@0: #mwHiPass(item) gyorgy@0: #mwBandPass(item) gyorgy@0: #mwCompressor(item) gyorgy@0: #mwComb(item) gyorgy@0: #mwLeslie(item) gyorgy@0: #mwRingMod(item) gyorgy@0: #mwFuzz(item) gyorgy@0: #soxGain(item) gyorgy@0: #mwBitCrush(item) gyorgy@0: #mwMonoPhaser(item) gyorgy@0: #mwStereoPhaser(item) gyorgy@0: gyorgy@0: #soxSpeedUp(item) gyorgy@0: #soxSpeedDown(item) gyorgy@0: gyorgy@0: #mwDoppler(item) gyorgy@0: #soxTremolo(item) gyorgy@0: #mwVibrato(item) gyorgy@0: gyorgy@0: #soxPan(item) gyorgy@0: #mwReverb(item) gyorgy@0: #mlabRobot(item) gyorgy@0: #mlabWhisper(item) gyorgy@0: gyorgy@0: #mwEnhancer(item) gyorgy@0: #mwFlanger(item) gyorgy@0: #mwGraindelay(item) gyorgy@0: gyorgy@0: mwPitchUp(item) gyorgy@0: ##mwPitchDown(item) gyorgy@0: gyorgy@0: gyorgy@0: gyorgy@0: gyorgy@0: gyorgy@0: gyorgy@0: gyorgy@0: gyorgy@0: