view examples/10-Instruments/airharp/String.h @ 487:7eefd4b3aec3 prerelease

Fixed and tested (for what possible) heavy Midi behaviour. Would be good to have abstraction wrappers for regular [pgmin] [polytouchin] [bendin] and [touchin]
author Giulio Moro <giuliomoro@yahoo.it>
date Tue, 21 Jun 2016 16:28:59 +0100
parents 8fcfbfb32aa0
children
line wrap: on
line source
/*
 *
 * 1-D string consisting of two waveguides and junction
 *
 * Christian Heinrichs 04/2015
 *
 */

#ifndef STRING_H_
#define STRING_H_

#include <cmath>
#include "Junction.h"
#include "Waveguide.h"

class String
{

public:

	String();
	float update(float in);

	float getPlectrumDisplacement();
	void setMidinote(float midinote);
	void setFrequency(float frequency);
	void setPeriod(float periodInMs);
	void setPluckPosition(float pluckPos);
	void setGlobalPosition(float pos);
	float getGlobalPosition();

private:

	float _previous_l;
	float _previous_r;

	float _globalPosition;

	Waveguide wg_l;
	Waveguide wg_r;
	Junction junction;

};

#endif