~ubuntu-branches/ubuntu/quantal/muse/quantal

« back to all changes in this revision

Viewing changes to plugins/pandelay/pandelaymodel.h

  • Committer: Bazaar Package Importer
  • Author(s): Eric Hedekar, Eric Hedekar, Fabrice Coutadeur
  • Date: 2010-01-26 02:32:14 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20100126023214-8ez2g5d26d9p584j
Tags: 1.0.1-0ubuntu1
[ Eric Hedekar ]
* New upstream version (LP: #479688)
* Removed patches that were fixed in upstream source
  -[10_64bit_memcorruption_fix]
  -[10_gcc43_build_fixes]
  -[10_lash_private_api_fix]
  -[10_log2f_aliasing_fix]
  -[10_vamgui_init_fix]
  -[20_fix_const]

[ Fabrice Coutadeur ]
* debian/watch: added watch file
* debian/muse.desktop: deleted deprecated Encoding key, Application category
  and icon extension. This fix several warning with lintian and
  desktop-file-validate

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//===========================================================================
 
2
//
 
3
//    PanDelay, panoramic rotating delay
 
4
//
 
5
//    version 0.0.1
 
6
//
 
7
//    pandelaymodel.h
 
8
//
 
9
//
 
10
//  Copyright (c) 2006 Nil Geisweiller
 
11
//
 
12
//
 
13
//
 
14
// This program is free software; you can redistribute it and/or
 
15
// modify it under the terms of the GNU General Public License
 
16
// as published by the Free Software Foundation; either version 2
 
17
// of the License, or (at your option) any later version.
 
18
//
 
19
// This program is distributed in the hope that it will be useful,
 
20
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
21
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
22
// GNU General Public License for more details.
 
23
//
 
24
// You should have received a copy of the GNU General Public License
 
25
// along with this program; if not, write to the Free Software
 
26
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
 
27
// 02111-1307, USA or point your web browser to http://www.gnu.org.
 
28
//===========================================================================
 
29
 
 
30
#ifndef __PANDELAYMODEL_H
 
31
#define __PANDELAYMODEL_H
 
32
 
 
33
#include <math.h>
 
34
 
 
35
#define MAXBUFFERLENGTH 192000
 
36
#define MINFREQ 0.1 //in Hz
 
37
#define MAXFREQ 10.0 //in Hz
 
38
#define MINBPM 60.0
 
39
#define MAXBPM 255.0
 
40
#define MINBEATRATIO 0.125
 
41
#define MAXBEATRATIO 2.0
 
42
#define MINDELAYTIME 0.01 //in second
 
43
#define MAXDELAYTIME 2.0 //in second
 
44
 
 
45
#define NBRPARAM 5
 
46
 
 
47
class PanDelayModel {
 
48
 private:
 
49
  int _samplerate;
 
50
 
 
51
  //bool _beatFraction; //if true then the delay is calculated in beat fraction
 
52
  float _BPM;
 
53
  float _beatRatio;
 
54
  float _delayTime; //delay is calculated according to BMP and ratioBMP
 
55
  float _feedback;
 
56
  float _panLFOFreq;
 
57
  float _panLFODepth;
 
58
  float _dryWet; //0.0 : dry, 1.0 : wet
 
59
 
 
60
  int _delaySampleSize;
 
61
  float _lBound;
 
62
  float _rBound;
 
63
  float _inc;
 
64
  float _l;
 
65
  float _r;
 
66
 
 
67
  float _leftBuffer[MAXBUFFERLENGTH];
 
68
  float _rightBuffer[MAXBUFFERLENGTH];
 
69
  int _bufferPointer;
 
70
 
 
71
 public:
 
72
  PanDelayModel(int samplerate);
 
73
  ~PanDelayModel();
 
74
  
 
75
  void setSamplerate(int sr);
 
76
  void setBeatRatio(float br);
 
77
  void setBPM(float bpm);
 
78
  void setDelayTime(float dt);
 
79
  void setFeedback(float dt);
 
80
  void setPanLFOFreq(float pf);
 
81
  void setPanLFODepth(float pd);
 
82
  void setDryWet(float dw);
 
83
  void setPanDelay();
 
84
 
 
85
  void processMix(float* leftInSamples, float* rightInSamples,
 
86
                  float* leftOutSamples, float* rightOutSamples,
 
87
                  unsigned n);
 
88
  void processReplace(float* leftInSamples, float* rightInSamples,
 
89
                      float* leftOutSamples, float* rightOutSamples,
 
90
                      unsigned n);
 
91
};
 
92
 
 
93
#endif /* __PANDELAYMODEL_H */