BPMTimeline is a time mapping library, providing a seamless mapping between score and performance time. To achieve this, we model tempo changes as tempo functions (a well documented subject in literature) and realize the mappings through integral and inverse of integral of tempo functions.
var initialBPM = 60;
var automation = new BPMTimeline(initialBPM);
automation.add_tempo_marker({type: "linear", endBeat: 50, endBPM : 120 });
automation.add_tempo_marker({type: "linear", endBeat: 100, endBPM : 140 });
automation.add_tempo_marker({type: "step", endBeat: 120, endBPM : 50 });
automation.add_tempo_marker({type: "linear", endBeat: 125, endBPM : 10 });
automation.add_tempo_marker({type: "exponential", endBeat: 130, endBPM : 1000 });
automation.remove_tempo_marker({ endBeat: 50 });
automation.remove_tempo_marker({ endTime: 37.5 });
automation.change_tempo_marker({endBeat:130, endBPM: 100});
automation.time(132);
automation.beat(40);
automation.tempo_at_beat(132);
automation.tempo_at_time(60);
- Linear: v(t) = V0 + (V1 - V0) * ((t - T0) / (T1 - T0))
- Exponential: v(t) = V0 * e^(log(y1/y0) * (x - x0) / (x1 - x0))
- Step: v(t) = (t < T1)? V0 : V1
- Scheduling events using beat values, relating them directly to time (seconds) values used by the scheduler.
- Showing the time value of the beats in a DAW composer grid.
- Automatic Synchronization of multiple audio players to a master tempo timeline.