0

我用 Praat 生成了一个纯音(440 Hz)并尝试将其音高更改为 277.1826309768721 Hz(中 C),然后使用脚本更改为 220 Hz。但是,脚本会在“删除节点”(如Command "Remove point(s)" not available for current selection)或“发布再合成”(Command "Publish resynthesis" not available for current selection)处崩溃,以脚本中先出现的为准。

这是脚本的两个版本,一个尝试发布重新合成:

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

还有一个不尝试发布重新合成(因为它不起作用)而是尝试更改节点的位置,但失败了:

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

我的最终目标是编写一个脚本,该脚本采用 Manipulation 对象,生成从小 C(130.8127826502993 Hz)到 B5(987.7666025122483 Hz)的所有钢琴键频率的声音的单调版本,并将它们保存到文件夹中。如果脚本中不允许删除节点或发布重新合成,则无法执行此操作。

是的,我确实尝试过编辑 Manipulation 对象本身,但由于它不起作用,我切换到创建 Pitch 层的方法。

顺便说一句,我也尝试过这样的事情:

s$ = selected$("Sound")
m$ = selected$("Manipulation")
selectObject: s$
endtime = Get end time
selectObjcet: m$
Remove points between... 0 endtime

开始,但这导致了一个No object named "tone"错误,即使我选择了一个声音和一个名为tone.

4

1 回答 1

0

好的,经过更多尝试,我设法创建了一个超级丑陋的解决方法。下面的脚本做了我想要的,但它也将原始操作对象重命名为“tone”,以便将来能够引用它。我不确定如果您已经打开了名为“tone”的对象会发生什么……小心。

所有频率都是硬编码的。所以这样做是需要一个操作对象将其重命名为“音调”,将其音高移动到 C3 的音高,将再合成保存为c3.wav,将音高移动到 C#3,将再合成保存为c-sharp3.wav,将音高移动到 D3 , 将其保存到d3.wav... 一直到 B5。<folder_path>需要替换为所需的目标文件夹。

s$ = selected$("Manipulation")
Rename: "tone"
selectObject: "Manipulation tone"
Extract original sound
endtime = Get end time
Remove
selectObject: "Manipulation tone"
Extract pitch tier
View & Edit
Remove points between: 0, endtime
View & Edit
Add point: 0, 130.8127826502993
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\c3.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 138.59131548843604
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\c-sharp3.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 146.8323839587038
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\d3.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 155.56349186104046
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\d-sharp3.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 164.81377845643496
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\e3.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 174.61411571650194
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\f3.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 184.9972113558172
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\f-sharp3.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 195.99771799087463
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\g3.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 207.65234878997256
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\g-sharp3.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 220.0
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\a3.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 233.08188075904496
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\a-sharp3.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 246.94165062806206
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\b3.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 261.6255653005986
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\c4.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 277.1826309768721
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\c-sharp4.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 293.6647679174076
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\d4.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 311.1269837220809
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\d-sharp4.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 329.6275569128699
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\e4.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 349.2282314330039
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\f4.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 369.9944227116344
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\f-sharp4.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 391.99543598174927
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\g4.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 415.3046975799451
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\g-sharp4.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 440.0
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\a4.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 466.1637615180899
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\a-sharp4.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 493.8833012561241
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\b4.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 523.2511306011972
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\c5.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 554.3652619537442
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\c-sharp5.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 587.3295358348151
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\d5.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 622.2539674441618
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\d-sharp5.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 659.2551138257398
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\e5.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 698.4564628660078
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\f5.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 739.9888454232688
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\f-sharp5.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 783.9908719634985
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\g5.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 830.6093951598903
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\g-sharp5.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 880.0
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\a5.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 932.3275230361799
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\a-sharp5.wav"
Remove
selectObject: "PitchTier tone"
Remove point: 1
Add point: 0, 987.7666025122483
selectObject: "Manipulation tone"
plusObject: "PitchTier tone"
Replace pitch tier
selectObject: "Manipulation tone"
Get resynthesis (overlap-add)
Save as WAV file: "<folder_path>\b5.wav"
Remove
于 2019-01-02T21:16:52.327 回答