1 |
<html> |
2 |
<head> |
3 |
<meta name="author" content="Christian Schoenebeck"> |
4 |
<title>change_velo() function</title> |
5 |
<meta name="description" content="Change MIDI velocity of note."> |
6 |
</head> |
7 |
<body> |
8 |
<h1>change_velo()</h1> |
9 |
<p> |
10 |
Changes the MIDI velocity of the requested note. |
11 |
</p> |
12 |
<p> |
13 |
Changing the velocity with this function only succeeds if the |
14 |
respective note is new. That effectively means you should change the |
15 |
velocity before any <code lang="nksp">wait()</code> calls, and before |
16 |
entering any loops that may execute your script for a very long time. |
17 |
Because in both cases the sampler may suspend your script for a certain |
18 |
amount of time and once your script got resumed, the respective event |
19 |
and the resulting note may already have entered the sampler's regular |
20 |
event processing chain and thus the note's velocity can no longer be |
21 |
changed. |
22 |
</p> |
23 |
<p> |
24 |
Note that the new velocity set by this function only affects the |
25 |
resulting new voices, it does not modify the actual MIDI event. |
26 |
That means the new voices behave as if the MIDI event itself was |
27 |
modified, that is for the new voices the instrument's synthesis |
28 |
parameter case and sample (i.e. if velocity splits are defined for |
29 |
the instrument) is selected based upon the new velocity. |
30 |
</p> |
31 |
<p> |
32 |
However outside the scope of new voices the old MIDI note number is |
33 |
retained. That means all other common MIDI processing tasks of the |
34 |
sampler are not affected by this function at all. |
35 |
</p> |
36 |
|
37 |
<h3>Function Prototype</h3> |
38 |
<p/> |
39 |
<code> |
40 |
change_velo(??event-id??, ??velocity??) |
41 |
</code> |
42 |
|
43 |
<h3>Arguments</h3> |
44 |
<table> |
45 |
<tr> |
46 |
<th>Argument Name</th> <th>Data Type</th> <th>Description</th> |
47 |
</tr> |
48 |
<tr> |
49 |
<td><code>??event-id??</code></td> |
50 |
<td>Event ID Number</td> |
51 |
<td>Event ID of the note to change.<br> |
52 |
[required]</td> |
53 |
</tr> |
54 |
<tr> |
55 |
<td><code>??velocity??</code></td> |
56 |
<td>Integer Number</td> |
57 |
<td>New MIDI velocity (<code>1</code> to <code>127</code>).<br> |
58 |
[required]</td> |
59 |
</tr> |
60 |
</table> |
61 |
|
62 |
<h3>Return Value</h3> |
63 |
<p>None.</p> |
64 |
|
65 |
<h3>Examples</h3> |
66 |
<p>None yet.</p> |
67 |
|
68 |
<h3>See also</h3> |
69 |
<p><code>set_event_par()</code>, <code>change_note()</code><p> |
70 |
|
71 |
<h3>Availability</h3> |
72 |
<p>Since LinuxSampler 2.0.0.svn49.<p> |
73 |
|
74 |
</body> |
75 |
</html> |