From 5912dfdcd41cefe44e8c4e00f9ba6551cc060af8 Mon Sep 17 00:00:00 2001 From: Jakob Bak Date: Thu, 24 Jan 2013 10:22:47 +0100 Subject: [PATCH] Added some comment text for interrupt select and NUM_OSCILLATORS --- software/lib/MMM/Music.cpp | 12 +++++++++--- software/lib/MMM/Music.h | 13 ++++++++++--- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/software/lib/MMM/Music.cpp b/software/lib/MMM/Music.cpp index 7539266..e75debd 100644 --- a/software/lib/MMM/Music.cpp +++ b/software/lib/MMM/Music.cpp @@ -37,10 +37,16 @@ MMusic Music; #define SPI_SCK 5 #define SPI_MOSI 3 -// timer 2 is audio interrupt timer -ISR(TIMER2_COMPA_vect) { + +////////////////////////////////////////////////////////// +// +// AUDIO INTERRUPT. USE EITHER 8bit or 12bitSine VERSION +// COMMENT OUT THE ONE YOU ARE NOT USING +// +////////////////////////////////////////////////////////// +ISR(TIMER2_COMPA_vect) { // timer 2 is audio interrupt timer - OCR2A = 127; + OCR2A = 127; // don't change this // Music.synthInterrupt8bit(); diff --git a/software/lib/MMM/Music.h b/software/lib/MMM/Music.h index 1969235..e3d5701 100644 --- a/software/lib/MMM/Music.h +++ b/software/lib/MMM/Music.h @@ -25,13 +25,20 @@ #ifndef Music_h // include guard #define Music_h +//////////////////////////////////// +// +// SET NUMBER OF OSCILLATORS HERE. +// SHOULD BE 1, 2 or 3 +// +//////////////////////////////////// +#define NUM_OSCILLATORS 1 + + // current sample rate is 15625 as defined in the init() section #define SAMPLE_RATE 15625 -#define NUM_OSCILLATORS 1 - #ifndef NUM_OSCILLATORS - #error NUM_OSCILLATORS should be defined in the Music.h file in the libraries folder. + #error NUM_OSCILLATORS should be defined in the Music.h file in the libraries/MMM folder. #elif (NUM_OSCILLATORS == 1)||(NUM_OSCILLATORS == 2)||(NUM_OSCILLATORS == 3) #else #error NUM_OSCILLATORS shall be 1, 2 or 3