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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3217 - (hide annotations) (download) (as text)
Thu May 25 16:28:34 2017 UTC (6 years, 10 months ago) by schoenebeck
File MIME type: text/html
File size: 2282 byte(s)
* NKSP: Added examples for change_vol_time() and change_tune_time().

1 schoenebeck 3189 <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     </p>
14    
15     <h3>Function Prototype</h3>
16     <p/>
17     <code lang="nksp">
18     change_vol_time(??note??, ??duration-us??)
19     </code>
20    
21     <h3>Arguments</h3>
22     <table>
23     <tr>
24     <th>Argument Name</th> <th>Data Type</th> <th>Description</th>
25     </tr>
26     <tr>
27     <td><code>??note??</code></td>
28     <td>Note ID Number or Note ID Array</td>
29     <td>All voices of this note will be modified.<br>
30     [required]</td>
31     </tr>
32     <tr>
33     <td><code>??duration-us??</code></td>
34     <td>Integer Number</td>
35     <td>Fade time in microseconds.<br>
36     [required]</td>
37     </tr>
38     </table>
39    
40     <h3>Return Value</h3>
41     <p>None.</p>
42    
43     <h3>Examples</h3>
44 schoenebeck 3217 <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 schoenebeck 3189
72     <h3>See also</h3>
73     <p><code>change_vol()</code>, <code>fade_in()</code>, <code>fade_out()</code><p>
74    
75 schoenebeck 3196 <h3>Availability</h3>
76 schoenebeck 3189 <p>Since LinuxSampler 2.0.0.svn45.<p>
77    
78     <note>
79     This function exists only with NKSP, it is not available with KSP.
80     </note>
81    
82     </body>
83     </html>

  ViewVC Help
Powered by ViewVC