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 __PITCH_H__
Clemo 0:5a419ba2726d 20 #define __PITCH_H__
Clemo 0:5a419ba2726d 21
Clemo 0:5a419ba2726d 22
Clemo 0:5a419ba2726d 23 //These constants are used to define the MAXIMUM amount the env can effect the pitch.
Clemo 0:5a419ba2726d 24 //The default max for env is:
Clemo 0:5a419ba2726d 25 //********multiplier = 4***********
Clemo 0:5a419ba2726d 26 #define PITCH_ENVMAX 1.386294361119891f //ln(multiplier)
Clemo 0:5a419ba2726d 27 #define PITCH_ENVMULT 64 //multipler used for calculating lookup table (256 / multiplier)
Clemo 0:5a419ba2726d 28 #define PITCH_ENVBS 6UL //bitshift amount when multiplying pitch by pitch env amt. log2(PITCH_MULT)
Clemo 0:5a419ba2726d 29
Clemo 0:5a419ba2726d 30 //These constants are used to define the MAXIMUM amount the lfo can effect the pitch.
Clemo 0:5a419ba2726d 31 //The default max for lfo is:
Clemo 0:5a419ba2726d 32 //********multiplier = 2 (1 octave)***********
Clemo 0:5a419ba2726d 33 #define PITCH_LFOMAX 0.693147180559945f //ln(multiplier)
Clemo 0:5a419ba2726d 34 #define PITCH_LFOMULT 128 //multipler used for calculating lookup table (256 / multiplier)
Clemo 0:5a419ba2726d 35 #define PITCH_LFOBS 7UL //bitshift amount when multiplying pitch by pitch lfo amt. log2(PITCH_MULT)
Clemo 0:5a419ba2726d 36
Clemo 0:5a419ba2726d 37
Clemo 0:5a419ba2726d 38 void Pitch_Let_NextFreq(unsigned int newfreq);
Clemo 0:5a419ba2726d 39 unsigned int Pitch_Get_NextFreq(void);
Clemo 0:5a419ba2726d 40 void Pitch_Let_Porta(int newporta);
Clemo 0:5a419ba2726d 41 int Pitch_Get_Porta(void);
Clemo 0:5a419ba2726d 42 void Pitch_ResetPorta(void);
Clemo 0:5a419ba2726d 43 void Pitch_RefreshPortaTicks(void);
Clemo 0:5a419ba2726d 44 unsigned long Pitch_Get_FreqCalc(void);
Clemo 0:5a419ba2726d 45 boolean Pitch_Get_PitchChanged(void);
Clemo 0:5a419ba2726d 46 void Pitch_Let_PropPorta(boolean newprop);
Clemo 0:5a419ba2726d 47 boolean Pitch_Get_PropPorta(void);
Clemo 0:5a419ba2726d 48 void Pitch_Process(void);
Clemo 0:5a419ba2726d 49 void Pitch_Let_LFOAmt(byte newamt);
Clemo 0:5a419ba2726d 50 byte Pitch_Get_LFOAmt(void);
Clemo 0:5a419ba2726d 51 byte Pitch_Get_LFOGain(void);
Clemo 0:5a419ba2726d 52 void Pitch_Let_FenvAmt(byte newamt);
Clemo 0:5a419ba2726d 53 byte Pitch_Get_FenvAmt(void);
Clemo 0:5a419ba2726d 54 byte Pitch_Get_FenvGain(void);
Clemo 0:5a419ba2726d 55 byte Pitch_Get_MIDIPbendGain(void);
Clemo 0:5a419ba2726d 56
Clemo 0:5a419ba2726d 57
Clemo 0:5a419ba2726d 58 #endif // __PITCH_H__