int main() { // initScaleTo12TET(110); initScaleToMyPitches(); initScaleTo12TET(110); Scheduler s; s.add<AddSyn>(0).set(6.2,155.6,0.1,0.5,0.0001,3.8,0.3,0.4,0.0001,6.0,0.99,0.3,0.0001,6.0,0.9,2,3,4.07,0.56,0.92,1.19,1.7,2.75,3.36); s.add<AddSyn>(7.0).set(6.2,622.2,0.1,0.5,0.0001,6.1,0.99,0.4,0.0005,6.1,0.99,0.3,0.0005,6.1,0.9,2,3,4.07,0.56,0.92,1.19,1.7,2.75,3.36); s.add<AddSyn>(14.0).set(6.2,155.6,0.01,0.5,0.1,0.1,0.8,0.5,0.001,0.1,0.8,0.6,0.01,0.075,0.9,1,2.001,3,4.00009,5.0002,6,7,8,9); s.add<AddSyn>(21.0).set(6.2,77.78,0.01,0.5,0.1,0.4,0.8,0.5,0.001,0.4,0.8,0.6,0.01,0.4,0.5,1,2.0001,3,4.00009,5.0002,6,7,8,9); s.add<AddSyn>(28.0).set(6.2,311.1,0.01,0.5,0.1,0.4,0.8,0.5,0.001,0.4,0.8,0.6,0.01,0.4,0.5,1,1.0001,3,3.0009,5.0002,5,7,7.0009,9); s.add<AddSyn>(35.0).set(6.2,1245,0.01,0.5,0.0001,6.1,0.99,0.4,0.0005,6.2,0.99,0.3,0.0005,6.2,0.9,1,3,4.07,.56,.92,1.19,1.7,2.74,3.36); // s.add<Chimes>(0).freq(rnd::uni(.2,.5), rnd::uni(50.0f,500.0f)); fillTime(s,40,44, .1, .5, 1000, 2000); // fillTime(s,4,7, .5, 1.5, 200, 500); fillTimeWith12TET(s,45,58,.100,.400); s.add<AddSyn>(59.0).freq(6.2, 155.6); s.add<AddSyn>(65.0).freq(6.2, randomFromMyScale()); s.add<AddSyn>(71.0).freq(6.2,311.1).freqUp(2., 3., 4., 5.).decayLow(456); s.add<Chimes>(77.0).freq(6.2,1245); // A bunch of random-freq notes over 10 seconds: //for (float t = 0; t<10; t += 0.5) { // s.add<Chimes>(t).dur(0.4).freq(randomFromHarmonicSeries()); //} AudioIO io(256, 44100., Scheduler::audioCB, &s); gam::sampleRate(io.fps()); io.start(); printf("\nPress 'enter' to quit...\n"); getchar(); }
void GTreeGeometry::fillUnknownTimes() { int *dmax; inf = (double*) malloc(tree->size*sizeof(double)); sup = (double*) malloc(tree->size*sizeof(double)); dmax = (int*) malloc(tree->size*sizeof(int)); fillBounds(tree->root, minTime, maxTime, inf, sup, dmax); fillTime(tree->root, minTime, inf, sup, dmax); free((void*)dmax); }
void GTreeGeometry::fillTime(int n, double tanc, double *min, double *max, int *dmax) { int c; if(time[n] == NO_TIME) { double tmp = utils_MAX(tanc, min[n]); if(max[n]<tanc) printf("\n\nProblem %.2lf %.2lf\n%d\n", max[n], tanc, n); if(tree->node[n].child != NOSUCH) time[n] = tmp+(max[n]-tmp)/((double)(2+dmax[n])); else time[n] = max[n]; } for(c=tree->node[n].child; c>=0; c=tree->node[c].sibling) fillTime(c, time[n], min, max, dmax); }