keys to change playback tickrate

This commit is contained in:
minjaesong
2026-05-12 23:35:42 +09:00
parent 2ffdf32c91
commit 577d46d31e
4 changed files with 17 additions and 3 deletions

View File

@@ -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)

View File

@@ -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>&nbsp;EDIT MODE</b>
<b>\u00B7${'\u00B8'.repeat(9)}\u00B9</b>

View File

@@ -2399,7 +2399,7 @@ TODO:
previous "row volume default = 63" behaviour.
[x] physical_presence order 0x1F chn 2: note cuts unexpectedly fast — engine fix
[x] GSLINGER order 0x03 chn 1: L 0100 fades unexpectedly fast? — converter fix
[ ] do not reset tickspeed on pattern view play / add key to modify tick speed ('[' down/']' up)
[x] do not reset tickspeed on pattern view play / add key to modify tick speed ('[' down/']' up)
[ ] expose song table on UI (test with `insaniq2.taud`)
TODO - list of demo songs that MUST ship with Microtone:

View File

@@ -3410,6 +3410,7 @@ class AudioAdapter(val vm: VM) : PeriBase(VM.PERITYPE_SOUND) {
var samplePos = 0.0
var playbackRate = 1.0
var forward = true
var instrumentId = 0
// -1 for live foreground voices held by TrackerState.voices[]; 0..19 for background
// (mixer-private) ghosts spawned by NNA on the matching channel index.