annotate examples/10-Instruments/airharp/Plectrum.h @ 504:b6eb94378ca9 prerelease

update_board
author Giulio Moro <giuliomoro@yahoo.it>
date Wed, 22 Jun 2016 01:24:55 +0100
parents 8fcfbfb32aa0
children
rev   line source
robert@464 1 /*
robert@464 2 *
robert@464 3 * Plectrum model for touching and plucking strings
robert@464 4 *
robert@464 5 * [inspired by E. Berdahl's pluck~ abstraction for the FireFader]
robert@464 6 *
robert@464 7 */
robert@464 8
robert@464 9 #ifndef PLECTRUM_H_
robert@464 10 #define PLECTRUM_H_
robert@464 11
robert@464 12 class Plectrum
robert@464 13 {
robert@464 14
robert@464 15 public:
robert@464 16
robert@464 17 Plectrum();
robert@464 18 void setup(float spring, float damp, float hyst);
robert@464 19 float update(float position, float stringPosition);
robert@464 20
robert@464 21 private:
robert@464 22
robert@464 23 double _dt;
robert@464 24 float _spring;
robert@464 25 float _damp;
robert@464 26 double _position;
robert@464 27 double _velocity;
robert@464 28 float _hyst;
robert@464 29 float _lastDistance;
robert@464 30 int _contact;
robert@464 31
robert@464 32 };
robert@464 33
robert@464 34 #endif
robert@464 35