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 selectObject: source sourceDuration = Get total duration sourceAmplitude = Get root-mean-square: 0,0 smpFreq = Get sampling frequency # get target informatin selectObject: target targetDuration = Get total duration targetAmplitude = Get root-mean-square: 0,0 #get the duration factor durationFactor = sourceDuration/targetDuration #################### duration part ####################### pl = Create Sound from formula: "p1", 1, 0, 0.025, smpFreq, "0" selectObject: target Copy: "targetCopy" selectObject: pl pl2 = Copy: "p2" plusObject: pl plusObject: "Sound targetCopy" Concatenate Rename: "temp2" myMan = To Manipulation: 0.01, 75, 600 Extract duration tier Rename: "temp2" Add point: 0, durationFactor #replace duration tier selectObject: myMan plusObject: "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 selectObject: "Sound temp2" plusObject: "Manipulation temp2" plusObject: "DurationTier temp2" plusObject: "Sound p2" plusObject: "Sound temp3" plusObject: "Sound targetCopy" Remove ############ intensity part ###################### #creaate padded sound selectObject: pl Copy: "p2" plusObject: pl plusObject: 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 selectObject: "Sound p1" plusObject: "Sound p2" plusObject: "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 plusObject: "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 selectObject: "Intensity sourceIntensityObj" plusObject: "IntensityTier sourceIntensityTierObj" plusObject: "Intensity targetIntensityObj1" plusObject: "IntensityTier targetIntensityTierObj1" #plusObject: "Sound even" plusObject: "Sound targetDuration" plusObject: "Sound sourceIntensity" plusObject: "Sound targetIntensity" plusObject: "Sound p2" plusObject: "Sound p1" plusObject: "Sound completeSoundObj1" Remove