| 1 |
<html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"> |
| 2 |
<title>Get time from sample number...</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 |
Get time from sample number... |
| 13 |
</b></font></table></table> |
| 14 |
<p>A command that becomes available in the <a href="Query_submenu.html">Query submenu</a> if you select a <a href="Sound.html">Sound</a> or <a href="LongSound.html">LongSound</a> object.</p> |
| 15 |
<p>The Info window will tell you the time (in seconds) associated with the sample number that you specify.</p> |
| 16 |
<h2>Setting</h2> |
| 17 |
<dl> |
| 18 |
<dt><b>Sample number</b> |
| 19 |
<dd>the sample number whose time is sought.</dd> |
| 20 |
</dl> |
| 21 |
<h2>Algorithm</h2> |
| 22 |
<p>the result is</p> |
| 23 |
<table width="100%" style="white-space:pre-wrap"><tr><td align=middle><i>t</i><sub>1</sub> + (<i>sampleNumber</i> - 1) · Δ<i>t</i></table> |
| 24 |
<p>where <i>t</i><sub>1</sub> is the time associated with the first sample, and Δ<i>t</i> is the sampling period.</p> |
| 25 |
<h2>Details for hackers</h2> |
| 26 |
<p>If you select a Sound or LongSound and click <a href="Inspect.html">Inspect</a>, you can see how the relation between sample numbers and times is stored in the object: <i>t</i><sub>1</sub> is the <b>x1</b> attribute, and Δ<i>t</i> is the <b>dx</b> attribute.</p> |
| 27 |
<hr> |
| 28 |
<address> |
| 29 |
<p>© ppgb 20221202</p> |
| 30 |
</address> |
| 31 |
</body> |
| 32 |
</html> |