annotate examples/10-Instruments/airharp/String.h @ 543:8f8809c77dda prerelease

updated basics, digital, instruments, extras examples
author chnrx <chris.heinrichs@gmail.com>
date Fri, 24 Jun 2016 13:19:52 +0100
parents 8fcfbfb32aa0
children
rev   line source
robert@464 1 /*
robert@464 2 *
robert@464 3 * 1-D string consisting of two waveguides and junction
robert@464 4 *
robert@464 5 * Christian Heinrichs 04/2015
robert@464 6 *
robert@464 7 */
robert@464 8
robert@464 9 #ifndef STRING_H_
robert@464 10 #define STRING_H_
robert@464 11
robert@464 12 #include <cmath>
robert@464 13 #include "Junction.h"
robert@464 14 #include "Waveguide.h"
robert@464 15
robert@464 16 class String
robert@464 17 {
robert@464 18
robert@464 19 public:
robert@464 20
robert@464 21 String();
robert@464 22 float update(float in);
robert@464 23
robert@464 24 float getPlectrumDisplacement();
robert@464 25 void setMidinote(float midinote);
robert@464 26 void setFrequency(float frequency);
robert@464 27 void setPeriod(float periodInMs);
robert@464 28 void setPluckPosition(float pluckPos);
robert@464 29 void setGlobalPosition(float pos);
robert@464 30 float getGlobalPosition();
robert@464 31
robert@464 32 private:
robert@464 33
robert@464 34 float _previous_l;
robert@464 35 float _previous_r;
robert@464 36
robert@464 37 float _globalPosition;
robert@464 38
robert@464 39 Waveguide wg_l;
robert@464 40 Waveguide wg_r;
robert@464 41 Junction junction;
robert@464 42
robert@464 43 };
robert@464 44
robert@464 45 #endif