Mercurial > hg > beaglert
comparison projects/airharp/Plectrum.h @ 164:40badaff5729 heavy-updated
- added more pd/heavy examples
- removed heavy-specific flags from Makefile
- added air-harp cpp example project
author | chnrx <chris.heinrichs@gmail.com> |
---|---|
date | Thu, 03 Dec 2015 16:19:33 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
163:20b52283c7b4 | 164:40badaff5729 |
---|---|
1 /* | |
2 * | |
3 * Plectrum model for touching and plucking strings | |
4 * | |
5 * [inspired by E. Berdahl's pluck~ abstraction for the FireFader] | |
6 * | |
7 */ | |
8 | |
9 #ifndef PLECTRUM_H_ | |
10 #define PLECTRUM_H_ | |
11 | |
12 class Plectrum | |
13 { | |
14 | |
15 public: | |
16 | |
17 Plectrum(); | |
18 void setup(float spring, float damp, float hyst); | |
19 float update(float position, float stringPosition); | |
20 | |
21 private: | |
22 | |
23 double _dt; | |
24 float _spring; | |
25 float _damp; | |
26 double _position; | |
27 double _velocity; | |
28 float _hyst; | |
29 float _lastDistance; | |
30 int _contact; | |
31 | |
32 }; | |
33 | |
34 #endif | |
35 |