n = numberOfSelected("Sound") if n <> 2 exit select exactly two Sounds endif source = selected("Sound",1) target = selected("Sound",2) target$ = selected$("Sound",2) # get source information select 'source' sourceDuration = Get total duration sourceAmplitude = Get root-mean-square... 0 0 smpFreq = Get sampling frequency # get target informatin select 'target' targetDuration = Get total duration targetAmplitude = Get root-mean-square... 0 0 #get the duration factor durationFactor = sourceDuration/targetDuration #################### duration part ####################### Create Sound from formula... p1 Mono 0 0.025 'smpFreq' 0 select 'target' Copy... targetCopy select Sound p1 Copy... p2 plus Sound p1 plus Sound targetCopy Concatenate Rename... temp2 To Manipulation... 0.01 75 600 Extract duration tier Rename... temp2 Add point... 0 'durationFactor' #replace duration tier select Manipulation temp2 plus DurationTier temp2 Replace duration tier #get resynthesis and cut out silences select Manipulation temp2 Get resynthesis (overlap-add) Rename... temp3 ft = Get total duration silenceDur = 0.025 * durationFactor t2 = ft - silenceDur Extract part... 'silenceDur' 't2' rectangular 1 no Rename... targetDuration #remove files not needed any more select Sound temp2 plus Manipulation temp2 plus DurationTier temp2 plus Sound p2 plus Sound temp3 plus Sound targetCopy Remove ############ intensity part ###################### #creaate padded sound select Sound p1 Copy... p2 plus Sound p1 plus 'source' Concatenate #create source Intensity Rename... sourceIntensity To Intensity... 100 0 yes Rename... sourceIntensityObj Down to IntensityTier Rename... sourceIntensityTierObj #make a flat sound from the target #by multiplying with an inverse Intensity countour #create padded sound from target duration sound select Sound p1 plus Sound p2 plus Sound targetDuration Concatenate Rename... targetIntensity To Intensity... 100 0 yes Rename... targetIntensityObj1 # Inverse the intensity object by getting the maximum and subtracting self maxSyn = Get maximum... 0 0 Parabolic Formula... 'maxSyn' - self # And make IntensityTier object Down to IntensityTier Rename... targetIntensityTierObj1 # Multiply the synthetic utterance with its own inverse IntensityTier select Sound targetIntensity plus IntensityTier targetIntensityTierObj1 Multiply Rename... even # and then by the IntensityTier of the source utterance plus IntensityTier sourceIntensityTierObj Multiply Rename... completeSoundObj1 #cut silent parts back t = Get total duration t = t - 0.025 Extract part... 0.025 t rectangular 1 no Rename... 'target$'_IS thisAmplitude = Get root-mean-square... 0 0 Multiply... sourceAmplitude/thisAmplitude #clean up select Intensity sourceIntensityObj plus IntensityTier sourceIntensityTierObj plus Intensity targetIntensityObj1 plus IntensityTier targetIntensityTierObj1 plus Sound even plus Sound targetDuration plus Sound sourceIntensity plus Sound targetIntensity plus Sound p2 plus Sound p1 plus Sound completeSoundObj1 Remove