Process Modules

Process modules alter, modify, or translate the input to produce a transformed output.


Smooth Slew FadeMs Delta HiLo Sort4 Max2Range

Octave Semitone FitScale PitchMap Coerce QuantNote Nudge

Ms2Tempo Tempo2Ms GenRGB Col2RGB RGB2Col Col2HLS HLS2Col


Smooth

Smooth value, by averaging last (Lag) inputs.

Output:

Out: Processed input.

Inputs:

In: A changing value that will be averaged over time.

Lag: Smooth amount 0 - 127, higher values give more effect; 0=none.

Int: NZ to force output to an integer.


Slew

Slews toward the last received input. This module changes at a set step rate, rather than a set time rate as the FadeMs, so it slews faster for smaller input changes. This module is useful for automatically changing parameters, such as volume, over time.

Output:

Out: Changing value, steps toward input.

Inputs:

In: Target for next slew.

Slew: Slew amount; 0 or <0 is instant; higher is faster; may be decimal fraction for very slow slew. Typical slew values are 0.1 to 2.0 in .1 steps.

Int: NZ to force output to an integer.


FadeMs

Fades in (upward) or out (downward) toward the last received input over a constant time, regardless of the value difference in the input change. This is different from Slew, which changes at a set step rate and threfore is faster for smaller input changes.. This module is useful for automatically changing parameters, such as volume, over time.

Output:

Out: Changing value, steps toward input.

Inputs:

Valu: Target for next fade.

fIn: Fade In (toward higher value) time in scale units as set by scale inputs; 0 or <0 is instant.

fOut: Fade Out (toward lower value) time in scale units as set by scale inputs; 0 or <0 is instant.

sFrm: Scale From value, 127 gives MIDI range; 0 sets no scaling and time units in milliseconds.

sTo: Scale To value, fade time in milliseconds. This is the maximum fade time for the given maximum scale (sFrm) value, however you may give higher values for fIn and fOut and it will work as expected. For example, if the sFrm scale value is set to 100 and you give fIn or fOut a fade value of 200, the actual fade time will be double that given in sTo.

Int: NZ to force output to an integer.


Delta

Detect any change in input, return signed magnitude of change (delta).

Output:

Out: 0 if no change in input; positive delta if ascending, negative if descending.

Inputs

In: Any changing value.


HiLo

Sort two inputs, always returning the higher input value in the Hi output, and the lower in the Lo output.

Output:

Hi: The higher of inputs 1 and 2.

Lo: The lower of inputs 1 and 2.

Inputs:

In1: Any numeric value.

In2: Any numeric value.


Sort4

Sort four inputs, always returning the highest value input value in the Hi output, and the lowest in the Lo output.

Output:

Hi: Highest of 4 inputs.

2nd: 2nd highest of 4 inputs.

3rd: 3rd highest of 4 inputs.

Lo: Lowest of 4 inputs.

Inputs:

In1: Any numeric value.

In2: Any numeric value.

In1: Any numeric value.

In2: Any numeric value.


Max2Range

Convert Max, Min parameters to Range, Offset parameters (swaps Max, Min if Min > Max).

Output:

Range: Range value for given Max, Min.

Ofst: Offset value for given Max, Min.

Inputs:

Max: Max value to convert to Range, Offset.

Min: Min value to convert to Range, Offset.


Octave

Keeps output within an octave range without loosing the chromatic note value. It does this by folding octaves that are higher than the range setting, wrapping them around.

Output:

Out: Note value folded to stay within octave range.

Inputs:

In: Value to be processed.

Range: Octave Range (0 -9), with octave 0 giving a note range of 0-11, 1 giving 0-23, 2 giving 0-35, etc..

Trnsp: Added to output.


Semitone

Folds input to 1 octave semitone (Mod 12 of input).

Output:

Out: Input value folded to semitone (0-11).

Inputs:

In: Value to be processed.


FitScale

Quantize a note pitch value to fit a scale.

Outputs:

Out: Value quantized to fit selected scale.

Name: Name of selected scale.

Size: Size (0 based, array Max) of selected scale.

Inputs:

In: Note pitch value (0-127) to fit to scale.

Scale: Set to force input to a scale. Scale names are available at the module Name output, and are also available with the ListBox widget. The Sequencer Property dialog box also lists the scales and can quantize the entire array to the selected scale.

Scales have been kindly provided by Dr. Igor Karaca, Department of Music, Oklahoma State University.


PitchMap

Translate input to internal user settable pitch map. To change the pitch map, click on the blue-label property button on the upper right of the module to get the note translation dialog. Move the sliders to the note values you want to translate. The input range is 0-127, with 24 sliders showing at a time. The horizontal scroll at the bottom of the pop up dialog will change the note view. You can also change the number of In/Out pairs by clicking on the Up/Down control labeled #I/Os.

Output:

Out N: Translated input.

Inputs:

In N: Value (0-127) to be translated.


Coerce

Coerce Raw input to nearest fit of given Val inputs.

Compares Raw input with all Val inputs, and returns the closest fit. Typically used for arbitrary scale translations.

