]> Shamusworld >> Repos - ardour-manual/blob - include/transforming-midi---mathematical-operations.html
b3647dc42a6b4a85d8ce01c942368cdba8165a9d
[ardour-manual] / include / transforming-midi---mathematical-operations.html
1
2 <figure class="right">
3   <img src="/images/MIDI_transform.png" alt="MIDI transformation">
4   <figcaption>The MIDI transformation dialog</figcaption>
5 </figure>
6
7 <p>
8   Considering the numerical nature of MIDI events, it can be useful to
9   transform a MIDI region by applying mathematical operations to it. Ardour
10   makes this kind of powerful transformation very easy with the Transform tool. The tool makes possible things such as humanizing (randomizing the velocity, start time and duration of all the notes), creating arpeggios, automating tedious tasks, transposing, etc.
11 </p>
12
13 <p>
14   To access the Transform tool, right click the MIDI region &gt;
15   <em>name_of_the_region</em> &gt; MIDI &gt; Transform&hellip;.
16 </p>
17
18 <p>
19   First, the property to be modified in the <kbd class="menu">Set</kbd> field
20   is selected, then the target value is changed using the two fields that
21   follow. If more operands are desired, the <kbd class="menu">+</kbd> button is
22   clicked to create new lines. Any superfluous line can be removed by clicking
23   on the <kbd class="menu">-</kbd> button on the right side of the line to be
24   removed. Finally, once everything is set as desired, the <kbd
25   class=menu>Transform</kbd> button is pressed to apply the transformation.
26 </p>
27
28 <p>
29   In the image above, the Transform tool has been used to add a bit of
30   humanization, by slightly changing the velocity of each note of the region by
31   a random number between -19 and +19 from its original velocity. So the
32   following three operations are applied:
33 </p>
34
35 <ul>
36   <li>Set velocity to this note's velocity</li>
37   <li>+ a random number from 1 to 20</li>
38   <li>- a random number from 1 to 20</li>
39 </ul>
40
41 <p>
42   Each note will trigger a unique calculation, where its velocity will be
43   increased by a random number between 1 and 20, then decreased by a random
44   number between 1 and 20. This will result in a new velocity being applied to
45   the note, which will be the original velocity plus or minus 19.
46 </p>
47
48 <p>
49   The parameters that can be transformed are:
50 </p>
51
52 <ul>
53   <li>MIDI note number (e.g. <a href="@@midi-notes-ref">C2 is note number 24,
54   C#2 is 25, etc.</a>)</li>
55   <li>MIDI velocity (the volume of the note, between 0 and 127)</li>
56   <li>start time (in beats)</li>
57   <li>length (in beats)</li>
58   <li>MIDI channel</li>
59 </ul>
60
61 <p>
62   and the transformation can be based on any of the following:
63 </p>
64
65 <ul>
66   <li>this note's</li>
67   <li>the previous note's</li>
68   <li>this note's index (number of the note, i.e. the first one is 0, the second
69   is 1, etc.)</li>
70   <li>exactly (for a constant value, between 1 and 127)</li>
71   <li>a random number from <em>lower</em> to <em>higher</em> (<em>lower</em> and
72   <em>higher</em> being constant values between 1 and 127)</li>
73   <li>equal steps from <em>lower</em> to <em>higher</em> (<em>lower</em> and
74   <em>higher</em> being constant values between 1 and 127)</li>
75 </ul>
76
77 <p>
78   The mathematical operators are:
79 </p>
80
81 <ul>
82   <li>+ (addition)</li>
83   <li>- (subtraction)</li>
84   <li>* (multiplication)</li>
85   <li>/ (euclidian division)</li>
86   <li>mod (remainder of the euclidian division)</li>
87 </ul>
88
89 <p class="note">
90   Keep in mind that while the Transform tool is powerful, it is not infallible.
91   Things like division by zero (which does nothing), using the note's index and
92   thinking that it starts at one (instead of zero), etc. can yield
93   unexpected results.
94 <p>
95