Each contour is implemented as a collection of contiguous segments, of which segment i has four properties:
By contiguous I mean that the segments are listed in relative-time order so that b_{i} coincides with a_{i+1}. The starting time and ending time are both measured in whole notes rather than seconds. The mathematical formulae that follow will employ the variable r to indicate relative time, as distinguished from t, which indicates absolute time.
Alan Ashton's linear music code provided a model of economy for generating contours. This model makes use of the fact that the score-generating engine keeps internal track of (relative) time. Two scenarios are addressed:
The value v_{i}(r) of segment i at time r may be calculated using one of three interpolation methods: discrete, linear, and exponential.
Discrete contours are made up of segments within which the value at any time during the segment is equal to the segment's initial value.
When the calculation method is discrete, the interpolation formula is simply:
Within a linear segment, values evolve in a manner which produces equal increments over equal durations. For example in a segment starting at time 0 with value 0 and ending at time 4 with value 10, then the values increment by 2.5 over each quarter note.
Linear interpolation has been available from sound-synthesis transcription utilities as early as the MOVE feature of Leland Smith's SCORE program, which I witnessed during 1976.
Contours which interface to MIDI controls should either be linear or spline.
The linear calculation method relies on an interpolation factor x_{i}(r), which is calculated as:
x_{i}(r) = | r − a_{i} b_{i} − a_{i} |
The effect of this expression is to rescale the time axis so that x_{i}(a) = 0, so that x_{i}(b) = 1, and so that when r is mid-way between a and b, then x_{i}(r) = 0.5
The interpolation formula is therefore:
The technical name for a curve section which receives its initial direction from its predecessor and which passes along its final direction to its successor is a spline. For the present purposes, the both the initial and final curve direction should be horizontal. Put another way, The curve should progress as shown in Figure 1: the slope should increase from zero (flat) to an unsteep maximum at the mid point of the segment; it should taper back to zero as the segment completes.
I am not aware of spline interpolation being used either directly by any sound-synthesis engines or by any score-transcription utilities, but this does not mean it did not happen. I do vaguely remember spline-like techniques being applied in digital sound-editing software described by Andy Moorer of LucasFilm.
Contours which interface to MIDI controls should either be linear or spline.
The Wikipedia article on splines identifies the third order polynomial used for calculating spline values. Given the previous stipulation that the slope should be flat at the segment's starting and ending times, Wikipedia's polynomial simplifies to:
Where t = x_{i}(r) calculated as described above for the linear calculation method.
The interpolation formula is therefore:
Within an exponential segment, values evolve in a manner which grows (or reduces) by equal ratios over equal durations. For example in a segment starting at time 0 with value 1 and ending at time 3 with value 8, then the values grow by a ratio of 2 over each quarter note.
Exponential interpolation has been available from sound-synthesis transcription utilities as early as the MOVX feature of Leland Smith's SCORE program, which I witnessed during 1976.
Exponential contours are useful in MUSIC-N style digital sound synthesis for controlling attributes such as amplitude and frequency. If you expect to export both to MIDI and to MUSIC-N, you should set up your contours as linear and employ the exponential conversion feature.
The exponential calculation method shares an interpolation factor x_{i}(r) calculated as described above for the linear calculation method.
The interpolation formula depends upon the relationship between β_{i} and α_{i}:
Accelerations and ritards of tempo are felt to be most uniform when durations expand or contract by equal ratios. However to convert durations from relative time, expressed in quarter notes into absolute time, expressed in seconds, requires summing up areas underneath an exponential tempo mapping. This problem is further discussed in the next topic.
Spline-exponential contours are to spline contours as exponential contours are to linear contours.
The spline-exponential calculation method shares the interpolation factor x_{i}(r) calculated as described above for the linear calculation method. It also shares the 3rd degree polynomial q(t) calculated as described above for the spline calculation method. The interpolation formula depends upon the relationship between β_{i} and α_{i}:
I am not aware of spline-exponential interpolation being used either directly by any sound-synthesis engines or by any score-transcription utilities.
Next topic: Tempo Calculations
© Charles Ames | Page created: 2013-10-16 | Last updated: 2017-03-11 |