void mainloopalgorithms(void) { if (seqstate && nextnotetime <= t_time) { nextnotetime += duration; if (curbeat >= meter*2 || curbeat == 0) { curbeat = 0; emphasis = midiscale(baton.d2p, 0, 20); meter = nextmeter; } else { if (curbeat % 2 == 0) { emphasis = 7; } else { emphasis = 0; } } curbeat++; if (baton.z2p < z2level) { emphasis = 0; } key = nextHenon(alpha, beta, x, xx) + transpose; if (key >= minnote && key <= maxnote) { cout << "\tPlaying note: " << key << "\tvel=" << loudness + emphasis << "\tdur=" << duration << "\tbeat=" << curbeat/2.0+0.5 << " " << "\tmeter=" << meter << endl; voice.play(key, loudness + emphasis); } else { voice.off(); } } }
void mainloopalgorithms(void) { if (synth.getNoteCount() > 0) { message = synth.extractNote(); if (message.getP2() != 0) { startHenon(message.getP1(), message.getP2()); } } if (nextnotetime < t_time) { nextnotetime += 100; key = nextHenon(); voice.play(key, 64); } }
void stick1trig(void) { seqstate = 1; // enable playing of sequence nextnotetime = t_time; initSequence(x, xx, alpha, beta, baton.x1t, baton.y1t); nextHenon(alpha, beta, x, xx); // ignore first value }