The Tooba
 All Data Structures Namespaces Files Functions Variables Macros Pages
Macros | Functions | Variables
teensy.ino File Reference
#include <string.h>
#include <stdarg.h>
#include <math.h>
#include "common.h"
#include "voice.h"
#include "key.h"
#include "queue.h"
#include <TimerOne.h>
Include dependency graph for teensy.ino:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define __ARDUINO   1
 

Functions

void timer_interrupt (void)
 
void setup ()
 
uint32_t get_12_bit_value (void)
 
uint8_t read_key (uint32_t id)
 
void compute_sample (void)
 
void loop (void)
 

Variables

Voice v [NUM_VOICES]
 
Keykeyboard [NUM_KEYS]
 
Queue samples
 

Macro Definition Documentation

#define __ARDUINO   1

Definition at line 8 of file teensy.ino.

Function Documentation

void compute_sample ( void  )

Run the step function on each of the voices. Sum their outputs to get a 12-bit sample, and put the sample in the queue. If the queue is full, then hang onto the sample to try to enqueue it again next time.

Definition at line 133 of file teensy.ino.

Referenced by loop(), and main().

Here is the call graph for this function:

Here is the caller graph for this function:

uint32_t get_12_bit_value ( void  )

Definition at line 58 of file teensy.ino.

Referenced by compute_sample().

Here is the caller graph for this function:

void loop ( void  )

Arduino loop function

Todo:

Read soft pots

Read the left-hand keyboard

Create Pitch class

Map keys to reachable pitches

Definition at line 158 of file teensy.ino.

Here is the call graph for this function:

uint8_t read_key ( uint32_t  id)

Definition at line 95 of file teensy.ino.

Referenced by Key::check().

Here is the caller graph for this function:

void setup ( )

Definition at line 27 of file teensy.ino.

Referenced by main().

Here is the call graph for this function:

Here is the caller graph for this function:

void timer_interrupt ( void  )

The timer interrupt takes audio samples from the queue and feeds them to the 12-bit DAC. If there is a queue underrun, it turns on the LED briefly but visibly.

Definition at line 72 of file teensy.ino.

Referenced by setup().

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

Key* keyboard[NUM_KEYS]

Definition at line 22 of file teensy.ino.

Queue samples

Definition at line 23 of file teensy.ino.

Referenced by main().

Definition at line 21 of file teensy.ino.