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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 3196 by schoenebeck, Sat May 20 14:27:01 2017 UTC revision 3249 by schoenebeck, Sun May 28 22:38:59 2017 UTC
# Line 11  Line 11 
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/>
# Line 41  change_vol_time(??note??, ??duration-us? Line 45  change_vol_time(??note??, ??duration-us?
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>

Legend:
Removed from v.3196  
changed lines
  Added in v.3249

  ViewVC Help
Powered by ViewVC