manual/include/transforming-midi---mathematical-operations.html

99 lines
3.4 KiB
HTML
Raw Normal View History

2017-01-03 04:01:45 -05:00
<figure class="right">
2023-10-08 09:07:06 -04:00
<img width="400px" src="/images/MIDI_transform.png" alt="MIDI transformation">
<figcaption>The MIDI transformation dialog</figcaption>
</figure>
2017-11-15 09:34:10 -05:00
<p>
Considering the numerical nature of MIDI events, it can be useful to
transform a MIDI region by applying mathematical operations to it. Ardour
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.
2017-11-15 09:34:10 -05:00
</p>
<p>
The Transform tool is accessed by <kbd class="mouse">right</kbd>-clicking
the MIDI region &gt; <em>name_of_the_region</em> &gt; MIDI &gt; Transform&hellip;.
</p>
2017-11-15 09:34:10 -05:00
<p>
First, the property to be modified in the <kbd class="menu">Set</kbd> field
is selected, then the target value is changed using the two fields that
follow. If more operands are desired, the <kbd class="menu">+</kbd> button is
clicked to create new lines. Any superfluous line can be removed by clicking
on the <kbd class="menu">-</kbd> button on the right side of the line to be
removed. Finally, once everything is set as desired, the <kbd
class=menu>Transform</kbd> button is pressed to apply the transformation.
</p>
2017-11-15 09:34:10 -05:00
<p>
In the image above, the Transform tool has been used to add a bit of
humanization, by slightly changing the velocity of each note of the region by
a random number between -19 and +19 from its original velocity. So the
following three operations are applied:
2017-11-15 09:34:10 -05:00
</p>
2017-01-03 04:01:45 -05:00
<ul>
<li>Set velocity to this note's velocity</li>
<li>+ a random number from 1 to 20</li>
<li>- a random number from 1 to 20</li>
2017-01-03 04:01:45 -05:00
</ul>
2017-11-15 09:34:10 -05:00
<p>
Each note will trigger a unique calculation, where its velocity will be
increased by a random number between 1 and 20, then decreased by a random
number between 1 and 20. This will result in a new velocity being applied to
the note, which will be the original velocity plus or minus a value &lt;19.
2017-11-15 09:34:10 -05:00
</p>
2017-11-15 09:34:10 -05:00
<p>
The parameters that can be transformed are:
2017-11-15 09:34:10 -05:00
</p>
2017-01-03 04:01:45 -05:00
<ul>
<li>MIDI note number (e.g. <a href="@@midi-notes-ref">C2 is note number 24,
C#2 is 25, etc.</a>)</li>
<li>MIDI velocity (the volume of the note, between 0 and 127)</li>
<li>start time (in beats)</li>
<li>length (in beats)</li>
<li>MIDI channel</li>
2017-01-03 04:01:45 -05:00
</ul>
2017-11-15 09:34:10 -05:00
<p>
and the transformation can be based on any of the following:
2017-11-15 09:34:10 -05:00
</p>
2017-01-03 04:01:45 -05:00
<ul>
<li>this note's</li>
<li>the previous note's</li>
<li>this note's index (number of the note, i.e. the first one is 0, the second
is 1, etc.)</li>
<li>exactly (for a constant value, between 1 and 127)</li>
<li>a random number from <em>lower</em> to <em>higher</em> (<em>lower</em> and
<em>higher</em> being constant values between 1 and 127)</li>
<li>equal steps from <em>lower</em> to <em>higher</em> (<em>lower</em> and
<em>higher</em> being constant values between 1 and 127)</li>
2017-01-03 04:01:45 -05:00
</ul>
2017-11-15 09:34:10 -05:00
<p>
The mathematical operators are:
2017-11-15 09:34:10 -05:00
</p>
2017-01-03 04:01:45 -05:00
<ul>
<li>+ (addition)</li>
<li>- (subtraction)</li>
<li>* (multiplication)</li>
<li>/ (euclidean division)</li>
<li>mod (remainder of the euclidean division)</li>
2017-01-03 04:01:45 -05:00
</ul>
2017-11-15 09:34:10 -05:00
<p class="note">
While the Transform tool is powerful, it is not infallible.
Things like division by zero (which does nothing), using the note's index and
thinking that it starts at one (instead of zero), etc. can yield
unexpected results.
2017-11-15 09:34:10 -05:00
<p>