General event making objects

The easiest way to create an event in Max is to use some buttons. The bang (button object) is the most obvious. Let’s say a button trigger an event, whatever that is.

More specific events can, for example, be triggered with a kslider object (the Ma piano keyboard). Alongside triggering a note message, they can give pitch and velocity information at the same time.

The toggle object, similarly, produce and event alternatively associated with the number one and number 0. Every time it is pressed it produces one and zero alternatively.

The number boxes (float and integer, shortcut: f and i) generate numbers as we scroll through them.

A slider, each time we interact by touching its graphical slide, releases numbers from a specific range.

Listeners objects

These above-mentioned objects most of the time work best in combination with others. There are several objects in Max able to take choices upon the data passing through their inlets. They are select (or sel), counter, mathematical operators and for comparison (%, >, <, ==, !=, &&, ||…), router, and listfunnel. See some examples of their most common combinations here below.

Button and counter

Counter object counts numbers or bangs received in its left inlet. Sending a bang to counter will set it  to count, one count for each bang. The counting could within a specific range, rising or descending, looping or infinite.

screen-shot-2016-10-17-at-22-54-39

number and select

Using a number box we can send numeric values to other objects. By continuously scrolling into a number box we provoke a stream of numbers out of its outlet. We can look into it with a special object call select (also in abbreviation as sel). When select matches a number in the incoming stream it emits a bang. As simple as this might be, select is often used efficiently for sequencing, triggering musical events, and making distinctions between important numeric data (selecting pitch, velocity values against other and so on…)

screen-shot-2016-10-17-at-22-54-50

Select matching the number ten in its inlet and triggering a bang from the appropriate outlet

slider and mathematical operators

Mathematical operators are numerous as well as the comparison operators. These objects perform simple operations but are extremely useful. In this example a slider, whose default range goes between 0 to 127) is scrolled up and down, ending above and below a threshold. This threshold is looked after by the > object, which triggers a 1 when its comparison turns out to be true, a zero if it’s not. In this case, the operator looks for finding a number in the incoming stream from the slider higher than 64.

screen-shot-2016-10-17-at-22-54-59

When slider is above 64, comparison operator returns 1, otherwise, returns zero

indexing lists and distributing them accordingly

This is perhaps the most difficult combination of the four presented. A list of four words and a list of four numbers are sent through a listfunnel object. This object is able to detect each member of the list and assign to each of them an index number. Then, the now indexed items of the list, still packed together, flow into the route object, which splits each list member and assign each item to the corresponding route outlet, by matching the index with the outlet numbers. In the two examples below you can see that when sending the four words list into this system each of the words are output separately in each of the route outlet. This happens identically when the list of numbers is sent. The only limitation is that you need to know in advance how long the list will be (how many items) to be able to prepare the appropriate routing.

screen-shot-2016-10-17-at-22-55-04

Splitting a list of words into 4 outlets

screen-shot-2016-10-17-at-22-55-10

Splitting a list of numbers into 4 outlets

How to use them in sound making

All these objects create events. An event is something that happens in time and can be used to change a musical parameter, trigger a sound, turning on/off some other processes.

It can be generated by an initial human input, or by some time-generation operation as explained on this page, but then can develop a sequence of actions and choices that the computer is able to operate autonomously. Events objects are used then to make choices or to allow the computer to generate some. These choices can create, change, and interact with musical processes.