The coercion algorithm returns the first exact match found; if no exact match is found then the first value with nearest absolute difference is returned. The module makes no distinction between compare values being lower or higher than the Raw value, it only looks at the absolute difference; and it always returns the first nearest fit found and ignores any other equal fit values. For this reason, you should place your scale values in an ascending scale.

This module has a user settable number of inputs. To change the number of inputs, click on the blue-label property button on the upper right of the module, and click on the "More" or "Fewer" button on the Inputs tab. You have the option to set custom input labels and tool tips if you like.

There may be times when you want to pluck a matched value from the center of your raw table, then do the same for the smaller table that results, etc.  See the "CasCoerce" (cascade coerce)  macro in Macros/Misc Macros  for one example of how to do this.

Output:

Out: Nearest fit of Raw coerced from Val inputs.

Inputs:

Raw: Raw value to coerce to nearest fit of Val inputs.

Val N: Scale step value to force Raw input to.


QuantNote

Quantize a note duration value to standard clock durations

Outputs:

Dur: Duration of quantized input note.

Name: Note text name.

Inputs:

In: Note value (0-255) to fit to clock note durations 2-192.

Mode: 0=regular notes, 1=include dots and triplets, 2=use 0-6 for regular notes + .1/.3 for dot/triplet, 3= use 0-20 for all notes.


Nudge

Translates change in input to an up/down step in output.

This module is intended mainly for converting MIDI inputs such as knobs and sliders that range from 0 - 127 (or so), into a virtual continuous controller.  It also enables you to switch the hardware controllers from one set of software values to another without having the controller jump values (an advantage of continuous controllers).

See the Nudge example patches to see how the module is used to coordinate hardware knobs or sliders with virtual knob and slider widgets.

Output:

Out: Nudged output.  This will be a range of 0 to MaxOut.

Input:

In: Value to be processed.  This will normally be from a MIDI controller input module such as CtrlIn or PolyIn. Output will be nudged up or down, depending on the up/down direction of this input.

Value: Reset value, sent to Out on change or Load.

MaxIn: Maximum input.  Typically set to 127 for MIDI controllers; useful for smoothing action of controllers that do not always reach the full range.  For example if a controller tends to max out at, say, 125, set to this value to give a consistant and smooth controller range of 0-125, while also giving a full output range of 0-127 (or whatever other range desired).

MaxOut: Maximum output.  This is the upper limit of the range at the output; lower limit is 0.

Nudge: Amount to nudge output for each input change.

Int: If non zero, force output to integer values.


Ms2Tempo

Convert milliseconds as used by the System module Main input & output to tempo (BPM).

Output:

Tempo: Tempo of input Ms at 24 ticks per quarter note.

Input:

Ms: Milliseconds to be converted to Tempo.


Tempo2Ms

Convert BPM tempo at 24 ticks per quarter note to milliseconds.

Output:

Ms: Milliseconds for input Tempo at 24 ticks per quarter note.

Input:

Tempo: Tempo to be converted to Milliseconds.


GenRGB

Generate a series of related RGB color values. Works by nudging each of RGB by small random amounts. When a color gets to 0 or 255 it changes direction. When a color goes below the threshold it steps at a slower speed until another color goes below the threshold. This helps maintain more vibrant colors by inhibiting all three from going into high values at the same time.

Output:

RGB: Color value formatted normally as R+G+B

GBR: Color value with RGB switched to GBR.

BRG: Color value with RGB switched to BRG.

Input:

Chng: Any change generates new color value.

Thrsh: Threshold for color balance (0 - 128).


Col2RGB

Convert 24 bit Color value to Red, Green, Blue triplet.  R, G & B ranges are 0-255.

Output:

R: Red value of RGB triplet.

G: Green value of RGB triplet.

B: Blue value of RGB triplet.

Input:

Color: 24 bit color value (formatted as &hBBGGRR) to be converted.


RGB2Col

Convert Red, Green, Blue triplet to 24 bit Color value.  R, G & B ranges are 0-255.

Output:

Color: 24 bit color value (formatted as &hBBGGRR) equivalent of the 8-bit R, G & B inputs.

Input:

R: Red part of RGB triplet.

G: Green part of RGB triplet.

B: Blue part of RGB triplet.


Col2HLS

Convert 24 bit Color value to Hue-Luminance-Saturation triplet.  H, L & S ranges are 0-240, as defined by Microsoft Windows.

Output:

H: Hue value of HLS triplet.

L: Luminance value of HLS triplet.

S: Saturation value of HLS triplet.

Input:

Color: 24 bit color value (formatted as &hBBGGRR) to be converted.


HLS2Col

Convert Hue-Luminance-Saturation values to 24 bit Color value.  H, L & S ranges are 0-240, as defined by Microsoft Windows.

Output:

Color: 24 bit color value (formatted as &hBBGGRR) equivalent of the H, L & S inputs.

Input:

H: Hue value of HLS triplet.

L: Luminance value of HLS triplet.

S: Saturation value of HLS triplet.

 

ArtWonk is Copyright 2003-2014 by John Dunn and Algorithmic Arts. All Rights Reserved.