// Short version of the Runs program #include "batonImprov.h" SigTimer duration; // duration for next note Voice voice; // keeps track of note-offs int targetPitch; // baton 1 pitch location int pitch = -1; // pitch following baton 1 int loudness; // loudness of following pitch int stepsize; // interval between successive pitches int period; // duration of pitch in milliseconds int interval; // step size between pitches void mainloopalgorithms(void) { if (duration.expired()) { period = midiscale(baton.x2p, 750, 50); targetPitch = midiscale(baton.x1p, A0, C7); loudness = midiscale(baton.y1p, 10, 120); interval = midiscale(baton.y2p, 0, 12); if (pitch == -1) { pitch = targetPitch; } else { if (pitch < targetPitch) { pitch += interval; } else { pitch -= interval; } } voice.play(pitch, loudness); duration.setPeriod(period); duration.reset(); } } void description(void) { } void initialization(void) { } void finishup(void) { } void stick1trig(void) { } void stick2trig(void) { } void b14plustrig(void) { } void b15plustrig(void) { } void b14minusuptrig(void) { } void b14minusdowntrig(void) { } void b15minusuptrig(void) { } void b15minusdowntrig(void) { } void keyboardchar(int key) { }