annotate examples/10-Instruments/airharp/String.h @ 556:ce391098f321 prerelease tip

THIS PROJECT HAS MOVED TO https://github.com/BelaPlatform/bela
author Giulio Moro <giuliomoro@yahoo.it>
date Sat, 25 Jun 2016 20:21:00 +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