12-polyphonic "chiptune" MIDI synthesizer for LPC1768 (Standalone version)

Dependencies:   ClockControl PowerControl mbed

Revision:
3:cf57d7031c12
Parent:
2:ca10e33bde0a
Child:
6:cda45a5e723e
--- a/main.cpp	Wed Nov 12 23:46:31 2014 +0000
+++ b/main.cpp	Tue Nov 18 17:05:49 2014 +0000
@@ -16,15 +16,15 @@
 Serial            console(/*Tx*/ p28, /*Rx*/ p27);
 DigitalIn         swSerialSelect(p12);
 DigitalIn         swPanic(p15);
-BusOut            led(/*Left*/ LED1, LED2, LED3, LED4 /*Right*/);
-BusOut            ledBar(p17, p18, p19, p20, p21, p22, p23, p24, p25, p26, p29, p30);
+BusOut            ledBar(p17, p18, p19, p20, p21, p22, p23, p24,
+                         p25, p26, p29, p30, LED1, LED2, LED3, LED4);
 SPI               spi(/*MOSI*/ p5, /*MISO*/ p6, /*SCK*/ p7);
 DigitalOut        dacCs(p8);
 Ticker            t1ms;
 Ticker            tSample;
 volatile uint32_t __countMs;
 bool              serSource;
-GeminiCore        gemCore(NUM_INSTRUMENT_IN_PERFORMER);
+GeminiCore        gemCore(NUM_INSTRUMENT_IN_PERFORMER, SAMPLING_RATE);
 RingBuffer<char>  buffer(BUFFER_LENGTH);
 Channels          ch;
 note_t            noteSent[NUM_INSTRUMENT];
@@ -71,7 +71,7 @@
 #endif
     
     // Enable pull-up at switch inputs
-    swSerialSelect.mode(PullDown);
+    swSerialSelect.mode(PullUp);
     swPanic.mode(PullUp);
     wait(0.2);                  // Wait a moment for stability
     
@@ -119,7 +119,7 @@
     
     // Start playback & attach interrupt
     float clockUpRatio = SystemCoreClock / 96000000.0;
-    tSample.attach_us(&sampleOut, 1000000 * clockUpRatio / GeminiCore::samplingRate);
+    tSample.attach_us(&sampleOut, 1000000 * clockUpRatio / SAMPLING_RATE);
 }
 
 void consoleOperations(uint8_t c) {