1 |
<html> |
2 |
<head> |
3 |
<meta name="author" content="Christian Schoenebeck"> |
4 |
<title>same_region() function</title> |
5 |
<meta name="description" content="Check whether two keys are mapped to the same region."> |
6 |
</head> |
7 |
<body> |
8 |
<h1>same_region()</h1> |
9 |
<p> |
10 |
The key range (or note range if you will) of instruments is assigned to |
11 |
one more multiple keyboard regions. So each "region" is responsible for |
12 |
mapping audio samples and synthesis parameters for a certain key range. |
13 |
This function takes two keys on the keyboard (as MIDI note numbers) as |
14 |
arguments and checks the region relationship of the two keys, that is if the two |
15 |
keys have a region mapped each, and if yes how the relationship of those two |
16 |
regions exactly is. So the result value of this function depends on the |
17 |
precise regions layout of the currently loaded instrument. |
18 |
</p> |
19 |
|
20 |
<h3>Function Prototype</h3> |
21 |
<p/> |
22 |
<code lang="nksp"> |
23 |
same_region(??key1??, ??key2??) |
24 |
</code> |
25 |
|
26 |
<h3>Arguments</h3> |
27 |
<table> |
28 |
<tr> |
29 |
<th>Argument Name</th> <th>Data Type</th> <th>Description</th> |
30 |
</tr> |
31 |
<tr> |
32 |
<td><code>??key1??</code></td> |
33 |
<td>Integer Number</td> |
34 |
<td>Note number.<br> |
35 |
[required]</td> |
36 |
</tr> |
37 |
<tr> |
38 |
<td><code>??key2??</code></td> |
39 |
<td>Integer Number</td> |
40 |
<td>Note number.<br> |
41 |
[required]</td> |
42 |
</tr> |
43 |
</table> |
44 |
|
45 |
<h3>Return Value</h3> |
46 |
<table> |
47 |
<tr> |
48 |
<th>Description</th> <th>Data Type</th> |
49 |
</tr> |
50 |
<tr> |
51 |
<td>Relationship of the two keys:<br> |
52 |
0: Both keys have a region, however they are two different |
53 |
regions, which also and don't overlap each other.<br> |
54 |
1: Both keys have a region and it is exactly the same region.<br> |
55 |
2: Both keys have a region, which are two different regions, they are overlapping each other though.<br> |
56 |
3: <code>??key1??</code> has a region, <code>??key2??</code> does not have any region.<br> |
57 |
4: <code>??key1??</code> does not have any region, <code>??key2??</code> has a region.<br> |
58 |
5: <code>??key1??</code> and <code>??key2??</code> both don't have any region. |
59 |
</td> |
60 |
<td>Integer Number</td> |
61 |
</tr> |
62 |
</table> |
63 |
|
64 |
<note> |
65 |
The GigaStudio/Gigasampler format currently does not officially allow |
66 |
overlapping regions. So the designated return value <code>2</code> is |
67 |
reserved for such a potential future feature. |
68 |
</note> |
69 |
|
70 |
<h3>Examples</h3> |
71 |
<p>None yet.</p> |
72 |
|
73 |
<h3>Availability</h3> |
74 |
<p>Since LinuxSampler 2.0.0.svn53.<p> |
75 |
|
76 |
<note class="important"> |
77 |
This function is currently only available for the GigaStudio/Gigasampler |
78 |
format engine. |
79 |
</note> |
80 |
|
81 |
</body> |
82 |
</html> |