view src/beatTempo.h @ 12:e148d1534733 tip

adding new max player
author Andrew N Robertson <andrew.robertson@eecs.qmul.ac.uk>
date Fri, 09 Mar 2012 20:42:34 +0000
parents 0f9165f96bdb
children
line wrap: on
line source
/*
 *  beatTempo.h
 *  bayesianTempo1
 *
 *  Created by Andrew Robertson on 08/05/2010.
 *  Copyright 2010 __MyCompanyName__. All rights reserved.
 *
 */

class beatTempo{

public:
	beatTempo();
	
	double beatTimes[16];
	double relativeIntervals[16][2];
	double intervalDifferences[16][16];//diff between new index , other index
	bool   intervalUsed[16][16];
	int tatumMultiples[16][16];
	bool OnsetIsKick[16];
	
	int closestClickIndexToBeat[16];
	int clickIndex;//used by testApp but to be replaced
//	int clickPosition[16];
	
	double clickTimes[16];
	int clickNumber[16];
	float beatMapTimeDifferences[48];
	
	float beatProbabilityDistribution[4][6][2];
	
//	int recentClickIndex;
	
	int index, startIndex;
	
	char beatMap[48];
	
	void addBeatTime(double f, int type);
	double calculateInterval(int newIndex, int otherIndex);
	void addToProbabilityDistribution(int beatSegment, int typeToAdd);
	void decayProbabilityDistributionRow(int row);
	void resetBeatTimeArray();
	
	double tatum;
	double lastClickTime, lastBeatTime;
	int lastClickIndex, beatSegment, timeDifference;
	float decayAmount;//amount that the old probability observation contributed to the probability array
	
};