Event creation, evaluation, and batch manipulation utilities.
Covers RPE events (moveX, moveY, rotate, alpha, speed), color events, text events, gif events, and extended properties.
[measure, numerator, denominator]
Line.handleSpeed
import { toBeats, fromBeats, getTimeSec, createEvent, keyframesToEvents } from './events';// Convert a beat tuple to a fractional beattoBeats([2, 1, 4]); // 2.25// Convert backfromBeats(2.25); // [2, 1, 4]// Create an event that moves a line from X=-675 to X=675 over beats 0Ⅎ4const ev = createEvent(0, 4, -675, 675, 'cubicOut');// Build keyframe animation: X moves 0→100→0 over beats 0Ⅎ2→4const evs = keyframesToEvents([[0, 0], [2, 100], [4, 0]], 'sineInOut'); Copy
import { toBeats, fromBeats, getTimeSec, createEvent, keyframesToEvents } from './events';// Convert a beat tuple to a fractional beattoBeats([2, 1, 4]); // 2.25// Convert backfromBeats(2.25); // [2, 1, 4]// Create an event that moves a line from X=-675 to X=675 over beats 0Ⅎ4const ev = createEvent(0, 4, -675, 675, 'cubicOut');// Build keyframe animation: X moves 0→100→0 over beats 0Ⅎ2→4const evs = keyframesToEvents([[0, 0], [2, 100], [4, 0]], 'sineInOut');
Event creation, evaluation, and batch manipulation utilities.
Covers RPE events (moveX, moveY, rotate, alpha, speed), color events, text events, gif events, and extended properties.
Key concepts
[measure, numerator, denominator]— see toBeats / fromBeats.Line.handleSpeed).Examples