3 <img src="/images/MIDI_transform.png" alt="MIDI transformation">
4 <figcaption>The MIDI transformation dialog</figcaption>
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.
11 The tool makes possible things such as humanizing (randomizing the velocity,
12 start time and duration of all the notes), creating arpeggios, automating
13 tedious tasks, transposing, etc.
17 The Transform tool is accessed by <kbd class="mouse">right</kbd>-clicking
18 the MIDI region > <em>name_of_the_region</em> > MIDI > Transform….
22 First, the property to be modified in the <kbd class="menu">Set</kbd> field
23 is selected, then the target value is changed using the two fields that
24 follow. If more operands are desired, the <kbd class="menu">+</kbd> button is
25 clicked to create new lines. Any superfluous line can be removed by clicking
26 on the <kbd class="menu">-</kbd> button on the right side of the line to be
27 removed. Finally, once everything is set as desired, the <kbd
28 class=menu>Transform</kbd> button is pressed to apply the transformation.
32 In the image above, the Transform tool has been used to add a bit of
33 humanization, by slightly changing the velocity of each note of the region by
34 a random number between -19 and +19 from its original velocity. So the
35 following three operations are applied:
39 <li>Set velocity to this note's velocity</li>
40 <li>+ a random number from 1 to 20</li>
41 <li>- a random number from 1 to 20</li>
45 Each note will trigger a unique calculation, where its velocity will be
46 increased by a random number between 1 and 20, then decreased by a random
47 number between 1 and 20. This will result in a new velocity being applied to
48 the note, which will be the original velocity plus or minus a value <19.
52 The parameters that can be transformed are:
56 <li>MIDI note number (e.g. <a href="@@midi-notes-ref">C2 is note number 24,
57 C#2 is 25, etc.</a>)</li>
58 <li>MIDI velocity (the volume of the note, between 0 and 127)</li>
59 <li>start time (in beats)</li>
60 <li>length (in beats)</li>
65 and the transformation can be based on any of the following:
70 <li>the previous note's</li>
71 <li>this note's index (number of the note, i.e. the first one is 0, the second
73 <li>exactly (for a constant value, between 1 and 127)</li>
74 <li>a random number from <em>lower</em> to <em>higher</em> (<em>lower</em> and
75 <em>higher</em> being constant values between 1 and 127)</li>
76 <li>equal steps from <em>lower</em> to <em>higher</em> (<em>lower</em> and
77 <em>higher</em> being constant values between 1 and 127)</li>
81 The mathematical operators are:
86 <li>- (subtraction)</li>
87 <li>* (multiplication)</li>
88 <li>/ (euclidian division)</li>
89 <li>mod (remainder of the euclidian division)</li>
93 While the Transform tool is powerful, it is not infallible.
94 Things like division by zero (which does nothing), using the note's index and
95 thinking that it starts at one (instead of zero), etc. can yield