#include <string.h>
#include <stdarg.h>
#include <math.h>
#include "common.h"
#include "voice.h"
#include "key.h"
#include "queue.h"
#include <TimerOne.h>
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] |
Key * | keyboard [NUM_KEYS] |
Queue | samples |
#define __ARDUINO 1 |
Definition at line 8 of file teensy.ino.
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().
uint32_t get_12_bit_value | ( | void | ) |
Definition at line 58 of file teensy.ino.
Referenced by compute_sample().
void loop | ( | void | ) |
Arduino loop function
Read soft pots
Read the left-hand keyboard
Create Pitch class
Map keys to reachable pitches
Definition at line 158 of file teensy.ino.
uint8_t read_key | ( | uint32_t | id | ) |
Definition at line 95 of file teensy.ino.
Referenced by Key::check().
void setup | ( | ) |
Definition at line 27 of file teensy.ino.
Referenced by main().
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().
Definition at line 22 of file teensy.ino.
Queue samples |
Definition at line 23 of file teensy.ino.
Referenced by main().
Voice v[NUM_VOICES] |
Definition at line 21 of file teensy.ino.