#This script generated signal correlated noise #for all selected sounds nOfSounds = numberOfSelected("Sound") if nOfSounds < 1 exit select at least 1 sound endif for s from 1 to nOfSounds name's'$ = selected$("Sound",'s') snrSound's' = selected("Sound",'s') endfor for snd from 1 to nOfSounds name$ = name'snd'$ snrSound = snrSound'snd' select 'snrSound' Copy... 'name$'snr #calculate the number of samples to be inverted n = Get number of samples half = round(n/2) printline 'n' samples in sound 'name$' #make an array for all samples #and set all values to one for i from 1 to n nogniet'i' = 1 endfor #for half of the samples for i from 1 to half #find a sample that has not yet been inverted repeat s = floor(randomUniform(1,n))+1 until nogniet's' nogniet's' = 0 #invert this sample Formula... if col = s then self[s] * -1 else self fi endfor endfor