tapping a track to the left of the playhead plays it backwards

Hunter
Wednesday, November 18th, 2026 at 6:17 PM

readme_images/play.gif  
resources/deck.js+1-1
resources/main.js+8-2

readme_images/play.gif
Binary files differ.
resources/deck.js
41  				this.playbackGain = data.playbackGain;
42  			}
43  			if (data.type === 'load') this.add(data.samples, data.volume);
   -			if (data.type === 'play') tape.target = 1;
44 +			if (data.type === 'play') tape.target = data.speed;
45  			if (data.type === 'press' || data.type === 'brake') {
46  				// Stop time is fixed at any speed. A brake after a press keeps the press's rate.
47  				if (!tape.pressed) tape.stopRate = Math.abs(tape.speed) / this.spinDownSamples;
resources/main.js
412  		if (mode === 'throttle') {
413  			send('release');
414  		} else if (!mode && event.type === 'pointerup') {
    -			send(wasPlaying ? 'brake' : 'play');
    -			tape.direction = wasPlaying ? 0 : 1;
415 +			if (wasPlaying) {
416 +				send('brake');
417 +				tape.direction = 0;
418 +			} else {
419 +				const box = row.getBoundingClientRect();
420 +				tape.direction = event.clientX < (box.left + box.right) / 2 ? -1 : 1;
421 +				send('play', {speed: tape.direction});
422 +			}
423  		} else if (pressed) {
424  			send('drop');
425  		}