line

Automated blues "improviser"

This patch shows an idea for an automated improvising algorithm. At regular intervals of time, which one might think of as the length of a musical phrase (every 1.6 seconds in this example), the metro object chooses a new random number from 0 to 35. That number will be considered a target number toward which the line object should go.

Animating 2D graphics

In working with video and animation in Jitter, it’s important to remember that the effect of continuous motion is achieved by successive discrete images, each somewhat different from the preceding one. You can create that effect in 2D animation by repositioning graphic objects for each frame, according to a particular trajectory, such that the objects seem to be moving.

Linear note movement

The line object interpolates linearly from its current value to some new destination value, ramping over a specified period of time, reporting its intermediate values along the way. In this example, we instruct line to ramp toward a given destination value, arriving there in 2 seconds, sending out a report of its progress (the intermediate values as it goes toward the destination) 12 times per second (i.e., once every 83.333 milliseconds).

Linear interpolation to a new value

The rampsmooth~ object is useful for smoothing MSP signals, a sort of lowpass filter, especially appropriate for smoothing out overly sudden changes in control signals. The left part of this patch demonstrates the fact that internally rampsmooth~ is just doing linear interpolation. Whenever the input signal changes, rampsmooth~ heads toward that value from wherever it currently is, using the specified number of samples (depending on whether it has to increase or decrease) to get there.

Linear interpolation over time

The line object sends out a periodic series of numbers that progress to some new value over a certain amount of time. The input to line is a destination value (where it should eventually arrive), a transition time (how long it should take to get there), and a time interval between outputs (how often it should send out intermediate values along the way). The left part of this patch shows the use of line to generate integers that are used as pitches.

Interpolation with line or line~

The line~ object outputs a signal and interpolates sample-by-sample from wherever it currently is to wherever you tell it to go, in the amount of time you specify. So, if it is currently sending out a signal value of 0.5 and you tell it to go to 0.8 in 10 ms, it will start going to 0.8 and get there in 441 samples (assuming a sample rate of 44,100), sending out signal values like 0.50068, 0.50136, etc. till it arrives at 0.8, then it will stay there till it gets a new message.