This is a part of the Kinetiszer project.

Dependents:   SoundEngine

Committer:
Clemo
Date:
Tue Oct 28 12:19:22 2014 +0000
Revision:
0:5a419ba2726d
Error & warning free (I believe as I don't know how to clean).

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Clemo 0:5a419ba2726d 1 /*
Clemo 0:5a419ba2726d 2 Copyright 2013 Paul Soulsby www.soulsbysynths.com
Clemo 0:5a419ba2726d 3 This file is part of Atmegatron.
Clemo 0:5a419ba2726d 4
Clemo 0:5a419ba2726d 5 Atmegatron is free software: you can redistribute it and/or modify
Clemo 0:5a419ba2726d 6 it under the terms of the GNU General Public License as published by
Clemo 0:5a419ba2726d 7 the Free Software Foundation, either version 3 of the License, or
Clemo 0:5a419ba2726d 8 (at your option) any later version.
Clemo 0:5a419ba2726d 9
Clemo 0:5a419ba2726d 10 Atmegatron is distributed in the hope that it will be useful,
Clemo 0:5a419ba2726d 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
Clemo 0:5a419ba2726d 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Clemo 0:5a419ba2726d 13 GNU General Public License for more details.
Clemo 0:5a419ba2726d 14
Clemo 0:5a419ba2726d 15 You should have received a copy of the GNU General Public License
Clemo 0:5a419ba2726d 16 along with Atmegatron. If not, see <http://www.gnu.org/licenses/>.
Clemo 0:5a419ba2726d 17 */
Clemo 0:5a419ba2726d 18
Clemo 0:5a419ba2726d 19 #ifndef __ATMEGATRON_H__
Clemo 0:5a419ba2726d 20 #define __ATMEGATRON_H__
Clemo 0:5a419ba2726d 21
Clemo 0:5a419ba2726d 22 #ifdef __cplusplus
Clemo 0:5a419ba2726d 23 extern "C" {
Clemo 0:5a419ba2726d 24 #endif
Clemo 0:5a419ba2726d 25
Clemo 0:5a419ba2726d 26 #define __HAS_ARPEGGIATOR__
Clemo 0:5a419ba2726d 27
Clemo 0:5a419ba2726d 28
Clemo 0:5a419ba2726d 29 #include <stdint.h>
Clemo 0:5a419ba2726d 30 #include <stdbool.h>
Clemo 0:5a419ba2726d 31 #include <stdlib.h>
Clemo 0:5a419ba2726d 32 #include <string.h>
Clemo 0:5a419ba2726d 33 #include <math.h>
Clemo 0:5a419ba2726d 34
Clemo 0:5a419ba2726d 35
Clemo 0:5a419ba2726d 36 typedef uint8_t byte;
Clemo 0:5a419ba2726d 37 typedef bool boolean;
Clemo 0:5a419ba2726d 38 typedef uint8_t uchar;
Clemo 0:5a419ba2726d 39 typedef int8_t sample_t;
Clemo 0:5a419ba2726d 40
Clemo 0:5a419ba2726d 41
Clemo 0:5a419ba2726d 42 #define MEM_PATCHSIZE (19) //size of flash mem patch
Clemo 0:5a419ba2726d 43 #define CTRL_FILT (0) //digital control nums
Clemo 0:5a419ba2726d 44 #define CTRL_Q (1)
Clemo 0:5a419ba2726d 45 #define CTRL_ENV (2)
Clemo 0:5a419ba2726d 46 #define CTRL_LFO (3)
Clemo 0:5a419ba2726d 47 #define CTRL_AMP (4)
Clemo 0:5a419ba2726d 48 #define CTRL_FX (5)
Clemo 0:5a419ba2726d 49 #define FUNC_WAVE (0) //function nums
Clemo 0:5a419ba2726d 50 #define FUNC_FILT (1)
Clemo 0:5a419ba2726d 51 #define FUNC_FENVA (2)
Clemo 0:5a419ba2726d 52 #define FUNC_FENVDR (3)
Clemo 0:5a419ba2726d 53 #define FUNC_FENVS (4)
Clemo 0:5a419ba2726d 54 #define FUNC_AENVA (5)
Clemo 0:5a419ba2726d 55 #define FUNC_AENVD (6)
Clemo 0:5a419ba2726d 56 #define FUNC_AENVS (7)
Clemo 0:5a419ba2726d 57 #define FUNC_AENVR (8)
Clemo 0:5a419ba2726d 58 #define FUNC_LFOTYPE (9)
Clemo 0:5a419ba2726d 59 #define FUNC_LFOSPEED (10)
Clemo 0:5a419ba2726d 60
Clemo 0:5a419ba2726d 61 #ifdef __HAS_ARPEGGIATOR__
Clemo 0:5a419ba2726d 62 #define FUNC_ARPTYPE (11)
Clemo 0:5a419ba2726d 63 #define FUNC_ARPSPEED (12)
Clemo 0:5a419ba2726d 64 #include "arpeggiator.h"
Clemo 0:5a419ba2726d 65 #endif // __HAS_ARPEGGIATOR__
Clemo 0:5a419ba2726d 66
Clemo 0:5a419ba2726d 67 #define FUNC_PORTA (13)
Clemo 0:5a419ba2726d 68 #define FUNC_BITCRUSH (14)
Clemo 0:5a419ba2726d 69 #define FUNC_MEM (15)
Clemo 0:5a419ba2726d 70 #define WAVE_LEN (32) //length of wavetable
Clemo 0:5a419ba2726d 71 #define POLL_HARD (1) //poll the function/val dials and digital controls
Clemo 0:5a419ba2726d 72 #define POLL_MIDI (1) //poll the midi input
Clemo 0:5a419ba2726d 73 #define POLL_TEST (0) //test mode
Clemo 0:5a419ba2726d 74
Clemo 0:5a419ba2726d 75 #define FUNC_MAX (16)
Clemo 0:5a419ba2726d 76 #define CTRL_MAX (6)
Clemo 0:5a419ba2726d 77 #define RED false
Clemo 0:5a419ba2726d 78 #define GREEN true
Clemo 0:5a419ba2726d 79
Clemo 0:5a419ba2726d 80
Clemo 0:5a419ba2726d 81 #include "systick.h"
Clemo 0:5a419ba2726d 82 #include "util.h"
Clemo 0:5a419ba2726d 83 #include "serial.h"
Clemo 0:5a419ba2726d 84 #include "keyboard.h"
Clemo 0:5a419ba2726d 85 #include "eeprom.h"
Clemo 0:5a419ba2726d 86 #include "master.h"
Clemo 0:5a419ba2726d 87 #include "waveforms.h"
Clemo 0:5a419ba2726d 88 #include "distortion.h"
Clemo 0:5a419ba2726d 89 #include "flange.h"
Clemo 0:5a419ba2726d 90 #include "bitcrush.h"
Clemo 0:5a419ba2726d 91 #include "lfo.h"
Clemo 0:5a419ba2726d 92 #include "filter.h"
Clemo 0:5a419ba2726d 93 #include "amplitude.h"
Clemo 0:5a419ba2726d 94 #include "envelope.h"
Clemo 0:5a419ba2726d 95 #include "envelope2.h"
Clemo 0:5a419ba2726d 96 #include "pwm.h"
Clemo 0:5a419ba2726d 97 #include "midi.h"
Clemo 0:5a419ba2726d 98 #include "pitch.h"
Clemo 0:5a419ba2726d 99 #include "memory.h"
Clemo 0:5a419ba2726d 100 #include "hardware.h"
Clemo 0:5a419ba2726d 101 #include "testmode.h"
Clemo 0:5a419ba2726d 102 #include "user_interface.h"
Clemo 0:5a419ba2726d 103
Clemo 0:5a419ba2726d 104 void setup(void);
Clemo 0:5a419ba2726d 105 void loop_priority_low(void);
Clemo 0:5a419ba2726d 106 void loop_priority_high(void);
Clemo 0:5a419ba2726d 107
Clemo 0:5a419ba2726d 108 #ifdef __cplusplus
Clemo 0:5a419ba2726d 109 }
Clemo 0:5a419ba2726d 110 #endif
Clemo 0:5a419ba2726d 111
Clemo 0:5a419ba2726d 112
Clemo 0:5a419ba2726d 113 #endif // __ATMEGATRON_H__