Recherche Google
OMChroma User ManualUser-fun > Read modify and replace
page précédentepage suivante

Read modify and replace

Tutorial User-fun 02 - Read modify and replace

Patch description

This user-fun reads the value of the "freq" field, multiplies it by 2 and replace the old value.

Program flow

The user-fun patch must al less have 2 inlets and 1 outlet and these are always the same.

  • Input # 0 is the matrix of the OMChroma class,
  • Input # 1 pass the number of the rows which is read by the user-fun. Remember the number go from 0 to n-1 rows,
  • Output # 0 to connect the lambda patch to the OMChroma class.

All the other objects realize the algorithm and obviously are different in each patch. In this case :

  • The function get-comp gets the component one by one in sequential order,
  • The function comp-field with 2 inlets returns the value of the field corresponding to the line identiefier (2nd inlet). Here it is "freq",
  • The function OM* performs the calculus,
  • The function comp-field with 3 inlets assigns the value riceived in the 3rd inlet to the field corresponding to the line identiefier.

Tutorial User-fun 03 - Multiply for a random number

Patch description

This user-fun reads the value of the "freq" field, multiplies it by a random number between the minimum and maximum value given by the two supplementary inlets of the user-fun patch and replace the old value.

Reminder

In addition to the first 2 leftmost inlets, which are the matrix and the component number of the OMChroma class and that they don't have be connected, you can add how many inlets you need in the user-fun.

page précédentepage suivante
A propos...Réalisé avec Scenari