Mozzi  version v1.1.0
sound synthesis library for Arduino
Util

Utility functions. More...

Files

file  char2mozzi.py
 
A script for converting raw 8 bit sound data files to wavetables for Mozzi.

 

Classes

struct  Int2Type< I >
 Enables you to instantiate a template based on an integer value. More...
 

Functions

unsigned int BPMtoMillis (float bpm)
 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...
 
void setPin13Out ()
 Set digital pin 13 to output for testing timing with an oscilloscope. More...
 
void setPin13High ()
 Set pin 13 high for testing timing with an oscilloscope. More...
 
void setPin13Low ()
 Set pin 13 low for testing timing with an oscilloscope. 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, and python scripts for converting or generating sound tables.


Class Documentation

◆ 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 20 of file meta.h.

Public Types

enum  { value = I }
 

Function Documentation

◆ BPMtoMillis()

unsigned int BPMtoMillis ( float  bpm)

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 Convert BPM to milliseconds, which can be used to set the delay between beats for Metronome.
Parameters
bpmbeats per minute

Definition at line 33 of file mozzi_utils.cpp.

◆ setPin13High()

void setPin13High ( )
inline

Set pin 13 high for testing timing with an oscilloscope.

Definition at line 39 of file mozzi_utils.h.

◆ setPin13Low()

void setPin13Low ( )
inline

Set pin 13 low for testing timing with an oscilloscope.

Definition at line 52 of file mozzi_utils.h.

◆ setPin13Out()

void setPin13Out ( )
inline

Set digital pin 13 to output for testing timing with an oscilloscope.

Definition at line 26 of file mozzi_utils.h.