/[svn]/doc/docbase/instrument_scripts/nksp/reference/functions/nksp_change_vol_time_function.html
ViewVC logotype

Contents of /doc/docbase/instrument_scripts/nksp/reference/functions/nksp_change_vol_time_function.html

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3250 - (show annotations) (download) (as text)
Sun May 28 22:59:27 2017 UTC (4 years ago) by schoenebeck
File MIME type: text/html
File size: 2434 byte(s)
- Just minor cosmetics.

1 <html>
2 <head>
3 <meta name="author" content="Christian Schoenebeck">
4 <title>change_vol_time() function</title>
5 <meta name="description" content="Changes the duration of volume changes.">
6 </head>
7 <body>
8 <h1>change_vol_time()</h1>
9 <p>
10 This function can be used to override the internal fade time of volume
11 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.
13 Additionally you might call <code>change_vol_curve()</code> to override
14 the default fade curve shape type.
15 </p>
16
17 <h3>Function Prototype</h3>
18 <p/>
19 <code lang="nksp">
20 change_vol_time(??note??, ??duration-us??)
21 </code>
22
23 <h3>Arguments</h3>
24 <table>
25 <tr>
26 <th>Argument Name</th> <th>Data Type</th> <th>Description</th>
27 </tr>
28 <tr>
29 <td><code>??note??</code></td>
30 <td>Note ID Number or Note ID Array</td>
31 <td>All voices of this note will be modified.<br>
32 [required]</td>
33 </tr>
34 <tr>
35 <td><code>??duration-us??</code></td>
36 <td>Integer Number</td>
37 <td>Fade time in microseconds.<br>
38 [required]</td>
39 </tr>
40 </table>
41
42 <h3>Return Value</h3>
43 <p>None.</p>
44
45 <h3>Examples</h3>
46 <p>The following example demonstrates a simple, custom volume envelope generator.</p>
47 <code>
48 on init
49 declare const $time1US := 800000 { 0.8 seconds }
50 declare const $time2US := 1600000 { 1.6 seconds }
51 declare const $time3US := 3000000 { 3 seconds }
52 end on
53
54 on note
55 { Start the note with a (immediately) decreased volume
56 of -30 dB. }
57 change_vol($EVENT_ID, -30000)
58
59 { Fade the note's volume within 0.8s from -30 db up to
60 its normal volume, that is to 0 dB. }
61 change_vol_time($EVENT_ID, $time1US)
62 change_vol($EVENT_ID, 0)
63
64 { Remain in this stage with 0 dB for 1.6 seconds. }
65 wait($time1US + $time2US)
66
67 { Now fade the note's volume from 0 dB down to -12 dB
68 within 3 seconds. }
69 change_vol_time($EVENT_ID, $time3US)
70 change_vol($EVENT_ID, -12000)
71 end on
72 </code>
73
74 <h3>See also</h3>
75 <p><code>change_vol()</code>, <code>change_vol_curve()</code>, <code>fade_in()</code>, <code>fade_out()</code><p>
76
77 <h3>Availability</h3>
78 <p>Since LinuxSampler 2.0.0.svn45.<p>
79
80 <note>
81 This function exists only with NKSP, it is not available with KSP.
82 </note>
83
84 </body>
85 </html>

  ViewVC Help
Powered by ViewVC