robert@464: /* robert@464: * robert@464: * Plectrum model for touching and plucking strings robert@464: * robert@464: * [inspired by E. Berdahl's pluck~ abstraction for the FireFader] robert@464: * robert@464: */ robert@464: robert@464: #ifndef PLECTRUM_H_ robert@464: #define PLECTRUM_H_ robert@464: robert@464: class Plectrum robert@464: { robert@464: robert@464: public: robert@464: robert@464: Plectrum(); robert@464: void setup(float spring, float damp, float hyst); robert@464: float update(float position, float stringPosition); robert@464: robert@464: private: robert@464: robert@464: double _dt; robert@464: float _spring; robert@464: float _damp; robert@464: double _position; robert@464: double _velocity; robert@464: float _hyst; robert@464: float _lastDistance; robert@464: int _contact; robert@464: robert@464: }; robert@464: robert@464: #endif robert@464: