Mercurial > hg > beaglert
annotate projects/airharp/Junction.h @ 195:cd53003dbf3c
Added .hgignore
author | Giulio Moro <giuliomoro@yahoo.it> |
---|---|
date | Thu, 04 Feb 2016 18:41:06 +0000 |
parents | 40badaff5729 |
children |
rev | line source |
---|---|
chris@164 | 1 /* |
chris@164 | 2 * |
chris@164 | 3 * Excitation Junction for two waveguides |
chris@164 | 4 * |
chris@164 | 5 * Christian Heinrichs 04/2015 |
chris@164 | 6 * |
chris@164 | 7 */ |
chris@164 | 8 |
chris@164 | 9 #ifndef JUNCTION_H_ |
chris@164 | 10 #define JUNCTION_H_ |
chris@164 | 11 |
chris@164 | 12 #include <cmath> |
chris@164 | 13 |
chris@164 | 14 #ifndef WG_BUFFER_SIZE |
chris@164 | 15 #define WG_BUFFER_SIZE 4096 |
chris@164 | 16 #endif |
chris@164 | 17 |
chris@164 | 18 #ifndef M_PI |
chris@164 | 19 #define M_PI 3.14159265358979323846264338 |
chris@164 | 20 #endif |
chris@164 | 21 |
chris@164 | 22 class Junction |
chris@164 | 23 { |
chris@164 | 24 |
chris@164 | 25 public: |
chris@164 | 26 |
chris@164 | 27 Junction(); |
chris@164 | 28 void setup(); |
chris@164 | 29 void update(float excitation, float left, float right); |
chris@164 | 30 float getOutput(int direction); |
chris@164 | 31 float getExcitationDisplacement(); |
chris@164 | 32 void setFrequency(float frequency); |
chris@164 | 33 void setPeriod(float periodInMs); |
chris@164 | 34 void setPluckPosition(float pluckPos); |
chris@164 | 35 |
chris@164 | 36 private: |
chris@164 | 37 |
chris@164 | 38 double _dt; |
chris@164 | 39 float _periodInMilliseconds; |
chris@164 | 40 int _periodInSamples; |
chris@164 | 41 |
chris@164 | 42 int _delay_l; |
chris@164 | 43 int _delay_r; |
chris@164 | 44 |
chris@164 | 45 float _buffer_l[WG_BUFFER_SIZE]; |
chris@164 | 46 float _buffer_r[WG_BUFFER_SIZE]; |
chris@164 | 47 int _readPtr; |
chris@164 | 48 |
chris@164 | 49 float _excitation; |
chris@164 | 50 float _lastPlectrumDisplacement; |
chris@164 | 51 |
chris@164 | 52 }; |
chris@164 | 53 |
chris@164 | 54 #endif |