aboutsummaryrefslogtreecommitdiff
path: root/stksitar~/sitar.h
blob: 1144c86e827af37b85f9197e1ac8b72567ff00b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/******************************************/  
/*  Karplus-Strong Sitar1 string model   */
/*  by Perry Cook, 1995-96                */
/*                                        */
/*  There exist at least two patents,     */
/*  assigned to Stanford, bearing the     */
/*  names of Karplus and/or Strong.       */
/******************************************/

#if !defined(__sitar_h)
#define __sitar_h

#include "Instrmnt.h"
#include "DelayA.h"
#include "OneZero.h"
#include "Noise.h"
#include "ADSR.h"

class sitar : public Instrmnt
{
protected:  
  DelayA *delayLine;
  OneZero *loopFilt;
  ADSR *envelope;
  Noise *noise;
  long length;
  StkFloat loopGain;
  StkFloat amPluck;
  StkFloat delay;
  StkFloat delayTarg;
public:
  sitar(StkFloat lowestFreq);
  ~sitar();
  void clear();
  virtual void setFreq(StkFloat frequency);
  void pluck(StkFloat amplitude);
  virtual void noteOn(StkFloat freq, StkFloat amp);
  virtual void noteOff(StkFloat amp);
  virtual StkFloat tick();
};

#endif