Mozzi  version v2.0
sound synthesis library for Arduino
Line< SFix< NI, NF > > Class Template Reference

Detailed Description

template<int8_t NI, int8_t NF>
class Line< SFix< NI, NF > >

Definition at line 406 of file Line.h.

Public Member Functions

 Line ()
 Constructor. More...
 
internal_type next ()
 Increments one step along the line. More...
 
void set (internal_type value)
 Set the current value of the line. More...
 
template<int8_t _NI>
void set (internal_type targetvalue, UFix< _NI, 0 > num_steps)
 Given a target value and the number of steps to take on the way, this calculates the step size needed to get there from the current value. More...
 
template<typename T >
void set (internal_type targetvalue, T num_steps)
 Given a target value and the number of steps to take on the way, this calculates the step size needed to get there from the current value. More...
 
template<typename T >
void set (internal_type startvalue, internal_type targetvalue, T num_steps)
 Given a new starting value, target value and the number of steps to take on the way, this sets the step size needed to get there. More...
 

Constructor & Destructor Documentation

◆ Line()

template<int8_t NI, int8_t NF>
Line< SFix< NI, NF > >::Line ( )
inline

Constructor.

Use the template parameter to set the type of numbers you want to use. For example, Line <int> myline; makes a Line which uses ints.

Definition at line 417 of file Line.h.

Member Function Documentation

◆ next()

template<int8_t NI, int8_t NF>
internal_type Line< SFix< NI, NF > >::next ( )
inline

Increments one step along the line.

Returns
the next value.

Definition at line 423 of file Line.h.

◆ set() [1/4]

template<int8_t NI, int8_t NF>
template<typename T >
void Line< SFix< NI, NF > >::set ( internal_type  startvalue,
internal_type  targetvalue,
num_steps 
)
inline

Given a new starting value, target value and the number of steps to take on the way, this sets the step size needed to get there.

Parameters
startvaluethe number to set the Line's current_value to.
targetvaluethe value to move towards.
num_stepshow many steps to take to reach the target.

Definition at line 479 of file Line.h.

◆ set() [2/4]

template<int8_t NI, int8_t NF>
template<typename T >
void Line< SFix< NI, NF > >::set ( internal_type  targetvalue,
num_steps 
)
inline

Given a target value and the number of steps to take on the way, this calculates the step size needed to get there from the current value.

Parameters
targetvaluethe value to move towards.
num_stepshow many steps to take to reach the target.

Definition at line 462 of file Line.h.

◆ set() [3/4]

template<int8_t NI, int8_t NF>
template<int8_t _NI>
void Line< SFix< NI, NF > >::set ( internal_type  targetvalue,
UFix< _NI, 0 >  num_steps 
)
inline

Given a target value and the number of steps to take on the way, this calculates the step size needed to get there from the current value.

Parameters
targetvaluethe value to move towards.
num_stepshow many steps to take to reach the target as a UFix<_NI,0>

Definition at line 445 of file Line.h.

◆ set() [4/4]

template<int8_t NI, int8_t NF>
void Line< SFix< NI, NF > >::set ( internal_type  value)
inline

Set the current value of the line.

The Line will continue incrementing from this value using any previously calculated step size.

Parameters
valuethe number to set the Line's current_value to.

Definition at line 435 of file Line.h.