Mozzi  version v2.0
sound synthesis library for Arduino
Utility functions, and debugging

Utility functions. More...

Detailed Description

Utility functions.

Includes functions for debugging and profiling high frequency code with an oscilloscope when serial is too slow, some miscellaneous functions used internally by Mozzi, python scripts for converting or generating sound tables, and assorted meta-programming utils.

Classes

struct  IntegerType< BYTES >
 Provides appropriate integer types that can bit the given number of bytes on this platform (at most 64). More...
 
struct  Int2Type< I >
 Enables you to instantiate a template based on an integer value. More...
 

Functions

void setPin13Out ()
 Set digital pin 13 to output for testing timing with an oscilloscope.
 
void setPin13High ()
 Set pin 13 high for testing timing with an oscilloscope.
 
void setPin13Low ()
 Set pin 13 low for testing timing with an oscilloscope.
 
constexpr uint8_t trailingZerosConst (unsigned long v)
 Given a power of 2, work out the number to shift right by to do a divide by the number, or shift left to multiply. More...
 

Class Documentation

◆ IntegerType

struct IntegerType

template<uint8_t BYTES>
struct IntegerType< BYTES >

Provides appropriate integer types that can bit the given number of bytes on this platform (at most 64).

Definition at line 20 of file IntegerType.h.

Public Types

typedef IntegerType<(BYTES< 8) ?(BYTES+1) :8 >::unsigned_type unsigned_type
 
typedef IntegerType<(BYTES< 8) ?(BYTES+1) :8 >::signed_type signed_type
 

◆ Int2Type

struct Int2Type

template<int I>
struct Int2Type< I >

Enables you to instantiate a template based on an integer value.

For example, this is used in StateVariable.h to choose a different next() function for each kind of filter, LOWPASS, BANDPASS, HIGHPASS or NOTCH, which are simple integer values 0,1,2,3 provided to the StateVariable template on instantiation. Fantastic! It's in C++11, but not yet available in avr-gcc. See "c++ enable_if"

Definition at line 40 of file meta.h.

Public Types

enum  { value }
 

Function Documentation

◆ trailingZerosConst()

constexpr uint8_t trailingZerosConst ( unsigned long  v)
constexpr

Given a power of 2, work out the number to shift right by to do a divide by the number, or shift left to multiply.

Parameters
apower of 2, or any other number for that matter
Returns
the number of trailing zeros on the right hand end

Definition at line 73 of file mozzi_utils.h.