Skip to content

Cleaning

A basic flow of processing data from human input or sensors might look like:

  1. Receive data from an event, sensor, stream etc.
  2. Normalise to a scalar (0..1)
  3. Additional processing as needed:
    • average/smooth, round, wrap, clamp, validate
  4. Save into state.
  5. Use the state, mapping values output domains, eg. pixels, sound level, pulse-width modulation.

It’s always a good idea to place all the parameters governing your data cleaning something like a settings object. For example, this might be the number of samples to smooth data for, the input range to clamp and so on. These are probably not things that will change during execution, and putting them in properties or variables is way of making readable code.

See also an overview of how the demo sketches are organised.