int trap(int pos) { if (pos < 0) { return 0; } else if (pos > test!.bpmEntries!.length) { pos = test!.bpmEntries!.length - 10; } return pos; }