line

Timed linear fade

This patch shows how to make a fade-in or a fade-out using the line object (for numbers) or line~ (for a signal). You provide the line (or line~) object with a two-item list signifying a destination value and an amount of time, in milliseconds, to get to the destination.

MIDIGlissando

This example shows how to control glissando using MIDI. A little bit of revision: MIDI notes can only be played with whole numbers 0-127. Some synths allow you to specify an alternate tuning other than 12-tone equal temperament, but that’s not what we’re after in this case. So, let’s say, if you’re converting frequency to midi note values you will need to calculate the desired pitchbend from the fractional part of the value you obtain from ftom.

Inactivity Ramp

This example shows how to get the output of a slider object to slowly ramp back down to 0 after 10 seconds of inactivity. While in this example we used the slider object, the same result will hold with other objects.

Countdown

This example shows how to make a countdown progress indicator by progressively filling a circle. The circle is filled with an arc, with a radius coming from the position 12 o’clock (at time 0%). At time 25%, the first upper right quadrant is filled, and so on, until 12 o’clock (at time 100%), when the circle is filled.

Sigmoid vs Sinusoid acceleration control

You can calculate the desired acceleration/deceleration curve using expr. The smoothest acceleration/deceleration is exhibited by simple harmonic motion (like the swinging of a pendulum), which would be a sinusoidal curve rather than a sigmoid curve (and a sigmoid is theoretically asymptotic, i.e. never truly reaches its goal). You can calculate either with expr. Here’s an example comparing the two. 

Time interval and rate

This patch provides examples that compare linear rate changes to exponential rate changes. As with pitch and loudness, our sense of change in the rate of events is based on the ratio of tempos rather than the (subtractive) difference between tempos. In these examples, the rate changes by a factor of 16, from 1 event per second to 16 events per second, or vice versa.

Automated countermelody improviser

This patch provides an example of simple interactive improvising program that plays a melody influenced by the notes played by a live performer. Based on the most recently received MIDI note, the program chooses a scale to use for its melody, and moves melodically in a straight line toward the pitch and velocity most recently received. The program has only one use of randomness, to make a probabilistic decision. It has a small musical knowledgebase of three scales, and a set of probabilities determining which scale is more appropriate for use at any time.

Other Attachments: