Files
tsvm/assets/disk0/tvdos/bin/taut_helpmsg.js
2026-05-22 01:37:24 +09:00

172 lines
7.5 KiB
JavaScript

if (!_G.TAUT) _G.TAUT = {};
let help = {}
let ts = require("typesetter")
////////////////////////////////////////////////////////////////////////////////////////////////////
/*
Tags:
<b> - print the text in emphasis colour (colVoiceHdr aka 230)
<c> - centre the line. If the line spans multiple lines, centre each line
<r> - align right
<l> - align left
<o> - create virtual typesetting box. Left anchor: where the text cursor is. Right anchor: end of the line
&microtone; - replace with the brand string (<col 211>Micro</col><col 239>tone</col>)
&bul; - replace with bullet (\u00F9)
&ddot; - replace with double-dot (\u008419u)
&mdot; - replace with BIGDOT (\u00FA)
&updn; - up-down arrow (\u008418u)
&udlr; - four direction arrow (\u008428u\u008429u)
&keyoffsym; - pattern view key-off symbol (\u00A0\u00B1\u00B1\u00A1)
&notecutsym; - pattern view note-cut symbol (\u00A4\u00A4\u00A4\u00A4)
&demisharp;
&sharp;
&sesquisharp;
&doublesharp;
&triplesharp;
&quadsharp;
&demiflat;
&flat;
&sesquiflat;
&doubleflat;
&tripleflat;
&quadflat;
&accuptick;
&accdntick;
&accupup;
&accdndn;
&nbsp; - nonbreakable space (only meaningful for typesetters)
&shy; - soft hyphen (only meaningful for typesetters)
default alignment: fully justified
*/
let helpNotation = `<c>CONTROL NOTATION</c>
<c>\u00B7${'\u00B8'.repeat(16)}\u00B9</c>
&microtone; <O>shortcuts differentiate normal and shifted shortcuts.</O>
&bul;<b>a</b>&ddot;<b>z</b> : <O>alphabet without shift-in</O>
&bul;<b>A</b>&ddot;<b>Z</b> : <O>alphabet with shift-in</O>
&bul;<b>^q</b> : <O>hit 'q' with control key</O>
&bul;<b>^Q</b> : <O>hit 'q' with control and shift key</O>
`
////////////////////////////////////////////////////////////////////////////////////////////////////
let helpJam = `<c>NOTE JAMMING</c>
<c>\u00B7${'\u00B8'.repeat(12)}\u00B9</c>
Push keys to play or insert notes.
&nbsp;w&nbsp;e&nbsp;&nbsp;&nbsp;t&nbsp;y&nbsp;u
a&nbsp;s&nbsp;d&nbsp;f&nbsp;g&nbsp;h&nbsp;j&nbsp;k
`
////////////////////////////////////////////////////////////////////////////////////////////////////
let helpCommon = `<c>COMMON CONTROLS</c>
<c>\u00B7${'\u00B8'.repeat(15)}\u00B9</c>
&bul;<b>!</b> : <O>show this help message</O>
&bul;<b>Y</b> : <O>plays the entire song from the current cue</O>
&bul;<b>U</b> : <O>plays the current cue then stop</O>
&bul;<b>I</b> : <O>plays the current row</O>
&bul;<b>O</b> : <O>stops the playback</O>
&bul;<b>tab</b> : <O>switchs forward a tab</O>
&bul;<b>TAB</b> : <O>switchs backward a tab</O>
&bul;<b>q</b> : <O>closes &microtone;</O>
`
////////////////////////////////////////////////////////////////////////////////////////////////////
let helpTimeline = `<c>TIMELINE VIEW</c>
<c>\u00B7${'\u00B8'.repeat(13)}\u00B9</c>
Timeline has two distinct modes: view and edit mode. Two modes are toggled using the space bar.
<b>&nbsp;VIEW MODE</b>
<b>\u00B7${'\u00B8'.repeat(9)}\u00B9</b>
&bul;Note jamming : <O>plays the note</O>
&bul;<b>&udlr;</b> : <O>moves the viewing cursor by voices and rows</O>
&bul;<b>pg&updn;</b> : <O>goes to previous/next cue</O>
&bul;<b>W</b>&mdot;<b>E</b>&mdot;<b>R</b> : <O>toggles timeline view mode. W-most detailed, R-most abridged</O>
&bul;<b>n</b> : <O>toggles soloing of the selected voice</O>
&bul;<b>m</b> : <O>toggles muting of the selected voice</O>
&bul;<b>[</b>&mdot;<b>]</b> : <O>changes tick rate of playhead</O>
<b>&nbsp;EDIT MODE</b>
<b>\u00B7${'\u00B8'.repeat(9)}\u00B9</b>
&bul;Note jamming : <O>(note column) inserts the note</O>
&bul;<b>{</b>&mdot;<b>}</b> : <O>(note column) lowers/raises a note by one octave (or period)</O>
&bul;<b>[</b>&mdot;<b>]</b> : <O>(note column) lowers/raises a note by one unit</O>
&bul;<b>z</b> : <O>(note column) inserts a key-off &keyoffsym;</O>
&bul;<b>x</b> : <O>(note column) inserts a note-cut &notecutsym;</O>
&bul;<b>.</b> : <O>clears fields</O>
&bul;<b>bksp</b> : <O>deletes one character on the selected column</O>
&bul;<b>0</b>&ddot;<b>9</b> <b>a</b>&ddot;<b>f</b> : <O>inserts a (hexa)decimal number</O>
&bul;<b>0</b>&ddot;<b>9</b> <b>a</b>&ddot;<b>z</b> : <O>(fx column) inserts an effect</O>
&bul;<b>^</b>&mdot;<b>v</b> : <O>(volume column) slide up/down</O>
&bul;<b>&lt;</b>&mdot;<b>&gt;</b>: <O>(panning column) slide left/right</O>
&bul;<b>-</b>&mdot;<b>=</b> : <O>(vol/pan col) fine slide down/up</O>
&bul;<b>&udlr;</b> : <O>moves the viewing cursor by columns and rows</O>
&bul;<b>pg&updn;</b> : <O>goes to previous/next cue</O>
<b>&nbsp;ACCIDENTALS</b>
<b>\u00B7${'\u00B8'.repeat(11)}\u00B9</b>
&demisharp;&nbsp;&sharp;&nbsp;&doublesharp;&nbsp;&triplesharp;&nbsp;&quadsharp;&nbsp;&demiflat;&nbsp;&flat;&nbsp;&doubleflat;&nbsp;&tripleflat;&nbsp;&nbsp;&accuptick;&nbsp;&nbsp;&accupup;&nbsp;&nbsp;&accdntick;&nbsp;&nbsp;&accdndn;
<b>C&nbsp;&nbsp;c&nbsp;&nbsp;cx&nbsp;x&nbsp;&nbsp;xx&nbsp;B&nbsp;&nbsp;b&nbsp;&nbsp;bb&nbsp;bbb&nbsp;^&nbsp;&nbsp;^^&nbsp;v&nbsp;&nbsp;vv</b>
<b>&nbsp;GLOBAL EDIT</b>
<b>\u00B7${'\u00B8'.repeat(11)}\u00B9</b>
&bul;<b>Q</b> : <O>retunes current song into different tuning and strategy. In general, nearest-note works best for macrotonals, nearest-harmonic and nearest-delta works best for highly microtonals (31+); 17- and 19-TET takes nearest-harmonic pretty well, while 22-TET seem to only benefit from the nearest-note</O>
`
let helpProjectFlags = `<c>MIXER FLAGS</c>
<c>\u00B7${'\u00B8'.repeat(11)}\u00B9</c>
Mixer flags define how should the mixer behave.
<b>&nbsp;TONE MODE</b>
<b>\u00B7${'\u00B8'.repeat(9)}\u00B9</b>
&bul;Linear pitch : <O>pitch shift effects operate on linear pitch scale. The default and recommended setting for a new project</O>
&bul;Amiga pitch : <O>pitch shift effects operate on Amiga period scale. Backwards compatible setting for MOD/S3M/XM/IT formats</O>
&bul;Linear freq : <O>pitch shift effects operate on linear frequency scale. Backwards compatible setting for MONOTONE format</O>
<b>&nbsp;INTERPOLATION</b>
<b>\u00B7${'\u00B8'.repeat(13)}\u00B9</b>
&bul;Default : <O>three-tap fast sinc interpolation. The default and recommended setting for a new project</O>
&bul;None : <O>zeroth-order hold</O>
&bul;A500 : <O>emulates what Paula chip of Amiga 500 does. <b>S 0x00</b> effects only work with this and Amiga 1200 mode</O>
&bul;A1200 : <O>emulates what Paula chip of Amiga 1200 does</O>
&bul;SNES : <O>four-tap gaussian interpolation used by SNES</O>
&bul;DPCM : <O>simulates Differential Pulse Code Modulation used by NES</O>
`
////////////////////////////////////////////////////////////////////////////////////////////////////
// assemble help text pieces to complete help message
const HRULE = '\u00B4\u00B5'.repeat((_G.TAUT.HELPMSG_WIDTH) >>> 1) + '\n'
// taut.js's popup uses (HELP_COL_TEXT on background) as the default colour pair.
// The shared typesetter module owns the palette and the markup expander.
function typeset(text) {
return ts.typeset(text, _G.TAUT.HELPMSG_WIDTH)
}
let helpMessages = [ // index: taut.js PANEL_NAMES
/* Timeline */[helpJam, helpTimeline, helpCommon, helpNotation].join(HRULE),
/* Cues */[helpCommon, helpNotation].join(HRULE), // placeholder
/* Patterns */[helpCommon, helpNotation].join(HRULE), // placeholder
/* Samples */[helpCommon, helpNotation].join(HRULE), // placeholder
/* Instruments */[helpCommon, helpNotation].join(HRULE), // placeholder
/* Project */[helpProjectFlags, helpCommon, helpNotation].join(HRULE), // placeholder
/* File */[helpCommon, helpNotation].join(HRULE), // placeholder
]
help.MSG_BY_TABS = helpMessages.map(it => typeset(it))
help.typeset = typeset
help.COL_TEXT = ts.COL_TEXT
help.COL_EMPH = ts.COL_EMPH
if (!_G.TAUT.HELPMSG) _G.TAUT.HELPMSG=help;