7 |
<body> |
<body> |
8 |
<h1>play_note()</h1> |
<h1>play_note()</h1> |
9 |
<p> |
<p> |
10 |
Triggers a new note to be played by the sampler. This is like generating |
Triggers a new note to be played by the sampler. This is almost |
11 |
a new MIDI note-on event programmatically. |
like generating |
12 |
|
a new MIDI note-on event programmatically, with the difference though |
13 |
|
that triggering a note programmatically this way does not cause a |
14 |
|
<code lang="nksp">note</code> event handler to be executed for the new note, nor |
15 |
|
will any MIDI specific note-on handling be done (i.e. it will have |
16 |
|
no effect on key switching or on the status of built-in array variable |
17 |
|
<code>%KEY_DOWN[]</code>). |
18 |
</p> |
</p> |
19 |
|
|
20 |
<h3>Function Prototype</h3> |
<h3>Function Prototype</h3> |
38 |
<td><code>??velocity??</code></td> |
<td><code>??velocity??</code></td> |
39 |
<td>Integer Number</td> |
<td>Integer Number</td> |
40 |
<td>Trigger velocity.<br> |
<td>Trigger velocity.<br> |
41 |
[optional, default: 127]</td> |
[optional, default: <code>127</code>]</td> |
42 |
</tr> |
</tr> |
43 |
<tr> |
<tr> |
44 |
<td><code>??offset-us??</code></td> |
<td><code>??offset-us??</code></td> |
45 |
<td>Integer Number</td> |
<td>Integer Number</td> |
46 |
<td>Start offset of the sample to be played in microseconds.<br> |
<td>Start offset of the sample to be played in microseconds.<br> |
47 |
[optional, default: 0]</td> |
[optional, default: <code>0</code>]</td> |
48 |
</tr> |
</tr> |
49 |
<tr> |
<tr> |
50 |
<td><code>??duration-us??</code></td> |
<td><code>??duration-us??</code></td> |
51 |
<td>Integer Number</td> |
<td>Integer Number</td> |
52 |
<td>Length of the note to be played in microseconds.<br> |
<td>Length of the note to be played in microseconds.<br> |
53 |
-1: The note will be stopped when the event |
<code>-1</code>: The note will be stopped when the event |
54 |
handler's note stops.<br> |
handler's note stops (must only be used with |
55 |
0: The entire note's sample will be played to its end.<br> |
<code>note</code> event handlers).<br> |
56 |
[optional, default: 0]</td> |
<code>0</code>: The entire note's sample will be played to its end.<br> |
57 |
|
[optional, default: <code>0</code>]</td> |
58 |
</tr> |
</tr> |
59 |
</table> |
</table> |
60 |
|
|
61 |
<note> |
<note> |
62 |
You need at least LinuxSampler 2.0.0.svn2 or higher for passing a value |
You need at least LinuxSampler 2.0.0.svn2 or higher for passing a value |
63 |
higher than <code>0</code> for <code>??duration-us??</code>. |
higher than <code>0</code> for <code>??duration-us??</code>, and you need |
64 |
|
at least LinuxSampler 2.0.0.svn3 or higher for passing <code>-1</code> for |
65 |
|
<code>??duration-us??</code>. |
66 |
</note> |
</note> |
67 |
|
|
68 |
<note class="important"> |
<note class="important"> |
69 |
Passing <code>-1</code> for <code>??duration-us??</code> is not |
Passing any other value than <code>0</code> for <code>??offset-us??</code> |
70 |
supported by LinuxSampler yet. |
is not supported by LinuxSampler yet. |
71 |
</note> |
</note> |
72 |
|
|
73 |
<h3>Return Value</h3> |
<h3>Return Value</h3> |