The function object and its duration
This object is a graphical way of displaying an ordered sequence of numbers. It allows you to set some data over a time axis. Theoretically, any values can be used but, by default, the object assumes that amplitude values (0.-1.) will be used on the Y axis, against time values on the X axis.
In the inspector of course, these values can be changed into any desired pair of values.
Starting by default at a duration of 1000 ms, usually the function object is sent a message to dynamically change that duration, bypassing the lengthier operation of using the inspector. In the message, the following text and format are used: setdomain $1.
This message can activate the parameter domain of the function object to receive a value. The value, though, is not specified straight away in the message itself but needs to be filled by a user input.
The user will send a time value to the message box (e.g. through a connected number box), and the message object will pass the whole information (setdomain + time value) to the function object.
So what does the $1 symbol stand for? It is a Max variable: this code simply allocates a space in the memory of the message to be filled by an incoming value through the left inlet (please note: not the right inlet!). A message can, in other circumstances, have multiple variables (e.g. $1, $2, $3, $4…$9) but not in this case as the domain parameter of the function object only expects one value, a time duration value.
Creating a ramp from a list of values
In its basic mechanism, the function object stores a list of values organised by time location. If the object is triggered with a bang in its leftmost inlet, the whole list is triggered instantaneously.
For these values to be useful musically, they should be really played in time. The object line~ works perfectly in this context. Line~ is designed to change smoothly between different signal values (in this case it works perfectly to use the amplitudes values of the Y axis of the function object), and it only requires the successive time values in which we want these changes to happen. Using line~ thus, and connecting it to a multiplier object, we can change over time the amplitude of an incoming sound.
The object line is similar to line~, but won’t deal with audio signals. Yet could be used for many other interesting musical purposes that will be explored in Lesson 4.
Remote messaging: Send and Receive, Send~ and Receive~ objects
When your creativity with Max patching expands exponentially, it is possible to incur in the problem of running out of space. Cables and objects could be crowding any single clear space in the patcher. Most of the times patcher cords can be avoided by cleverly using the following set of objects: the send object, and the receive object.
Firstly, these objects always work in pair: the send object can only send to a receive object. To do so, they require being labelled with a unique name. In the picture below, the send object named CIAO can only communicate with the receive object named CIAO, and, as you can see, lower caps matter.
These objects can then be placed anywhere is convenient into a patcher, saving a lot of space, especially otherwise occupied by numerous patch cords. They also work between different patchers, so make sure you name them with meaningful labels (e.g. not like with “CIAO” as I did!), that hint to the data you are sending through. That is not mandatory, but it is certainly a good practice for yourself and for the people that might want to study and use your patcher later on.
The extraordinary thing in Max is that the same remote messaging is possible also with audio signals. You just need to use the specific objects send~ and receive~ for audio signals. See them in actions in the following picture:
Labelling must be a unique name, with no spaces. If you leave a space, only the first part will be used, and the rest ignored.
The trigger object
The trigger object (or simply t object) is one of the most simple but powerful objects in Max. It allows complex ordering of data flow at the touch of one click. It will be used in many ways and context, for the moment what is important to learn is its basic behaviour: any data sent through its inlet will trigger an action. The action is dictated by the arguments placed in the body of the object.
Following the example shown in the picture, by sending to the trigger object the message 3.95, it has in response triggered five actions. If you look in the Max console to the right you will notice two important things: what data has been sent out and when.
WHEN:
As always, Max works from right to left. Therefore, as a response to an incoming data, some output is generated accordingly to the arguments in the body object, in the right to left order. First the s (which outputs no data, in this case), then the word “ciao”, then an integer value, then a float value, then the number 13. This can be tremendously useful when in need to prioritise certain tasks before others. In our sound shape context, it is important to send duration value before triggering a sound, so trigger object could be used in this way:
What:
In the arguments of the object, we have the following data and data placeholders, from right to left: s, the word “ciao”, i, f, the number 13.
When an input reaches the trigger object the data placeholder s doesn’t produce any data. In fact, no symbols (symbol stands for text words in Max) are received, therefore none are output. The word ciao is sent out: trigger triggers anything in its argument that are not just placeholders.
The word ciao is instead sent out: trigger, in fact, triggers any data in its argument that is not just placeholders data, therefore the word ciao is triggered.
The number 3 is sent out. The placeholder i, which stands for integer data, has received a numeric value (3.95), discarded the decimal part, and output the integer part.
The number 3.95 is sent out: that is precisely a decimal number which fits perfectly the data placeholder f, which stands for float. It is output in full.
The number 13 is not a data placeholder, but just numeric data: as trigger receives an input, it triggers out that numeric data too.
The fundamental distinction, thus, is in what the arguments in the objects body stand for: data placeholders and effective data. The objects, in any case, performs all the actions that are possible withing the limits prescribed, and in a strict right to left order.
Arguments
Arguments are initialisations that a Max programmer can add to its objects, to prepare them for performing specific actions. To add an argument simply type it in after the objects name (making sure you leave a space).
Arguments can be as many as the objects can afford, and it is possible to know them all only by practising and using Max regularly.