Mozzi  version v2.0
sound synthesis library for Arduino
IntMap Class Reference

A faster version of Arduino's map() function. More...

#include <IntMap.h>

Detailed Description

A faster version of Arduino's map() function.

This uses ints instead of longs internally and does some of the maths at compile time.

Definition at line 19 of file IntMap.h.

Public Member Functions

 IntMap (int in_min, int in_max, int out_min, int out_max)
 Constructor. More...
 
int operator() (int n) const
 Process the next input value. More...
 

Constructor & Destructor Documentation

◆ IntMap()

IntMap::IntMap ( int  in_min,
int  in_max,
int  out_min,
int  out_max 
)
inline

Constructor.

Parameters
in_minthe minimum of the input range.
in_maxthe maximum of the input range.
out_minthe minimum of the output range.
out_maxthe maximum of the output range.

Definition at line 28 of file IntMap.h.

Member Function Documentation

◆ operator()()

int IntMap::operator() ( int  n) const
inline

Process the next input value.

Parameters
nthe next integer to process.
Returns
the input integer mapped to the output range.

Definition at line 39 of file IntMap.h.