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!

POKITTO_LIBS/Synth/Synth_osc.h

Committer:
Pokitto
Date:
2019-12-25
Revision:
71:531419862202
Parent:
66:6281a40d73e6

File content as of revision 71:531419862202:

/**************************************************************************/
/*!
    @file     Synth_osc.h
    @author   Jonne Valola

    @section LICENSE

    Pokitto development stage library
    Software License Agreement

    Copyright (c) 2015, Jonne Valola ("Author")
    All rights reserved.

    This library is intended solely for the purpose of Pokitto development.

    Redistribution and use in source and binary forms, with or without
    modification requires written permission from Author.
*/
/**************************************************************************/

#ifndef SYNTH_OSC_H
#define SYNTH_OSC_H

#include "Pokitto.h"

typedef uint8_t byte;

struct OSC {
  byte on;
  byte wave;
  byte loop;
  byte echo;
  byte echodiv;
  byte adsr;
  byte tonic;

  //uint16_t count;
  uint32_t count;

  uint16_t vol;
  //uint16_t cinc; // how much to add per cycle
  uint32_t cinc; // how much to add per cycle
  uint16_t output; // output is stored as  16 bit value and shifted before its put in OCR2B

  uint8_t adsrphase;
  uint16_t adsrvol;
  uint16_t attack; // Attack change
  uint16_t decay; // Attack change
  uint16_t sustain; // Attack change
  uint16_t release; // Attack change

  int32_t pitchbend;   // bends cycle counter (more is higher pitch)
  int32_t maxbend; // maximum bend before stopping
  int32_t bendrate; // how much to bend by every cycle

  uint8_t vibrate;
  uint8_t arpmode;
  uint8_t arpspeed;
  uint8_t arpstep;
  uint8_t overdrive;
  uint8_t kick;

  uint32_t duration;

  uint32_t samplepos;
  uint32_t samplestep;
  uint32_t samplelength;
  uint8_t* sample;
  //uint32_t samplebendcount;
  //uint32_t samplebendtick;

};



#endif // SYNTH_OSC_H