41 |
<p>None.</p> |
<p>None.</p> |
42 |
|
|
43 |
<h3>Examples</h3> |
<h3>Examples</h3> |
44 |
<p>None yet.<p> |
<p>The following example demonstrates a simple, custom volume envelope generator.</p> |
45 |
|
<code> |
46 |
|
on init |
47 |
|
declare const $time1US := 800000 { 0.8 seconds } |
48 |
|
declare const $time2US := 1600000 { 1.6 seconds } |
49 |
|
declare const $time3US := 3000000 { 3 seconds } |
50 |
|
end on |
51 |
|
|
52 |
|
on note |
53 |
|
{ Start the note with a (immediately) decreased volume |
54 |
|
of -30 dB. } |
55 |
|
change_vol($EVENT_ID, -30000) |
56 |
|
|
57 |
|
{ Fade the note's volume within 0.8s from -30 db up to |
58 |
|
its normal volume, that is to 0 dB. } |
59 |
|
change_vol_time($EVENT_ID, $time1US) |
60 |
|
change_vol($EVENT_ID, 0) |
61 |
|
|
62 |
|
{ Remain in this stage with 0 dB for 1.6 seconds. } |
63 |
|
wait($time1US + $time2US) |
64 |
|
|
65 |
|
{ Now fade the note's volume from 0 dB down to -12 dB |
66 |
|
within 3 seconds. } |
67 |
|
change_vol_time($EVENT_ID, $time3US) |
68 |
|
change_vol($EVENT_ID, -12000) |
69 |
|
end on |
70 |
|
</code> |
71 |
|
|
72 |
<h3>See also</h3> |
<h3>See also</h3> |
73 |
<p><code>change_vol()</code>, <code>fade_in()</code>, <code>fade_out()</code><p> |
<p><code>change_vol()</code>, <code>fade_in()</code>, <code>fade_out()</code><p> |