comparison SequenceController.h @ 41:ba426cc4e6e1

better sequence gen , same for easy (1) and hard (many ) seq fixed judder on sliders
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Fri, 05 Dec 2014 18:36:05 +0000
parents 96ff7b41923a
children 2bd658b44c2d
comparison
equal deleted inserted replaced
40:accc83229d76 41:ba426cc4e6e1
12 #include <iostream> 12 #include <iostream>
13 #include "ofMain.h" 13 #include "ofMain.h"
14 #include "presetManager.h" 14 #include "presetManager.h"
15 #include "TrainingScoreManager.h" 15 #include "TrainingScoreManager.h"
16 16
17 #define MIN_TARGETS_IN_SEQUENCE 1 17 #define MIN_TARGETS_IN_SEQUENCE 3
18 #define NUM_REPETITIONS_AT_LEVEL 2 18 #define NUM_REPETITIONS_AT_LEVEL 2
19 #define MAX_TARGETS_IN_SEQUENCE 3 19 #define MAX_TARGETS_IN_SEQUENCE 3
20 #define MIN_TEMPO 70 20 #define MIN_TEMPO 70
21 #define MAX_TEMPO 500 21 #define MAX_TEMPO 500
22 #define TEMPO_RANDOM_AMOUNT 22 #define TEMPO_RANDOM_AMOUNT
23 #define MAX_TIME 2800 23 #define MAX_TIME 2800
24 #define MIN_TIME 200 24 #define MIN_TIME 200
25 #define NUM_TEMPO_STEPS 20 25 #define NUM_TEMPO_STEPS 20
26 #define END_NEUTRAL_MATCH 0
26 27
27 #define NUM_PRESETS 8 28 #define NUM_PRESETS 8
28 #define SPACER_BARS false 29 #define SPACER_BARS false
29 #define NO_GUIDES_LEVEL false 30 #define NO_GUIDES_LEVEL false
30 31
140 TrainingTestResult getResultForPreviousStep(); 141 TrainingTestResult getResultForPreviousStep();
141 int getTotNumRuns(){return totNumRuns;}; 142 int getTotNumRuns(){return totNumRuns;};
142 private: 143 private:
143 void generateSteps(); 144 void generateSteps();
144 void generateCountIn(int countInLength); 145 void generateCountIn(int countInLength);
145 void generateARun(int run, int numInSequence); 146 void generateRun(int run, int numInSequence);
147 void generateARun(int run, int numInSequence); // use this
146 void generateAnEasyRun(int run, int numInSequence = 1); 148 void generateAnEasyRun(int run, int numInSequence = 1);
147 void generateASoundOnlyRun(int run, int numInSequence); 149 void generateASoundOnlyRun(int run, int numInSequence);
148 vector<int> randomSequence(int numInSequence); 150 vector<int> randomSequence(int numInSequence);
149 vector<int> nonRandomSequence(int numInSequence); 151 vector<int> nonRandomSequence(int numInSequence);
150 int getRandomButNot(int max, vector<int> notThese); 152 int getRandomButNot(int max, vector<int> notThese);
153 void makeGuidedSequence(vector<int> stepPresetIndices, int run, AnimStep& nextStep);
154 void makeMatchingSequence(vector<int> stepPresetIndices, int run, AnimStep& nextStep);
155 void makePreview(vector<int> stepPresetIndices, int run, AnimStep& nextStep);
151 protected: 156 protected:
152 vector<AnimStep> steps; 157 vector<AnimStep> steps;
153 vector<AnimStep>::iterator currentStep; 158 vector<AnimStep>::iterator currentStep;
154 float tempoInc; 159 float tempoInc;
155 int timeInc; 160 int timeInc;