Mercurial > hg > beaglert
annotate projects/airharp/Plectrum.h @ 183:2bdb48d1fca6
Fixed BBD chorus project
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Fri, 15 Jan 2016 23:48:08 +0000 |
parents | 40badaff5729 |
children |
rev | line source |
---|---|
chris@164 | 1 /* |
chris@164 | 2 * |
chris@164 | 3 * Plectrum model for touching and plucking strings |
chris@164 | 4 * |
chris@164 | 5 * [inspired by E. Berdahl's pluck~ abstraction for the FireFader] |
chris@164 | 6 * |
chris@164 | 7 */ |
chris@164 | 8 |
chris@164 | 9 #ifndef PLECTRUM_H_ |
chris@164 | 10 #define PLECTRUM_H_ |
chris@164 | 11 |
chris@164 | 12 class Plectrum |
chris@164 | 13 { |
chris@164 | 14 |
chris@164 | 15 public: |
chris@164 | 16 |
chris@164 | 17 Plectrum(); |
chris@164 | 18 void setup(float spring, float damp, float hyst); |
chris@164 | 19 float update(float position, float stringPosition); |
chris@164 | 20 |
chris@164 | 21 private: |
chris@164 | 22 |
chris@164 | 23 double _dt; |
chris@164 | 24 float _spring; |
chris@164 | 25 float _damp; |
chris@164 | 26 double _position; |
chris@164 | 27 double _velocity; |
chris@164 | 28 float _hyst; |
chris@164 | 29 float _lastDistance; |
chris@164 | 30 int _contact; |
chris@164 | 31 |
chris@164 | 32 }; |
chris@164 | 33 |
chris@164 | 34 #endif |
chris@164 | 35 |