1 |
<html> |
2 |
<head> |
3 |
<meta name="author" content="Christian Schoenebeck"> |
4 |
<title>change_tune() function</title> |
5 |
<meta name="description" content="Modifies the tuning of voices of a particular note."> |
6 |
</head> |
7 |
<body> |
8 |
<h1>change_tune()</h1> |
9 |
<p> |
10 |
This function can be used to modify the tuning of active voices during |
11 |
their entire life time. So you may for example implement very sophisticated |
12 |
pitch envelopes by script by using this function. You need to pass the |
13 |
note ID of the voices you want to alter. This function will change the |
14 |
tuning of all active voices associated with the requested note. So if you |
15 |
are using a layered instrument patch, then it will change the tuning of |
16 |
all layers. |
17 |
</p> |
18 |
<p> |
19 |
The tuning changes set by calling function are always applied relatively to |
20 |
the tuning/pitch calculated by the synthesis model and sampler format. That means |
21 |
the various sources of tuning/pitch factors like MIDI pitch bend wheel, Pitch Envelopes, |
22 |
Pitch LFOs and other tuning factors that may be defined by the |
23 |
instrument patch, are always processed and calculated for the voices first, |
24 |
and the final pitch applied is always a relative combination of all those |
25 |
factors and the one set with this function call. This does also not change |
26 |
when you pass <code>1</code> for argument <code>??relative??</code>. |
27 |
Or in other words: you cannot replace the tuning/pitch set by other synthesis |
28 |
sources with this function. |
29 |
</p> |
30 |
|
31 |
<note class="important"> |
32 |
Release Trigger Samples: In case the affected voices cause release trigger |
33 |
samples to be spawned later on, the tuning of those release trigger voices |
34 |
will not be affected by this function at all. So if you need to control the |
35 |
tuning of release trigger samples by script, then you might rather also trigger |
36 |
those release trigger samples by script with <code lang="nksp">play_note()</code> |
37 |
instead of using the sampler format's internal support for release trigger samples. |
38 |
</note> |
39 |
|
40 |
<h3>Function Prototype</h3> |
41 |
<p/> |
42 |
<code lang="nksp"> |
43 |
change_tune(??note??, ??tuning??, [??relative??]) |
44 |
</code> |
45 |
|
46 |
<h3>Arguments</h3> |
47 |
<table> |
48 |
<tr> |
49 |
<th>Argument Name</th> <th>Data Type</th> <th>Description</th> |
50 |
</tr> |
51 |
<tr> |
52 |
<td><code>??note??</code></td> |
53 |
<td>Note ID Number</td> |
54 |
<td>All voices of this note will be modified.<br> |
55 |
[required]</td> |
56 |
</tr> |
57 |
<tr> |
58 |
<td><code>??tuning??</code></td> |
59 |
<td>Integer Number</td> |
60 |
<td>Tuning change in milli cents. |
61 |
A positive value increases the tuning, |
62 |
a negative value decreases the tuning.</td> |
63 |
</tr> |
64 |
<tr> |
65 |
<td><code>??relative??</code></td> |
66 |
<td>Integer Number</td> |
67 |
<td>Whether change_tune() calls should be relative to each other.<br> |
68 |
0: A call to <code>change_tune()</code> upon the same note will |
69 |
replace the tuning change value set by previous |
70 |
<code>change_tune()</code> calls upon the same note.<br> |
71 |
1: Successive calls to <code>change_tune()</code> upon the same |
72 |
note will be relatively applied against each other.<br> |
73 |
[optional, default: 0]</td> |
74 |
</tr> |
75 |
</table> |
76 |
|
77 |
<h3>Return Value</h3> |
78 |
<p>None.</p> |
79 |
|
80 |
<h3>Examples</h3> |
81 |
<p>None yet.<p> |
82 |
|
83 |
<h3>Availabilty</h3> |
84 |
<p>Since LinuxSampler 2.0.0.svn11.<p> |
85 |
|
86 |
</body> |
87 |
</html> |