]> Shamusworld >> Repos - ardour-manual/blob - include/transforming-midi---mathematical-operations.html
Spelling & grammar fixes
[ardour-manual] / include / transforming-midi---mathematical-operations.html
1
2 <p>
3         Considering the numerical nature of MIDI events, it can be tempting to apply
4   mathematical transformations to our MIDI regions by using mathematical
5   operations. Ardour makes it very easy and powerful with the Transform tool.
6 </p>
7
8 <figure>
9         <img src="/images/MIDI_transform.png" alt="MIDI transformation">
10         <figcaption>MIDI transformation</figcaption>
11 </figure>
12
13 <p>To access the Transform tool, right click the MIDI region &gt; <em>name_of_the_region</em> &gt; MIDI &gt; Transform&hellip;</p>
14
15 <p>First, select the property you want to modify in the 'Set' field, then change the target value using the 2 following fields. If you want to add more operands, click the "+" sign to create new lines. You can remove a superfluous line using the "-" sign on the right of the newly created line.</p>
16
17 <p>
18         In the picture above, the Transform tool has been used to add a bit of
19         humanisation, by slightly changing the velocity of each note of the region, by
20         a random number between -19 and +19 from its original velocity. So
21         three operations are applied:
22 </p>
23
24 <ul>
25         <li>Set velocity to this note's velocity</li>
26         <li>+ a random number from 1 to 20</li>
27         <li>- a random number from 1 to 20</li>
28 </ul>
29
30 <p>
31         Each note will trigger a calculation of its own, so its velocity will be
32         increased by a random number between 1 and 20, then decreased by a random
33         number between 1 and 20.
34 </p>
35
36 <p>
37         The properties that can be computed are:
38 </p>
39
40 <ul>
41         <li>note number (e.g. C2 is note number 24, C#2 is 25 and <a href="@@midi-notes-ref">so on</a>)</li>
42         <li>velocity (the global intensity of the note, between 0 and 127)</li>
43         <li>start time (in beats)</li>
44         <li>length (in beats)</li>
45         <li>channel</li>
46 </ul>
47
48 <p>
49         and the calculation may be based on the following properties:
50 </p>
51
52 <ul>
53         <li>this note's</li>
54         <li>the previous note's</li>
55         <li>this note's index (number of the note, i.e. the first one is 0, the second
56                 is 1, etc.)</li>
57         <li>exactly (for a constant value, between 1 and 127)</li>
58         <li>a random number from <em>lower</em> to <em>higher</em> (<em>lower</em> and
59                 <em>higher</em> being constant values between 1 and 127)</li>
60         <li>equal steps from <em>lower</em> to <em>higher</em> (<em>lower</em> and
61                 <em>higher</em> being constant values between 1 and 127)</li>
62 </ul>
63
64 <p>
65         The mathematical operators can be:
66 </p>
67
68 <ul>
69         <li>+ (addition)</li>
70         <li>- (subtraction)</li>
71         <li>* (multiplication)</li>
72         <li>/ (euclidian division)</li>
73         <li>mod (remainder of the euclidian division).</li>
74 </ul>
75
76 <p class="note">
77         All these operations can be very handy, as long as there is a mathematical way
78         to achieve the targeted goal. Beware though of odd "border cases": division by
79         zero (which does nothing), using the note's index and forgetting it starts at
80         0 and not 1, etc.
81 <p>
82
83 <p>
84         Very interesting results can nevertheless be created, like humanizing
85         (randomizing the velocity, start time and duration of all the notes), creating
86         arpeggios, automating tedious tasks, transposing, etc.
87 </p>