Auduino port

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
kshoji
Date:
Wed Sep 15 00:20:19 2010 +0000
Parent:
0:831ef5c249ef
Commit message:

Changed in this revision

auduino.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 831ef5c249ef -r a553c5d93bb8 auduino.cpp
--- a/auduino.cpp	Mon Sep 13 12:25:27 2010 +0000
+++ b/auduino.cpp	Wed Sep 15 00:20:19 2010 +0000
@@ -1,6 +1,8 @@
 #include <math.h>
 #include "mbed.h"
 
+#define FEATURE_ORIGINAL_AUDUINO
+
 // Auduino for mbed
 // Ported and arranged by Kaoru Shoji
 
@@ -88,19 +90,28 @@
   // Avoid using any functions that make extensive use of interrupts, or turn interrupts off.
   // They will cause clicks and poops in the audio.
   
+#ifndef FEATURE_ORIGINAL_AUDUINO
   // Smooth frequency mapping
   syncPhaseInc = mapPhaseInc(SYNC_CONTROL) * 4.0;
+#endif
   
   // Stepped mapping to MIDI notes: C, Db, D, Eb, E, F...
   //syncPhaseInc = mapMidi(SYNC_CONTROL);
   
+#ifdef FEATURE_ORIGINAL_AUDUINO
   // Stepped pentatonic mapping: D, E, G, A, B
-  //syncPhaseInc = mapPentatonic(SYNC_CONTROL);
+  syncPhaseInc = mapPentatonic(SYNC_CONTROL);
 
+  grainPhaseInc  = mapPhaseInc(GRAIN_FREQ_CONTROL) * 2.0;
+  grainDecay     = GRAIN_DECAY_CONTROL * 128.0;
+  grain2PhaseInc = mapPhaseInc(GRAIN2_FREQ_CONTROL) * 2.0;
+  grain2Decay    = GRAIN2_DECAY_CONTROL * 256.0;
+#else
   grainPhaseInc  = mapPhaseInc(GRAIN_FREQ_CONTROL) * 4.0;
   grainDecay     = GRAIN_DECAY_CONTROL * 16.0;
   grain2PhaseInc = mapPhaseInc(GRAIN2_FREQ_CONTROL) * 4.0;
   grain2Decay    = GRAIN2_DECAY_CONTROL * 32.0;
+#endif
 }
 
 float adjustPhaseValue(float phaseAcc) {