| 1 |
<html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 |
<title>Script for listing time–F0–intensity</title> |
| 3 |
<style> |
| 4 |
td { padding-left: 5pt; padding-right: 5pt; } |
| 5 |
th { padding-left: 5pt; padding-right: 5pt; } |
| 6 |
code { white-space: pre-wrap; } |
| 7 |
dd { white-space: pre-wrap; } |
| 8 |
</style> |
| 9 |
</head><body bgcolor="#FFFFFF"> |
| 10 |
|
| 11 |
<table border=0 cellpadding=0 cellspacing=0><tr><td bgcolor="#CCCC00"><table border=4 cellpadding=9><tr><td align=middle bgcolor="#000000"><font face="Palatino,Times" size=6 color="#999900"><b> |
| 12 |
Script for listing time–F0–intensity |
| 13 |
</b></font></table></table> |
| 14 |
<p>"I want a list of pitch and intensity values at the same times."</p> |
| 15 |
<p>Since <a href="Sound__To_Pitch___.html">Sound: To Pitch...</a> and <a href="Sound__To_Intensity___.html">Sound: To Intensity...</a> do not give values at the same times, you create separate pitch and intensity contours with high time resolution, then interpolate. In the following example, you get pitch and intensity values at steps of 0.01 seconds by interpolating curves that have a time resolution of 0.001 seconds.</p> |
| 16 |
<code> sound = selected ("Sound")<br></code> |
| 17 |
<code> tmin = Get start time<br></code> |
| 18 |
<code> tmax = Get end time<br></code> |
| 19 |
<code> To Pitch: 0.001, 75, 300<br></code> |
| 20 |
<code> Rename: "pitch"<br></code> |
| 21 |
<code> selectObject: sound<br></code> |
| 22 |
<code> To Intensity: 75, 0.001<br></code> |
| 23 |
<code> Rename: "intensity"<br></code> |
| 24 |
<code> writeInfoLine: "Here are the results:"<br></code> |
| 25 |
<code> for i to (tmax-tmin)/0.01<br></code> |
| 26 |
<code> time = tmin + i * 0.01<br></code> |
| 27 |
<code> selectObject: "Pitch pitch"<br></code> |
| 28 |
<code> pitch = Get value at time: time, "Hertz", "linear"<br></code> |
| 29 |
<code> selectObject: "Intensity intensity"<br></code> |
| 30 |
<code> intensity = Get value at time: time, "cubic"<br></code> |
| 31 |
<code> appendInfoLine: fixed$ (time, 2), " ", fixed$ (pitch, 3), " ", fixed$ (intensity, 3)<br></code> |
| 32 |
<code> endfor<br></code> |
| 33 |
<h3>Links to this page</h3> |
| 34 |
<ul> |
| 35 |
<li><a href="Scripting_examples.html">Scripting examples</a> |
| 36 |
</ul> |
| 37 |
<hr> |
| 38 |
<address> |
| 39 |
<p>© ppgb 20200912</p> |
| 40 |
</address> |
| 41 |
</body> |
| 42 |
</html> |