I generated a pure tone (440 Hz) with Praat and tried to change its pitch to 277.1826309768721 Hz (Middle C) and then to 220 Hz using a script. However, the script crashes either at "Remove pitch point(s)" (says Command "Remove point(s)" not available for current selection
) or at "Publish resynthesis" (Command "Publish resynthesis" not available for current selection
), whichever comes first at the script.
Here are two versions of the script, one which tries to publish the resynthesis:
Create Sound as pure tone: "tone", 1, 0, 0.4, 44100, 440, 0.2, 0.01, 0.01
To Manipulation: 0.01, 75, 600
Create PitchTier: "empty", 0, 1
View & Edit
Add point... 0 277.1826309768721
selectObject: "Manipulation tone"
plusObject: "PitchTier empty"
Replace pitch tier
selectObject: "Manipulation tone"
View & Edit
Publish resynthesis
and one which does not try to publish the resynthesis (as it doesn't work) but tries to change the location of the pitch point instead, and fails at that:
Create Sound as pure tone: "tone", 1, 0, 0.4, 44100, 440, 0.2, 0.01, 0.01
To Manipulation: 0.01, 75, 600
Create PitchTier: "empty", 0, 1
View & Edit
Add point... 0 277.1826309768721
selectObject: "Manipulation tone"
plusObject: "PitchTier empty"
Replace pitch tier
selectObject: "Manipulation tone"
View & Edit
Remove point(s)
Add point at: 0, 220
selectObject: "PitchTier empty"
selectObject: "Manipulation tone"
plusObject: "PitchTier empty"
Replace pitch tier
selectObject: "Manipulation tone"
View & Edit
My ultimate goal is to write a script that takes a Manipulation object, generates monotonized versions of the sound with all the piano key frequencies from small C (130.8127826502993 Hz) up to B5 (987.7666025122483 Hz) and saves them to a folder. This cannot be done if removing pitch points or publishing resyntheses are not allowed in scripts.
And yes, I did try this by editing a Manipulation object itself, but since it didn't work, I switched to the approach of creating a Pitch tier.
By the way, I've also tried things like this:
s$ = selected$("Sound")
m$ = selected$("Manipulation")
selectObject: s$
endtime = Get end time
selectObjcet: m$
Remove points between... 0 endtime
to get started, but this resulted in a No object named "tone"
error even though I had selected a Sound and a Manipulation named tone
.