11 |
changes upon calls to <code lang="nksp">change_vol()</code>. That |
changes upon calls to <code lang="nksp">change_vol()</code>. That |
12 |
fade time is not set globally, but rather on a per-note level. |
fade time is not set globally, but rather on a per-note level. |
13 |
</p> |
</p> |
14 |
|
<p> |
15 |
|
Additionally you might call <code>change_vol_curve()</code> to override |
16 |
|
the default fade curve shape type. |
17 |
|
</p> |
18 |
|
|
19 |
<h3>Function Prototype</h3> |
<h3>Function Prototype</h3> |
20 |
<p/> |
<p/> |
45 |
<p>None.</p> |
<p>None.</p> |
46 |
|
|
47 |
<h3>Examples</h3> |
<h3>Examples</h3> |
48 |
<p>None yet.<p> |
<p>The following example demonstrates a simple, custom volume envelope generator.</p> |
49 |
|
<code> |
50 |
|
on init |
51 |
|
declare const $time1US := 800000 { 0.8 seconds } |
52 |
|
declare const $time2US := 1600000 { 1.6 seconds } |
53 |
|
declare const $time3US := 3000000 { 3 seconds } |
54 |
|
end on |
55 |
|
|
56 |
|
on note |
57 |
|
{ Start the note with a (immediately) decreased volume |
58 |
|
of -30 dB. } |
59 |
|
change_vol($EVENT_ID, -30000) |
60 |
|
|
61 |
|
{ Fade the note's volume within 0.8s from -30 db up to |
62 |
|
its normal volume, that is to 0 dB. } |
63 |
|
change_vol_time($EVENT_ID, $time1US) |
64 |
|
change_vol($EVENT_ID, 0) |
65 |
|
|
66 |
|
{ Remain in this stage with 0 dB for 1.6 seconds. } |
67 |
|
wait($time1US + $time2US) |
68 |
|
|
69 |
|
{ Now fade the note's volume from 0 dB down to -12 dB |
70 |
|
within 3 seconds. } |
71 |
|
change_vol_time($EVENT_ID, $time3US) |
72 |
|
change_vol($EVENT_ID, -12000) |
73 |
|
end on |
74 |
|
</code> |
75 |
|
|
76 |
<h3>See also</h3> |
<h3>See also</h3> |
77 |
<p><code>change_vol()</code>, <code>fade_in()</code>, <code>fade_out()</code><p> |
<p><code>change_vol()</code>, <code>change_vol_curve()</code>, <code>fade_in()</code>, <code>fade_out()</code><p> |
78 |
|
|
79 |
<h3>Availability</h3> |
<h3>Availability</h3> |
80 |
<p>Since LinuxSampler 2.0.0.svn45.<p> |
<p>Since LinuxSampler 2.0.0.svn45.<p> |