PokittoLib is the library needed for programming the Pokitto DIY game console (www.pokitto.com)

Dependents:   YATTT sd_map_test cPong SnowDemo ... more

PokittoLib

Library for programming Pokitto hardware

How to Use

  1. Import this library to online compiler (see button "import" on the right hand side
  2. DO NOT import mbed-src anymore, a better version is now included inside PokittoLib
  3. Change My_settings.h according to your project
  4. Start coding!
Revision:
66:6281a40d73e6
Parent:
31:f4b9b85c7b62
--- a/POKITTO_LIBS/Synth/Synth.h	Sat Mar 23 19:22:35 2019 +0000
+++ b/POKITTO_LIBS/Synth/Synth.h	Sat Mar 23 20:03:34 2019 +0000
@@ -36,15 +36,20 @@
 }
 */
 
-#ifndef boolean
-typedef bool boolean;
-#endif
+#define OPT_ADSR 1
+#define OPT_LOOP 2
+#define OPT_ECHO 4
+#define OPT_OVERDRIVE 8
+#define OPT_NORMALIZE 0x10
+
+#define OVERDRIVE 4
 
 //extern void fakeISR(); // was defined in Rboy_soundsim.h
 
 typedef void (*waveFunction)(OSC*);
 typedef void (*envFunction)(OSC*);
 typedef void (*mixFunction)();
+typedef void (*streamsFunction)();
 
 extern waveFunction Farr [];
 extern envFunction Earr [];
@@ -67,10 +72,21 @@
 #define ARPSTEPMAX 4 // was 5
 #define PATTERNLENGTH 64
 #define MAXPATTERNS 10
+
+#ifdef PROJ_SYNTH_MAXBLOCKS
+#define MAXBLOCKS PROJ_SYNTH_MAXBLOCKS
+#else
 #define MAXBLOCKS 30 // 10 *3
+#endif
 
-#define VOLTICK 5
-#define ARPTICK 50 // 150 // was 200
+#ifdef PROJ_SYNTH_MAXPATCHES
+#define MAXPATCHES PROJ_SYNTH_MAXPATCHES
+#else
+#define MAXPATCHES 15
+#endif
+
+#define VOLTICK POK_AUD_FREQ/8820 //was 5
+#define ARPTICK POK_AUD_FREQ/441 // 150 // was 200
 
 #define NUMWAVES 5
 #define NUMENVELOPES 3
@@ -100,9 +116,10 @@
 extern int openSongFromSD(char *);
 extern void writeChunkToSD(uint8_t *);
 extern void readChunkFromSD(uint8_t *);
-
+extern void registerStreamsCallback(streamsFunction);
+extern streamsFunction streamCallbackPtr;
 
-extern boolean playing, track1on, track2on, track3on, tableRefresh;
+extern bool playing, track1on, track2on, track3on, tableRefresh;
 extern uint16_t playerpos;
 extern uint16_t samplespertick, notetick;
 extern long samplesperpattern;
@@ -116,6 +133,7 @@
 extern BLOCK block[]; // array of blocks
 
 #define MAX_ARPMODE 16
+#define MAX_WAVETYPES 6
 
 extern int8_t arptable[][5];
 
@@ -129,7 +147,7 @@
 extern uint16_t noiseval;
 
 extern void setOSC(OSC*,byte, byte, byte, byte, byte,
-            uint8_t, uint8_t,
+            uint8_t, uint16_t,
             uint16_t, uint16_t, uint16_t, uint16_t,
             int16_t, int16_t, uint8_t, uint8_t, uint8_t);