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.
9 <img src="/images/MIDI_transform.png" alt="MIDI transformation">
10 <figcaption>MIDI transformation</figcaption>
14 Accessing the Transform tool is done by <kbd class="mouse">right</kbd> clicking
15 the MIDI region <kbd class="menu">><em>name_of_the_region</em> > MIDI
16 > Transform…</kbd>
20 To act on a property, it must be selected in the <kbd
21 class="menu">Set</kbd> field, then the target value must be changed using the two
22 following fields. To add more operands the "+" sign should be clicked to
23 create new lines. These can be removed using the "-" sign on the
24 right of the newly created lines.
28 In the picture above, the Transform tool has been used to add a bit of
29 humanization, by slightly changing the velocity of each note of the region, by
30 a random number between -19 and +19 from its original velocity. So
31 three operations are applied:
35 <li>Set velocity to this note's velocity</li>
36 <li>+ a random number from 1 to 20</li>
37 <li>- a random number from 1 to 20</li>
41 Each note will trigger a calculation of its own, so its velocity will be
42 increased by a random number between 1 and 20, then decreased by a random
43 number between 1 and 20.
47 The properties that can be computed are:
51 <li>note number (eg C2 is note number 24, C#2 is 25 and <a href="@@midi-notes-ref">so on</a>)</li>
52 <li>velocity (the global intensity of the note, between 0 and 127)</li>
53 <li>start time (in beats)</li>
54 <li>length (in beats)</li>
59 and the calculation may be based on the following properties:
64 <li>the previous note's</li>
65 <li>this note's index (number of the note, i.e. the first one is 0, the second
67 <li>exactly (for a constant value, between 1 and 127)</li>
68 <li>a random number from <em>lower</em> to <em>higher</em> (<em>lower</em> and
69 <em>higher</em> beeing constant values between 1 and 127)</li>
70 <li>equal steps from <em>lower</em> to <em>higher</em> (<em>lower</em> and
71 <em>higher</em> beeing constant values between 1 and 127).</li>
75 The mathematical operators can be:
80 <li>- (subtraction)</li>
81 <li>* (multiplication)</li>
82 <li>/ (euclidian division)</li>
83 <li>mod (remainder of the euclidian division).</li>
87 All these operations can be very handy, as long as there is a mathematical way
88 to achieve the targeted goal. Beware though of odd "border cases": division by
89 zero (which does nothing), using the note's index and forgetting it starts at
94 Very interesting results can nevertheless be created, like humanizing
95 (randomizing the velocity, start time and duration of all the notes), creating
96 arpeggios, automating tedious tasks, transposing, etc.