-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy path534.html
More file actions
94 lines (93 loc) · 3.11 KB
/
Copy path534.html
File metadata and controls
94 lines (93 loc) · 3.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<h1 id="play">PLAY</h1>
<blockquote>
<p>PLAY string</p>
</blockquote>
<p>Play musical notes, a mp3 or ogg sound file. The music string is
composed of the following building blocks:</p>
<table>
<colgroup>
<col style="width: 32%" />
<col style="width: 67%" />
</colgroup>
<thead>
<tr class="header">
<th style="text-align: center;">String</th>
<th style="text-align: left;">Description</th>
</tr>
</thead>
<tbody>
<tr class="odd">
<td style="text-align: center;">A-G[-</td>
<td style="text-align: left;">+</td>
</tr>
<tr class="even">
<td style="text-align: center;">On</td>
<td style="text-align: left;">Octave n = 0..6, n = < moves down one
octave, n = > moves up one octave</td>
</tr>
<tr class="odd">
<td style="text-align: center;">Nn</td>
<td style="text-align: left;">Play note n = 0..84 (0 = pause)</td>
</tr>
<tr class="even">
<td style="text-align: center;">Pn</td>
<td style="text-align: left;">Pause n = 1..64</td>
</tr>
<tr class="odd">
<td style="text-align: center;">Ln</td>
<td style="text-align: left;">Length of note n = 1..64 (1/nnn)</td>
</tr>
<tr class="even">
<td style="text-align: center;">Tn</td>
<td style="text-align: left;">Tempo n = 32..255. Number of 1/4 notes per
minute.</td>
</tr>
<tr class="odd">
<td style="text-align: center;">MS</td>
<td style="text-align: left;">Staccato (1/2)</td>
</tr>
<tr class="even">
<td style="text-align: center;">MN</td>
<td style="text-align: left;">Normal (3/4)</td>
</tr>
<tr class="odd">
<td style="text-align: center;">ML</td>
<td style="text-align: left;">Legato</td>
</tr>
<tr class="even">
<td style="text-align: center;">Vn</td>
<td style="text-align: left;">Volume n = 0..100</td>
</tr>
<tr class="odd">
<td style="text-align: center;">MF</td>
<td style="text-align: left;">Play on foreground</td>
</tr>
<tr class="even">
<td style="text-align: center;">MB</td>
<td style="text-align: left;">Play on background</td>
</tr>
<tr class="odd">
<td style="text-align: center;">Q</td>
<td style="text-align: left;">Clear sound queue</td>
</tr>
</tbody>
</table>
<p>To play a sound file use <code>file://filename</code> as string. When
playing on background, program execution continuous. If the end of the
program is reach, the playback will stop.</p>
<h3 id="example-1-play-a-note">Example 1: Play a note</h3>
<pre><code>play "L2A" ' note A with length 1/2</code></pre>
<h3 id="example-2-play-multiple-notes">Example 2: Play multiple
notes</h3>
<pre><code>' Set volume to 50%
play "V10"
' Play Menuet by J. Sebastian Bach
play "T180L8O3MN O4D4O3MLGABO4C O4D4O3MNG4MLG4 O4MNE4MLCDEF# O4G4O3MNG4MLG4 O4MNC4MLDCO3BA O3MNB4MLO4CO3BAG O3MNA4MLBAGF# G2.MN"</code></pre>
<h3 id="example-3-play-notes-on-background">Example 3: Play notes on
background</h3>
<pre><code>play "MBL2A" ' note A with length 1/2 on background
pause ' make sure, that program will not end</code></pre>
<h3 id="example-4-play-a-sound-file">Example 4: Play a sound file</h3>
<pre><code>' Copy a mp3 file to the working directory and name it test.mp3
play "file://test.mp3"
pause ' make sure, that program will not end</code></pre>