mirror of
https://github.com/curioustorvald/tsvm.git
synced 2026-06-06 13:38:30 +09:00
keys to change playback tickrate
This commit is contained in:
@@ -1555,6 +1555,8 @@ function timelineInput(wo, event) {
|
||||
if (keyJustHit && shiftDown && event.includes(keys.E)) { setTimelineRowStyle(1); return }
|
||||
if (keyJustHit && shiftDown && event.includes(keys.R)) { setTimelineRowStyle(2); return }
|
||||
|
||||
if (keyJustHit && (keysym === '[' || keysym === ']')) { nudgeTickRate(keysym === '[' ? -1 : 1); return }
|
||||
|
||||
if (playbackMode !== PLAYMODE_NONE) {
|
||||
if (keyJustHit && shiftDown && event.includes(keys.Y) || keysym === " ") { stopPlayback(); redrawPanel(); drawAlwaysOnElems() }
|
||||
else if (keysym === "<LEFT>" || keysym === "<RIGHT>") {
|
||||
@@ -2188,6 +2190,8 @@ function patternsInput(wo, event) {
|
||||
const shiftDown = (event.includes(59) || event.includes(60))
|
||||
const moveDelta = shiftDown ? 4 : 1
|
||||
|
||||
if (keyJustHit && (keysym === '[' || keysym === ']')) { nudgeTickRate(keysym === '[' ? -1 : 1); return }
|
||||
|
||||
if (playbackMode !== PLAYMODE_NONE) {
|
||||
if ((keyJustHit && shiftDown && event.includes(keys.Y)) || keysym === " ") {
|
||||
stopPlayback(); simStateKey = ''; drawPatternsContents(wo); drawAlwaysOnElems()
|
||||
@@ -2346,6 +2350,16 @@ function restoreFullSongParams() {
|
||||
previewActive = false
|
||||
}
|
||||
|
||||
// Adjust the live tick rate by `delta`. The engine still honours 'A' (set speed) effects,
|
||||
// which will overwrite this value when their row is hit during playback.
|
||||
function nudgeTickRate(delta) {
|
||||
const cur = audio.getTickRate(PLAYHEAD) | 0
|
||||
const next = Math.max(1, Math.min(255, cur + delta))
|
||||
if (next === cur) return
|
||||
audio.setTickRate(PLAYHEAD, next)
|
||||
drawAlwaysOnElems()
|
||||
}
|
||||
|
||||
function startPlaySong() {
|
||||
restoreFullSongParams()
|
||||
audio.stop(PLAYHEAD)
|
||||
@@ -2392,7 +2406,6 @@ function startPlayPattern() {
|
||||
if (song.numPats === 0) return
|
||||
audio.stop(PLAYHEAD)
|
||||
audio.setBPM(PLAYHEAD, song.bpm)
|
||||
audio.setTickRate(PLAYHEAD, song.tickRate)
|
||||
audio.uploadCue(PREVIEW_CUE_IDX, buildPreviewCue(patternIdx))
|
||||
audio.setCuePosition(PLAYHEAD, PREVIEW_CUE_IDX)
|
||||
audio.setTrackerRow(PLAYHEAD, 0)
|
||||
@@ -2408,7 +2421,6 @@ function startPlayPatternRow() {
|
||||
if (song.numPats === 0) return
|
||||
audio.stop(PLAYHEAD)
|
||||
audio.setBPM(PLAYHEAD, song.bpm)
|
||||
audio.setTickRate(PLAYHEAD, song.tickRate)
|
||||
audio.uploadCue(PREVIEW_CUE_IDX, buildPreviewCue(patternIdx))
|
||||
audio.setCuePosition(PLAYHEAD, PREVIEW_CUE_IDX)
|
||||
audio.setTrackerRow(PLAYHEAD, patternGridRow)
|
||||
|
||||
@@ -90,6 +90,7 @@ Timeline has two distinct modes: view and edit mode. Two modes are toggled using
|
||||
&bul;<b>W</b>&mdot;<b>E</b>&mdot;<b>R</b> : <O>toggle timeline view mode. W-most detailed, R-most abridged</O>
|
||||
&bul;<b>n</b> : <O>toggle soloing of the selected voice</O>
|
||||
&bul;<b>m</b> : <O>toggle muting of the selected voice</O>
|
||||
&bul;<b>[</b>&mdot;<b>]</b> : <O>change tick rate of playhead</O>
|
||||
|
||||
<b> EDIT MODE</b>
|
||||
<b>\u00B7${'\u00B8'.repeat(9)}\u00B9</b>
|
||||
|
||||
Reference in New Issue
Block a user