1 /* 2 Rakarrack Guitar FX 3 4 Sequence.h - Simple compressor/Sequence effect with easy interface, minimal controls 5 Copyright (C) 2010 Ryan Billing 6 Author: Ryan Billing & Josep Andreu 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of version 3 of the GNU General Public License 10 as published by the Free Software Foundation. 11 12 This program is distributed in the hope that it will be useful, 13 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 GNU General Public License (version 2) for more details. 16 17 You should have received a copy of the GNU General Public License (version 2) 18 along with this program; if not, write to the Free Software Foundation, 19 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 20 21 */ 22 23 #ifndef SEQUENCE_H 24 #define SEQUENCE_H 25 26 #include "global.h" 27 #include "RBFilter.h" 28 #include "smbPitchShift.h" 29 #include "beattracker.h" 30 #include "delayline.h" 31 #include "Resample.h" 32 33 class Sequence 34 { 35 public: 36 Sequence (float * efxoutl_, float * efxoutr_, long int Quality, int DS, int uq, int dq, double sample_rate, uint32_t intermediate_bufsze); 37 ~Sequence (); 38 void cleanup (); 39 void out (float * smpsl, float * smpr, uint32_t period); 40 void changepar (int npar, int value); 41 int getpar (int npar); 42 void setpreset (int npreset); 43 void setranges(int value); 44 void settempo(int value); 45 void adjust(int DS, double sample_rate); 46 47 int Ppreset; 48 49 float outvolume; 50 51 float *efxoutl; 52 float *efxoutr; 53 54 private: 55 //Parametrii 56 int Pvolume; //Output Level 57 int Psequence[8]; //Sequence. Each value is 0...127 58 int Ptempo; // Rate 59 int Pq; //Filter Q 60 int Pamplitude; // 0 or 1. Checkbox on or off... 61 int Pstdiff; // 1 2 3 4 5 6 7 8 62 int Pmode; 63 int Prange; 64 int tcount, scount, dscount, intperiod; 65 int subdiv; 66 int rndflag; 67 int DS_state; 68 unsigned int nPERIOD; 69 int nSAMPLE_RATE; 70 float nRATIO; 71 float fSAMPLE_RATE; 72 73 double u_up; 74 double u_down; 75 76 long int hq; 77 long window; 78 79 float nfSAMPLE_RATE; 80 float MINFREQ,MAXFREQ; 81 float fsequence[8]; 82 float fq; 83 float panning; 84 float ifperiod,fperiod, seqpower; 85 86 float *outi; 87 float *outo; 88 float *templ, *tempr; 89 90 //Variables for TrigStepper detecting trigger state. 91 float peakpulse, peak, envrms, peakdecay, trigthresh; 92 int trigtimeout, trigtime, onset, atk; 93 float targatk, lmod, rmod; 94 95 float maxdly, tempodiv, fb, rdlyfb, ldlyfb; 96 float avtime; 97 int avflag; 98 99 class RBFilter *filterl, *filterr, *modfilterl, *modfilterr, *rmsfilter, *peaklpfilter, *peakhpfilter, *peaklpfilter2; 100 float* interpbuf; 101 102 Resample *U_Resample; 103 Resample *D_Resample; 104 105 PitchShifter *PS; 106 107 class FPreset *Fpre; 108 class beattracker *beats; 109 class delayline *ldelay, *rdelay; 110 111 }; 112 113 114 #endif 115