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!
Committer:
Pokitto
Date:
Wed Dec 25 23:59:52 2019 +0000
Revision:
71:531419862202
Parent:
66:6281a40d73e6
Changed Mode2 C++ refresh code (graphical errors)

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Pokitto 31:f4b9b85c7b62 1 /**************************************************************************/
Pokitto 31:f4b9b85c7b62 2 /*!
Pokitto 31:f4b9b85c7b62 3 @file Synth_osc.h
Pokitto 31:f4b9b85c7b62 4 @author Jonne Valola
Pokitto 31:f4b9b85c7b62 5
Pokitto 31:f4b9b85c7b62 6 @section LICENSE
Pokitto 31:f4b9b85c7b62 7
Pokitto 31:f4b9b85c7b62 8 Pokitto development stage library
Pokitto 31:f4b9b85c7b62 9 Software License Agreement
Pokitto 31:f4b9b85c7b62 10
Pokitto 31:f4b9b85c7b62 11 Copyright (c) 2015, Jonne Valola ("Author")
Pokitto 31:f4b9b85c7b62 12 All rights reserved.
Pokitto 31:f4b9b85c7b62 13
Pokitto 31:f4b9b85c7b62 14 This library is intended solely for the purpose of Pokitto development.
Pokitto 31:f4b9b85c7b62 15
Pokitto 31:f4b9b85c7b62 16 Redistribution and use in source and binary forms, with or without
Pokitto 31:f4b9b85c7b62 17 modification requires written permission from Author.
Pokitto 31:f4b9b85c7b62 18 */
Pokitto 31:f4b9b85c7b62 19 /**************************************************************************/
Pokitto 31:f4b9b85c7b62 20
Pokitto 31:f4b9b85c7b62 21 #ifndef SYNTH_OSC_H
Pokitto 31:f4b9b85c7b62 22 #define SYNTH_OSC_H
Pokitto 31:f4b9b85c7b62 23
Pokitto 31:f4b9b85c7b62 24 #include "Pokitto.h"
Pokitto 31:f4b9b85c7b62 25
Pokitto 31:f4b9b85c7b62 26 typedef uint8_t byte;
Pokitto 31:f4b9b85c7b62 27
Pokitto 31:f4b9b85c7b62 28 struct OSC {
Pokitto 31:f4b9b85c7b62 29 byte on;
Pokitto 31:f4b9b85c7b62 30 byte wave;
Pokitto 31:f4b9b85c7b62 31 byte loop;
Pokitto 31:f4b9b85c7b62 32 byte echo;
Pokitto 31:f4b9b85c7b62 33 byte echodiv;
Pokitto 31:f4b9b85c7b62 34 byte adsr;
Pokitto 31:f4b9b85c7b62 35 byte tonic;
Pokitto 31:f4b9b85c7b62 36
Pokitto 31:f4b9b85c7b62 37 //uint16_t count;
Pokitto 31:f4b9b85c7b62 38 uint32_t count;
Pokitto 31:f4b9b85c7b62 39
Pokitto 31:f4b9b85c7b62 40 uint16_t vol;
Pokitto 31:f4b9b85c7b62 41 //uint16_t cinc; // how much to add per cycle
Pokitto 31:f4b9b85c7b62 42 uint32_t cinc; // how much to add per cycle
Pokitto 31:f4b9b85c7b62 43 uint16_t output; // output is stored as 16 bit value and shifted before its put in OCR2B
Pokitto 31:f4b9b85c7b62 44
Pokitto 31:f4b9b85c7b62 45 uint8_t adsrphase;
Pokitto 31:f4b9b85c7b62 46 uint16_t adsrvol;
Pokitto 31:f4b9b85c7b62 47 uint16_t attack; // Attack change
Pokitto 31:f4b9b85c7b62 48 uint16_t decay; // Attack change
Pokitto 31:f4b9b85c7b62 49 uint16_t sustain; // Attack change
Pokitto 31:f4b9b85c7b62 50 uint16_t release; // Attack change
Pokitto 31:f4b9b85c7b62 51
Pokitto 66:6281a40d73e6 52 int32_t pitchbend; // bends cycle counter (more is higher pitch)
Pokitto 66:6281a40d73e6 53 int32_t maxbend; // maximum bend before stopping
Pokitto 66:6281a40d73e6 54 int32_t bendrate; // how much to bend by every cycle
Pokitto 31:f4b9b85c7b62 55
Pokitto 31:f4b9b85c7b62 56 uint8_t vibrate;
Pokitto 31:f4b9b85c7b62 57 uint8_t arpmode;
Pokitto 31:f4b9b85c7b62 58 uint8_t arpspeed;
Pokitto 31:f4b9b85c7b62 59 uint8_t arpstep;
Pokitto 31:f4b9b85c7b62 60 uint8_t overdrive;
Pokitto 31:f4b9b85c7b62 61 uint8_t kick;
Pokitto 31:f4b9b85c7b62 62
Pokitto 31:f4b9b85c7b62 63 uint32_t duration;
Pokitto 66:6281a40d73e6 64
Pokitto 66:6281a40d73e6 65 uint32_t samplepos;
Pokitto 66:6281a40d73e6 66 uint32_t samplestep;
Pokitto 66:6281a40d73e6 67 uint32_t samplelength;
Pokitto 66:6281a40d73e6 68 uint8_t* sample;
Pokitto 66:6281a40d73e6 69 //uint32_t samplebendcount;
Pokitto 66:6281a40d73e6 70 //uint32_t samplebendtick;
Pokitto 66:6281a40d73e6 71
Pokitto 31:f4b9b85c7b62 72 };
Pokitto 31:f4b9b85c7b62 73
Pokitto 31:f4b9b85c7b62 74
Pokitto 31:f4b9b85c7b62 75
Pokitto 31:f4b9b85c7b62 76 #endif // SYNTH_OSC_H
Pokitto 31:f4b9b85c7b62 77
Pokitto 31:f4b9b85c7b62 78