Recherche Google
OpenMusic DocumentationOM 6.6 User Manual > Visual Programming II > Iterations: OMLoop > Accumulators > Min / Max
page précédentepage suivante

Min and Max : Comparing Values

Min and max compare the successive values of an iteration, and return the lowest or the highest one.

Inputs and Outputs

Min and max have one default input and three outputs :

  • "what" : collects successive values coming from other boxes.
  • first output :
  1. triggers the collection and the comparison of these incoming values

  2. returns the current lowest or highest collected value at each step of the loop

  • second output : returns the lowest or highest value
  • third output : reinitializes the accumulator with the highest or lowest possible numbers : 4294967296 and -4294967296. These are comparison references for the next values.

Example : Selecting the Lowest or Higher Value of a List

  1. Listloop enumerates the numbers of a list and returns them successively to min or max.

  2. Each time, the new number is compared to the current value.

    If it is higher – max – or lower – min – than the current value, it is stored instead of this current value.

  3. The current value is printed.

  4. The second output of min and max returns the resulting lowest or greatest value of all the list to Finally.

page précédentepage suivante
A propos...(c) Ircam - Centre PompidouRéalisé avec Scenari