1 |
schoenebeck |
2954 |
<html> |
2 |
|
|
<head> |
3 |
|
|
<meta name="author" content="Christian Schoenebeck"> |
4 |
|
|
<title>change_decay() function</title> |
5 |
schoenebeck |
3361 |
<meta name="description" content="Modifies the amplitude decay time of voices of a particular note."> |
6 |
schoenebeck |
2954 |
</head> |
7 |
|
|
<body> |
8 |
|
|
<h1>change_decay()</h1> |
9 |
|
|
<p> |
10 |
schoenebeck |
3361 |
This function can be used to modify the amplitude decay time of active voices of a |
11 |
schoenebeck |
2954 |
particular note. |
12 |
|
|
In contrast to other synthesis parameter related functions, |
13 |
|
|
this function only allows to change the decay time when the respective note |
14 |
|
|
is new, that is either i.e. at the beginning of a <code lang="nksp">note</code> |
15 |
|
|
event handler or right after calling <code>play_note()</code>. So you should |
16 |
|
|
perform the decay value change as soon as possible, especially before calling any |
17 |
|
|
<code>wait()</code> function and before entering a loop which might take a |
18 |
|
|
long time to execute (which might cause your script to get |
19 |
|
|
forcely suspended by the script engine due to real-time constraints). |
20 |
|
|
</p> |
21 |
|
|
<p> |
22 |
|
|
The decay time changes set by calling this function are always applied relatively to |
23 |
|
|
the decay time calculated by the synthesis model and sampler format. That means |
24 |
schoenebeck |
2955 |
the various sources of decay factors like MIDI CCs and other decay parameter |
25 |
schoenebeck |
2954 |
factors that may be defined by the instrument patch, are always processed and |
26 |
|
|
calculated for the voices first, and the final decay time applied is always |
27 |
|
|
a relative combination of all those factors and the one set with this function call. |
28 |
schoenebeck |
2955 |
Or in other words: you cannot replace the decay set by other synthesis |
29 |
schoenebeck |
2954 |
sources with this function. |
30 |
|
|
</p> |
31 |
|
|
|
32 |
|
|
<note class="important"> |
33 |
|
|
Release Trigger Samples: In case the affected voices cause release trigger |
34 |
|
|
samples to be spawned later on, the decay time of those release trigger voices |
35 |
|
|
will not be affected by this function at all. So if you need to control the |
36 |
|
|
decay time of release trigger samples by script, then you might rather also trigger |
37 |
|
|
those release trigger samples by script with <code lang="nksp">play_note()</code> |
38 |
|
|
instead of using the sampler format's internal support for release trigger samples. |
39 |
|
|
</note> |
40 |
|
|
|
41 |
|
|
<h3>Function Prototype</h3> |
42 |
|
|
<p/> |
43 |
|
|
<code lang="nksp"> |
44 |
|
|
change_decay(??note??, ??time??) |
45 |
|
|
</code> |
46 |
|
|
|
47 |
|
|
<h3>Arguments</h3> |
48 |
|
|
<table> |
49 |
|
|
<tr> |
50 |
|
|
<th>Argument Name</th> <th>Data Type</th> <th>Description</th> |
51 |
|
|
</tr> |
52 |
|
|
<tr> |
53 |
|
|
<td><code>??note??</code></td> |
54 |
|
|
<td>Note ID Number or Note ID Array</td> |
55 |
|
|
<td>All voices of this note will be modified.<br> |
56 |
|
|
[required]</td> |
57 |
|
|
</tr> |
58 |
|
|
<tr> |
59 |
|
|
<td><code>??time??</code></td> |
60 |
schoenebeck |
3601 |
<td>Integer Number or<br> |
61 |
|
|
Real Number</td> |
62 |
schoenebeck |
3304 |
<td>Decay Time Value (abstract non-negative value, |
63 |
|
|
<code>0</code> for shortest time, <code>1000000</code> for neutral time factor, |
64 |
|
|
<code>2000000</code> for doubling the effective decay time).<br> |
65 |
schoenebeck |
2954 |
[required]</td> |
66 |
|
|
</tr> |
67 |
|
|
</table> |
68 |
|
|
|
69 |
|
|
<h3>Return Value</h3> |
70 |
|
|
<p>None.</p> |
71 |
|
|
|
72 |
schoenebeck |
3601 |
<h3>Remarks</h3> |
73 |
|
|
<p> |
74 |
|
|
This functions optionally accepts <code>s</code> as standard unit and |
75 |
|
|
finalness for its argument <code>??time??</code>. |
76 |
|
|
</p> |
77 |
|
|
|
78 |
schoenebeck |
2954 |
<h3>Examples</h3> |
79 |
|
|
<p>None yet.<p> |
80 |
|
|
|
81 |
schoenebeck |
3196 |
<h3>Availability</h3> |
82 |
schoenebeck |
3304 |
<p> |
83 |
|
|
Since LinuxSampler 2.0.0.svn19. |
84 |
|
|
Prior to LinuxSampler 2.0.0.svn68 the value range for <code>??time??</code> |
85 |
|
|
was limited to a maximum value of <code>1000000</code>. |
86 |
|
|
</p> |
87 |
schoenebeck |
2954 |
|
88 |
|
|
</body> |
89 |
|
|
</html> |