Debian Codegraph @

docs/manual/Demo_window_1__My_first_Demo_window_script.html

raw
1 <html><head><meta name="robots" content="index,follow"><meta http-equiv="Content-Type" content="text/html; charset=utf-8">
2 <title>Demo window 1. My first Demo window script</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 Demo window 1. My first Demo window script
13 </b></font></table></table>
14 <p>The Demo window is Praat&#8217;s least visible window: you can create it only through a script. Try the following script after selecting a Sound object:</p>
15 <code> <b><a href="_demo_.html">demo</a></b> <a href="Sound__Draw___.html">Draw:</a> 0, 3, -1, 1, “yes”, “curve”<br></code>
16 <p>You see the Demo window turn up on the screen, with the Sound painted into it. It works because the <a href="Sound__Draw___.html">Draw...</a> command is available in the Objects window when you select a Sound. Then try:</p>
17 <code> <b><a href="_demo_.html">demo</a></b> <a href="Draw_line___.html">Draw line:</a> 0, -1, 3, 1<br></code>
18 <p>You see a line drawn from (0 seconds, -1 Pa) to (3 seconds, +1 Pascal) in the waveform. It works because the <a href="Draw_line___.html">Draw line...</a> command is available in the Picture window. Then try:</p>
19 <code> <b><a href="_demo_.html">demo</a></b> <a href="Erase_all.html">Erase all</a><br></code>
20 <code> <b><a href="_demo_.html">demo</a></b> <a href="Red.html">Red</a><br></code>
21 <code> <b><a href="_demo_.html">demo</a></b> <a href="Axes___.html">Axes:</a> 0, 100, 0, 100<br></code>
22 <code> <b><a href="_demo_.html">demo</a></b> <a href="Text___.html">Text:</a> 50, “centre”, 50, “half”, “Hello”<br></code>
23 <p>You see a text appear in red, in the centre of the window. This works because you are using commands from the Picture window, including the <a href="Axes___.html">Axes...</a> command, which sets the world coordinates to something else than before (before, the world coordinates were determined by the Sound).</p>
24 <p>Now suppose you want the Sound to appear in the top half of the window, and some texts in the bottom left and bottom right corners of the window. You can use <a href="Select_outer_viewport___.html">Select outer viewport...</a> and <a href="Select_inner_viewport___.html">Select inner viewport...</a>, if you know that the size of the Demo window is &#8220;100&#8221; horizontally and &#8220;100&#8221; vertically (rather than 60&#215;60 inch, as the <a href="Picture_window.html">Picture window</a>), and that the point (0, 0) lies in the bottom left (rather than the top left, as in the Picture window):</p>
25 <code> <b><a href="_demo_.html">demo</a></b> <a href="Erase_all.html">Erase all</a><br></code>
26 <code> <b><a href="_demo_.html">demo</a></b> <a href="Black.html">Black</a><br></code>
27 <code> <b><a href="_demo_.html">demo</a></b> <a href="Times.html">Times</a><br></code>
28 <code> <b><a href="_demo_.html">demo</a></b> <a href="24.html">24</a><br></code>
29 <code> <b><a href="_demo_.html">demo</a></b> <b><a href="Select_outer_viewport___.html">Select outer viewport:</a></b> 0, 100, 50, 100<br></code>
30 <code> <b><a href="_demo_.html">demo</a></b> <a href="Sound__Draw___.html">Draw:</a> 0, 0, 0, 0, “yes”, “curve”<br></code>
31 <code> <b><a href="_demo_.html">demo</a></b> <b><a href="Select_inner_viewport___.html">Select inner viewport:</a></b> 0, 100, 0, 100<br></code>
32 <code> <b><a href="_demo_.html">demo</a></b> <a href="Axes___.html">Axes:</a> 0, 10, 0, 10<br></code>
33 <code> <b><a href="_demo_.html">demo</a></b> <a href="Text___.html">Text:</a> 0, “left”, 0, “bottom”, “Left bottom corner”<br></code>
34 <code> <b><a href="_demo_.html">demo</a></b> <a href="Text___.html">Text:</a> 10, “right”, 0, “bottom”, “Right bottom corner”<br></code>
35 <p>As the title page of a presentation, you could do:</p>
36 <code> <b><a href="_demo_.html">demo</a></b> <a href="Erase_all.html">Erase all</a><br></code>
37 <code> <b><a href="_demo_.html">demo</a></b> <a href="Select_inner_viewport___.html">Select inner viewport:</a> 0, 100, 0, 100<br></code>
38 <code> <b><a href="_demo_.html">demo</a></b> <a href="Axes___.html">Axes:</a> 0, 100, 0, 100<br></code>
39 <code> <b><a href="_demo_.html">demo</a></b> <a href="Paint_rectangle___.html">Paint rectangle:</a> “purple”, 0, 100, 0, 100<br></code>
40 <code> <b><a href="_demo_.html">demo</a></b> <a href="Pink.html">Pink</a><br></code>
41 <code> <b><a href="_demo_.html">demo</a></b> <a href="Text___.html">Text:</a> 50, “centre”, 50, “half”, “This is my title”<br></code>
42 <h3>Links to this page</h3>
43 <ul>
44 <li><a href="Demo_window.html">Demo window</a>
45 </ul>
46 <hr>
47 <address>
48 <p>© Paul Boersma 2009–2023,2025</p>
49 </address>
50 </body>
51 </html>