Max

Sync Multiple sfplay~

The examples above show two different ways that you can trigger sound files while keeping in sync with a particular beat when the durations of the sound files are not perfect multiples of the beat duration, hence triggering the next sound file at the ending point of the current sound file results in the next sound file being started off the beat.

Extract Indices

In the first example, you can retrieve specific indices from a list using zl lookup.

The second example lets you input two values to be set as a maximum and minimum value of a range, and output a series of integers in that range. 

Mousestate

In this example, the horizontal location of the mouse in the screen is used to determine whether to send a bang or not. The mouse moving from one side of the screen, passing the mid point to the other side of the screen, causes a bang to be sent to the gswitch2 object. 

patcherargs output

This example is intends to clarify a situation where the difference between integers and symbols might be less than obvious. First of all, attribute names are symbols, not integers. Thus, they come out of patcherargs as symbols, not as integers. In this example, the route object tries to compare the symbol ‘-1’ with the number ‘-1’ and the test fails. Give it a try with some of the objects in this patch and note where they’re coming out.

Detokenizing Stream of Numbers

A Max user was having trouble detokenizing a stream of number. In this case, given a stream of number, he wanted to route the number immediately following a 8 to a first output, the number immediately following a 9 to a second output, the four numbers immediately following a 10 to a third output, and all the rest to a fourth output.