Max

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.

teeth~ test

If gain is set to 1, a teeth~ object with ‘feedforward gain’ and ‘feedback gain’ arguments set to 0 is bypassed/transparent, which can be used as a dry/wet control. This can be confirmed by reading the details tab of the help file, which shows the formula used by teeth~, or by making a simple test patch like this one to test the hypothesis yourself.

Poly-rhythm generator

To create a poly-rhythm generator, this example chooses a division and articulates every attack point of that division. Use a metro synched to the transport to specify the divisions (or the tempo object, if preferred), and then use a counter (or a % object with the output of tempo) to specify the articulation points.

Report a data stream’s peak

If you know the peak value you’re looking for, you can use sel, >=, peak, or past. If you’re looking at a stream of data coming in in real time and you don’t know what value you’re looking for, then you can only report that a peak has occurred after the peak has been reached, once the input value has started to decrease. This example does just that.

Iterate through Polyphonic MIDI files as simultaneous chords with detonate

Load a MIDI file into detonate, send it a “start” message, then send it “next” messages to output each note. Notice that the leftmost outlet sends out the delta time (in ms) until the next note in the score; that value can be tested, and if it’s sufficiently small, say under 50 ms for example, that means that the next note is practically simultaneous with the current one. The example then sends an additional ‘next’ message.

Match demo

Every number that comes in the left inlet of the match object—whether individually or as part of a list—gets used, in order, for the list-matching comparison. So, if it is looking for the list "1 1" and you send in lists "0 1", "1 1", "1 2", and "1 3" in that order, it’s as if match had received "1 0 1 1 1 2 1 3", and in that message it can find two matches for "1 1": at the 3rd and 4th items, and at the 4th and 5th items.