mirror of
https://github.com/juanjiant-bit/JIANT.git
synced 2026-12-06 12:54:29 +01:00
Verify classic DSP and word codecs; test held fills, recorded ratchets, FX ownership and lyric locks
This commit is contained in:
1 parent
4282158793
commit
f91fc0c84f
11 files changed
+205
-8
No files matched your search
@@ -53,6 +53,16 @@ jobs:
|
||||
}
|
||||
- name: Firmware memory and reach checks
|
||||
run: tail -n 20 build/song-check/target.log
|
||||
- name: DRUM performance and multilingual intentional lyric regression
|
||||
run: |
|
||||
set -euo pipefail
|
||||
cc -O1 -g -w -Wno-implicit-function-declaration -fsanitize=address,bounds -Ibuild/gen -Ifirmware/src tests/drum_voice_extensions_test.c -lm -o build/song-check/drum-voice
|
||||
ASAN_OPTIONS=detect_leaks=0 UBSAN_OPTIONS=halt_on_error=1 build/song-check/drum-voice | tee build/song-check/drum-voice.log
|
||||
cc -O1 -w -Wno-implicit-function-declaration -Ibuild/gen -Ifirmware/src tests/drumx_oct_test.c -lm -o build/song-check/classic-octaves
|
||||
build/song-check/classic-octaves | tee build/song-check/classic-octaves.log
|
||||
cc -O1 -w -Wno-implicit-function-declaration -Ibuild/gen -Ifirmware/src tests/voice_test.c -lm -o build/song-check/voice-reading
|
||||
build/song-check/voice-reading | tee build/song-check/voice-reading.log
|
||||
python3 tests/voice_web_test.py
|
||||
- name: FIT clock, persistence and audio timing
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
@@ -206,7 +206,7 @@ static const char *drum_lane_abbr(const track_t *t, uint32_t l)
|
||||
}
|
||||
|
||||
/* the lanes step s strikes: its hits, and its notes on their lanes (a NOTE step only) */
|
||||
static uint32_t step_lanes_of(const track_t *t, const step_t *s)
|
||||
static __attribute__((noinline)) uint32_t step_lanes_of(const track_t *t, const step_t *s)
|
||||
{
|
||||
uint32_t m = 0, i;
|
||||
if (s->time != ST_NOTE)
|
||||
@@ -218,7 +218,7 @@ static uint32_t step_lanes_of(const track_t *t, const step_t *s)
|
||||
|
||||
/* .. and which of them are accented */
|
||||
static uint32_t step_lanes(const step_t *s) {return step_lanes_of(0,s);}
|
||||
static uint32_t step_accents_of(const track_t *t,const step_t *s)
|
||||
static __attribute__((noinline)) uint32_t step_accents_of(const track_t *t,const step_t *s)
|
||||
{return s->flags&SF_ACCENT?step_lanes_of(t,s):s->acc&step_lanes_of(t,s);}
|
||||
static uint32_t step_accents(const step_t *s) { return step_accents_of(0,s); }
|
||||
|
||||
|
||||
+2
-1
@@ -826,7 +826,8 @@ static uint32_t sy_gen_word(const track_t *t, sing_t *s, uint32_t lang, uint32_t
|
||||
const char *q=SY_EXT_WORDS[lang-LG_RU];
|
||||
uint32_t pick=theme*2u+(sy_rnd(&s->rng)&1u);
|
||||
if(theme==TH_ANY) pick=sy_rnd(&s->rng)&15u;
|
||||
if(lyr>LYR_NW) q="la";
|
||||
if(!ly_en_ok) q="la";
|
||||
else if(lyr>LYR_NW) q=SCAT_ES[sy_rnd(&s->rng)%NELEM(SCAT_ES)];
|
||||
else while(pick--) while(*q++);
|
||||
str_cpy(s->w,q,sizeof s->w);
|
||||
s->prem--;
|
||||
|
||||
@@ -9,14 +9,15 @@
|
||||
#define LP (1u<<(LG_PT-LG_RU))
|
||||
#define LG (1u<<(LG_GN-LG_RU))
|
||||
typedef struct { char s[5]; uint8_t langs,a,b; } sy_rule_t;
|
||||
static const sy_rule_t SY_RULES[] = {
|
||||
{"shch",LR,PH_SH,0}, {"sch",LD,PH_SH,0}, {"eau",LF,PH_O,0},
|
||||
static const sy_rule_t SY_RULES[] LY_DICT_SEC = {
|
||||
{"shch",LR,PH_SH,0}, {"sch",LD,PH_SH,0}, {"eau",LF,PH_O,0}, {"oeu",LF,PH_ER,0},
|
||||
{"zh",LR|LZ,PH_ZH,0}, {"kh",LR,PH_X,0}, {"sh",LR|LZ,PH_SH,0},
|
||||
{"ch",LR|LZ,PH_CH,0}, {"ch",LD,PH_X,0}, {"ch",LF|LP|LG,PH_SH,0},
|
||||
{"ts",LR|LD,PH_TS,0}, {"yu",LR,PH_Y,PH_U}, {"ya",LR,PH_Y,PH_A},
|
||||
{"yo",LR,PH_Y,PH_O}, {"ye",LR,PH_Y,PH_E},
|
||||
{"ei",LD,PH_A,PH_I}, {"ie",LD,PH_I,0}, {"eu",LD,PH_O,PH_I},
|
||||
{"ae",LD,PH_EH,0}, {"oe",LD,PH_ER,0}, {"ue",LD,PH_UJ,0},
|
||||
{"ei",LF,PH_E,0}, {"eh",LF,PH_EH,0},
|
||||
{"ou",LF,PH_U,0}, {"eu",LF,PH_ER,0}, {"oi",LF,PH_W,PH_A},
|
||||
{"gn",LF,PH_NY,0}, {"nh",LP,PH_NY,0}, {"lh",LP,PH_Y,0},
|
||||
{"ny",LG,PH_NY,0}, {"ng",LZ|LG,PH_NG,0},
|
||||
@@ -34,6 +35,7 @@ static const sy_rule_t SY_RULES[] = {
|
||||
};
|
||||
static uint32_t sy_ext(uint32_t lang, const char *w, uint32_t n, uint8_t *tc, uint8_t *tk)
|
||||
{
|
||||
if(!ly_en_ok) return sy_es_tok(w,n,tc,tk); /* unverified/missing optional bank */
|
||||
uint32_t i=0,m=0,mask=1u<<(lang-LG_RU);
|
||||
while(i<n && m+2u<=SW_MAX) {
|
||||
uint32_t j,k=0,a=0,b=0;
|
||||
|
||||
+1
-1
@@ -1183,7 +1183,7 @@ static void cursor_fix(void) /* LEN got shorter: onto
|
||||
/* Main-loop lyric selection. All phones/counters are temporary, the result is
|
||||
* an ordinary POS lock in the existing motion store, leaving both components. */
|
||||
static uint8_t lyric_word, lyric_syl=1;
|
||||
static uint32_t lyric_pick(char *label)
|
||||
static __attribute__((noinline)) uint32_t lyric_pick(char *label)
|
||||
{
|
||||
const char *txt=lyr_get(song.sel);
|
||||
uint32_t p=0,a,b,mel,w=0,base=0,ns=0;
|
||||
|
||||
@@ -0,0 +1,145 @@
|
||||
/* SPDX-License-Identifier: GPL-3.0-only
|
||||
* Exercise real key ownership, scheduler, rendering, locks and project codec. */
|
||||
#define DRUM_OCT_NO_MAIN 1
|
||||
#include "drumx_oct_test.c"
|
||||
|
||||
static int extensions(void)
|
||||
{
|
||||
int bad=0,ok=1;uint32_t k,j,p,r,n;
|
||||
drum_setup();
|
||||
bad+=check("EXT is opt-in: existing kits default to CLASSIC",!drum_ext(dt));
|
||||
dt->p[P_DKEYMODE]=1;
|
||||
for(k=35;k<=81;k++) ok &= drum_note_lane(dt,k)==drum_lane(k);
|
||||
bad+=check("EXT preserves every GM note 35..81",ok);
|
||||
ok=1;
|
||||
for(k=0;k<27;k++) {
|
||||
song.octave=-1;key_dn(k);lanes_b(2);
|
||||
uint32_t l=k<13?DV_KICK:DV_TOM;
|
||||
ok &= kb_snd[k][0]==k && drum_kit[3][l].st==(int32_t)k-(k<13?6:19) && !drum_kit[3][l].dm;
|
||||
key_upk(k);lanes_b(2);
|
||||
ok &= !kb_on[k] && !dxo_n[3];
|
||||
}
|
||||
bad+=check("EXT -1: 13 chromatic kicks and 14 toms, captured note-offs",ok);
|
||||
ok=1;
|
||||
for(k=0;k<12;k++) {
|
||||
song.octave=-2;key_dn(k);lanes_b(2);
|
||||
n=drum_fx_note(k);uint32_t l=DX_EXT_FX[k]&7;
|
||||
ok &= kb_snd[k][0]==n && (drum_kit[3][l].dm>>2)==k+1u;
|
||||
/* Changing map and octave while held must not lose the release. */
|
||||
dt->p[P_DKEYMODE]=0;song.octave=2;key_upk(k);lanes_b(2);
|
||||
ok &= !kb_on[k]&&!dxo_n[3];dt->p[P_DKEYMODE]=1;
|
||||
trk_note_on(dt,DRUM_LANE_NOTE[l],100);
|
||||
ok &= !drum_kit[3][l].dm;
|
||||
}
|
||||
bad+=check("EXT -2: per-hit FX captured; ordinary hits restore kit, no stuck key",ok);
|
||||
/* A hit can start after side_begin: bus contents must not leak from the
|
||||
* previously rendered track on the same core. */
|
||||
dt->p[P_DXIMG]=0;memset(dx_snd,0,sizeof dx_snd);
|
||||
dx_core_t *dc=&DXC;dc->xon=0;
|
||||
for(k=0;k<CTL;k++) dc->sb[2][k]=123456;
|
||||
trk_note_on(dt,drum_fx_note(0),100);
|
||||
int32_t g[4],*bus,amt;
|
||||
ok=drum_side_of(dc,DV_KICK,drum_send(dt,DV_KICK),g,&bus,&amt)&&amt==63&&bus==dc->sb[2];
|
||||
for(k=0;k<CTL;k++) ok &= !bus[k];
|
||||
bad+=check("EXT sends: lazy per-core bus clearing for intra-block note-on",ok);
|
||||
uint32_t hashes[12];ok=1;
|
||||
for(k=0;k<12;k++) {
|
||||
dxo_t e={0};e.half=2;e.note=(uint8_t)k;uint32_t h=2166136261u;
|
||||
for(p=0;p<16;p++) for(j=0;j<3;j++) {
|
||||
n=dxp_note(&e,p,j,&r);h=(h^n^r<<8)*16777619u;
|
||||
ok &= r==1||r==2||r==4;
|
||||
}
|
||||
for(j=0;j<k;j++) ok &= hashes[j]!=h;
|
||||
hashes[k]=h;
|
||||
}
|
||||
bad+=check("EXT: twelve distinct 16-step fills, recordable per-lane rates",ok);
|
||||
ok=1;
|
||||
for(k=0;k<12;k++) {
|
||||
drum_setup();dt->p[P_DKEYMODE]=1;song.octave=1;
|
||||
key_dn(k);lanes_b(2);
|
||||
ok &= dxo_n[3]==1 && dxo[3][0].half==2 && dxo[3][0].ph==0;
|
||||
uint32_t per=div_samples(dt->p[P_SDIV])/4u;
|
||||
for(p=0;p<64;p++) dxo_tick(dt,per);
|
||||
ok &= dxo[3][0].ph==0 && dxo[3][0].part==0;
|
||||
song.octave=0;key_upk(k);lanes_b(2);
|
||||
ok &= !dxo_n[3]&&!kb_on[k];
|
||||
}
|
||||
bad+=check("EXT fills repeat while held, wrap after one bar, release at changed octave",ok);
|
||||
drum_setup();dt->p[P_DKEYMODE]=1;
|
||||
midi_play(dt,0,98,100);
|
||||
bad+=check("EXT external keyboard starts ratchet sets",dxo_n[3]==1&&dxo[3][0].half==3);
|
||||
dxo_off(dt,DXO_MIDI+98);
|
||||
bad+=check("EXT external keyboard releases the performance",!dxo_n[3]);
|
||||
/* Recording stores the same lane/rate recipe, not virtual control notes. */
|
||||
drum_setup();dt->p[P_DKEYMODE]=1;song.rec=1u<<3;seq_start();
|
||||
lanes_until(1,step_len(1)/8u);dxo_on(dt,99,0,100,DXO_MIDI+99);
|
||||
lanes_until(5,step_len(5)/4u);dxo_off(dt,DXO_MIDI+99);seq_stop();
|
||||
ok=1;n=0;
|
||||
for(k=2;k<5;k++) {
|
||||
const step_t *s=&dt->step[k];n+=s->hit!=0;
|
||||
for(j=0;j<s->n;j++) ok &= s->note[j]<86;
|
||||
for(j=0;j<8;j++) ok &= step_lmode(s,j)<=LM_X4;
|
||||
}
|
||||
bad+=check("EXT held recording writes actual GM lanes and per-lane ratchets",ok&&n>=2);
|
||||
/* Lane view and lane editing must agree with the renderer for encoded FX. */
|
||||
step_t *s=&dt->step[7];step_clear(s);s->time=ST_NOTE;s->n=1;s->note[0]=drum_fx_note(10);s->vel=100;
|
||||
ok=step_lanes_of(dt,s)==(1u<<DV_TOM);
|
||||
grid_hit(dt,7,DV_TOM,0);ok &= !step_lanes_of(dt,s);
|
||||
bad+=check("EXT grid removes the correct chromatic/effected lane",ok);
|
||||
return bad;
|
||||
}
|
||||
|
||||
static int lyrics(void)
|
||||
{
|
||||
int bad=0,ok=1;uint32_t l,i,ns,n;
|
||||
static const struct {uint8_t lang,code;const char *word;} cases[]={
|
||||
{LG_RU,PH_ZH,"zha"},{LG_DE,PH_SH,"scha"},{LG_DE,PH_TS,"za"},
|
||||
{LG_FR,PH_SH,"chat"},{LG_ZH,PH_SH,"xian"},{LG_PT,PH_NY,"nha"},{LG_GN,PH_NY,"nya"}};
|
||||
for(i=0;i<NELEM(cases);i++) {
|
||||
uint8_t ph[SW_MAX];n=sy_word(cases[i].lang,cases[i].word,strlen(cases[i].word),ph,&ns);
|
||||
ok &= n&&ns&&(ph[0]&63u)==cases[i].code;
|
||||
}
|
||||
bad+=check("VOICE: six language readers apply distinct phonetic rules",ok);
|
||||
ok=1;
|
||||
for(l=LG_RU;l<LG_N;l++) {
|
||||
for(i=0;i<64;i++) {
|
||||
struct {uint8_t pre,ph[SW_MAX],post;} buf={.pre=0xA5,.post=0x5A};
|
||||
char text[64];for(uint32_t j=0;j<63;j++) text[j]="shcha~ng'yue"[(i+j)%11];text[63]=0;
|
||||
n=sy_word(l,text,63,buf.ph,&ns);
|
||||
ok &= n<=SW_MAX&&buf.pre==0xA5&&buf.post==0x5A;
|
||||
for(uint32_t j=0;j<n;j++) ok &= (buf.ph[j]&63u)<PH_COUNT;
|
||||
}
|
||||
}
|
||||
bad+=check("VOICE language readers bound phonemes on long input",ok);
|
||||
ui_power_on();track_t *t=&trk[0];set_engine_of(t,ENGI_VOICE);t->engine=t->eng_req;song.sel=0;
|
||||
lyr_set(0,"hola luna.");t->p[P_VLANG]=LG_ES;t->p[P_VLYR]=LYR_FIXED;t->p[P_E0]=2;
|
||||
sing[0].pend=1;sing_block(t);sing_t first=sing[0];
|
||||
sing[0].pend=1;sing_block(t);
|
||||
ok=sing[0].wsy==first.wsy&&sing[0].nsy==first.nsy&&!strcmp(sing[0].w,first.w);
|
||||
bad+=check("VOICE TEXT FIXED: repeated POS really repeats the selected syllable",ok);
|
||||
t->p[P_E0]=0;sing[0].pend=1;sing_block(t);
|
||||
bad+=check("VOICE TEXT FIXED: POS 0 advances automatically",sing[0].nsy!=first.nsy);
|
||||
/* Same word and syllable selected from the real text, including punctuation. */
|
||||
lyric_word=31;lyric_syl=1;char label[20];uint32_t pos=lyric_pick(label);
|
||||
bad+=check("LYRIC STEP clamps selection to the last word past punctuation",pos==3&&!strcmp(label,"luna"));
|
||||
lyric_word=0;lyric_syl=2;pos=lyric_pick(label);
|
||||
bad+=check("LYRIC STEP maps a word/syllable to absolute POS",pos==2&&!strcmp(label,"hola"));
|
||||
ui.home=0;for(i=0;i<NELEM(PAGES);i++) if(PAGES[i].graph==GR_LYRSTEP)ui.page=(uint8_t)i;
|
||||
ui.cursor=4;motion_clear(t);act_do();
|
||||
ok=motion.count==1&&MOTION_STEP(&motion.event[0])==4&&MOTION_ID(&motion.event[0])==P_E0&&
|
||||
(motion.event[0].param&MOTION_LOCK)&&t->p[P_VLYR]==LYR_FIXED;
|
||||
bad+=check("LYRIC STEP places a real POS lock without using either component",ok);
|
||||
/* Saved project preserves the new choices and locks in the current format. */
|
||||
t->p[P_VLANG]=LG_GN;trk[3].p[P_DKEYMODE]=1;
|
||||
static project_t before,after;static project_store_t blob;
|
||||
project_capture(&before);
|
||||
ok=proj_pack(&blob,&before)&&proj_import(&after,&blob,sizeof blob)&&
|
||||
after.t[0].p[P_VLANG]==LG_GN&&after.t[0].p[P_VLYR]==LYR_FIXED&&after.t[3].p[P_DKEYMODE]==1;
|
||||
bad+=check("Project round trip preserves languages, fixed lyrics and EXT key map",ok);
|
||||
return bad;
|
||||
}
|
||||
int main(void)
|
||||
{
|
||||
int bad=extensions()+lyrics();
|
||||
printf("drum/voice extensions: %s\n",bad?"FAILED":"all ok");return bad!=0;
|
||||
}
|
||||
@@ -869,6 +869,7 @@ static int rec_ratch(void)
|
||||
return bad;
|
||||
}
|
||||
|
||||
#ifndef DRUM_OCT_NO_MAIN
|
||||
int main(void)
|
||||
{
|
||||
int bad = 0;
|
||||
@@ -888,3 +889,5 @@ int main(void)
|
||||
printf("drumx octaves: all ok\n");
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -474,6 +474,7 @@ static void check_reading(void)
|
||||
static const char *const LN[4] = {"", "ES", "EN", "JA"};
|
||||
uint32_t bad_w = 0, tot = 0;
|
||||
for (l = LG_ES; l <= LG_JA; l++) {
|
||||
const char *const *ref=l==LG_ES?LY_ES_BANK_REF_W:l==LG_EN?LY_EN_BANK_REF_W:LY_JA_BANK_REF_W;
|
||||
const ly_bank_t *bk = &LY_BANK[l - 1u];
|
||||
uint32_t nwds = l == LG_ES ? LY_ES_NW : l == LG_EN ? LY_EN_NW : LY_JA_NW;
|
||||
for (k = 0; k < nwds; k++) {
|
||||
@@ -481,6 +482,7 @@ static void check_reading(void)
|
||||
char nw2[24];
|
||||
char word[20];
|
||||
const char *w = ly_word(bk, k, word);
|
||||
bad_w += strcmp(w,ref[k])!=0; /* exact text, not only the syllable count */
|
||||
(void)sy_word(l, nw2, sy_norm(w, (uint32_t)strlen(w), nw2, sizeof nw2), ph, &n);
|
||||
tot++;
|
||||
if (n != (bk->meta[k] & 15u)) {
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
"""Run the editor's real transliterator; never silently drop a native lyric."""
|
||||
from pathlib import Path
|
||||
import re,subprocess
|
||||
s=Path('web/editor.html').read_text()
|
||||
a=s.index('function lyricText(')
|
||||
fn=s[a:s.index('\n}',a)+2]
|
||||
js="import assert from 'node:assert/strict';\n"+fn+'''
|
||||
assert.equal(lyricText('Привет мир','RU'),'Privet mir'.toLowerCase());
|
||||
assert.equal(lyricText('щёлк','RU'),'shchyolk');
|
||||
assert.equal(lyricText('größer','DE'),'groesser');
|
||||
assert.equal(lyricText('nǐ hǎo lǜ','ZH'),'ni hao lv');
|
||||
assert.equal(lyricText('coração','PT'),'corasa~o');
|
||||
assert.equal(lyricText('pytũ ñ','GN'),'pytu~ ny');
|
||||
assert.equal(lyricText('été chat','FR'),'eitei chat');
|
||||
assert.throws(()=>lyricText('你好','ZH'),/pinyin/);
|
||||
assert.throws(()=>lyricText('щ'.repeat(16),'RU'),/63/);
|
||||
assert.equal(lyricText('niño corazón'),'ninyo corazon');
|
||||
assert.equal(lyricText('a'.repeat(100)).length,63); // legacy protocol bound
|
||||
assert.equal(lyricText('a'.repeat(63),'EN').length,63);
|
||||
console.log('voice web: transliteration, nasal/umlaut markers, UTF rejection and expanded-length bound passed');
|
||||
'''
|
||||
out=Path('build/song-check');out.mkdir(parents=True,exist_ok=True)
|
||||
(out/'voice-web.mjs').write_text(js)
|
||||
subprocess.run(['node',str(out/'voice-web.mjs')],check=True)
|
||||
+6
-1
@@ -503,6 +503,7 @@ def main():
|
||||
counts = {}
|
||||
for lang in ("es", "en", "ja"):
|
||||
rows = load_bank(lang, nsyl[lang])
|
||||
bank_words = []
|
||||
txt, offs, meta, grp = bytearray(), [], [], [[[0, 0] for _ in CATS] for _ in THEMES]
|
||||
n = 0
|
||||
for t in range(len(THEMES)):
|
||||
@@ -510,12 +511,16 @@ def main():
|
||||
r = rows.get((t, c), [])
|
||||
grp[t][c] = [n, len(r)]
|
||||
for w, ns, fem in r:
|
||||
assert len(w) <= 19, "singer word buffer"
|
||||
bank_words.append(w)
|
||||
offs.append(len(txt))
|
||||
txt += w.encode() + b"\0"
|
||||
meta.append(ns | (16 if fem else 0))
|
||||
n += 1
|
||||
counts[lang] = n
|
||||
U = lang.upper()
|
||||
L.append(f"#ifdef LY_EN_REF\nstatic const char *const LY_{U}_BANK_REF_W[] = {{" +
|
||||
','.join('"'+w+'"' for w in bank_words) + "};\n#endif")
|
||||
L.append(f"#define LY_{U}_NW {n}u")
|
||||
# Exact alphabet packing: 0 is word terminator, 1..26 a..z.
|
||||
# Sparse offsets remain every 16 words, now measured in bits.
|
||||
@@ -532,7 +537,7 @@ def main():
|
||||
L.append(f"static const uint16_t LY_{U}_GRP[{len(THEMES)}][{len(CATS)}] = {{\n {rows_c}}};")
|
||||
out.write_text("\n".join(L) + "\n")
|
||||
print(f"lyrics: {len(PHONEMES)} phonemes; English dictionary {len(words)} words, "
|
||||
f"{len(blob) + 2 * len(idx) + len(tp) + len(tl) + len(th) + nlut} B (Huffman; {plain} B as bytes); "
|
||||
f"{len(blob) + 2 * len(idx) + len(tp) + len(tl) + len(th) + nlut + 2*len(pairs)} B (Huffman/pairs; {plain} B as bytes); "
|
||||
f"banks ES {counts['es']} EN {counts['en']} JA {counts['ja']} words -> {out}")
|
||||
|
||||
|
||||
|
||||
+6
-1
@@ -2685,7 +2685,7 @@ const TEXT = {
|
||||
layout: "(The firmware has a different parameter count; showing a plain list.)",
|
||||
ctlHelp: "Sliders: click, then fine-tune with the wheel or arrow keys (Shift: steps of 10); double-click resets.",
|
||||
lyricT: "Lyric (VOICE WORDS)",
|
||||
lyricHelp: "The VOICE track's lyric (up to 63 characters). EDIT > WORDS: LANG picks the language (ES / EN / JA, Japanese in romaji), LYRIC TEXT sings this. Each note sings the next syllable; a \"-\" holds the vowel one more note.",
|
||||
lyricHelp: "VOICE lyrics: up to 63 characters after transliteration. ES, EN, JA (romaji), RU, DE, FR, ZH (pinyin), PT, GN. New languages use approximate phonetic singing rules; Mandarin notes follow your melody. TEXT advances each note; TEXT FIXED repeats POS. A \"-\" holds the vowel one more note.",
|
||||
lyricSend: "Send",
|
||||
lyricLang: "LANG",
|
||||
lyricSrc: "LYRIC",
|
||||
@@ -3133,6 +3133,7 @@ async function lyricRead(d = dev) {
|
||||
if (!lyricShown()) return;
|
||||
const r = parse[CMD.LYRIC](await rq(req.lyric(d.sel || 0)));
|
||||
if (document.activeElement !== $("lyric")) $("lyric").value = r.text;
|
||||
lyricPreview();
|
||||
}
|
||||
$("lyricsend").addEventListener("click", () => {
|
||||
if (!lyricShown()) return;
|
||||
@@ -3165,6 +3166,10 @@ function updateBrowser() {
|
||||
const sel = $("engine");
|
||||
$("lyricbox").hidden = !lyricShown();
|
||||
if (lyricShown()) {
|
||||
for (const [id,param] of [["lyrlang",LYR_ID.lang],["lyrsrc",LYR_ID.src]]) {
|
||||
const max=dev.pdesc[param]?.max;
|
||||
if (Number.isInteger(max)) for (const option of $(id).options) option.disabled=+option.value>max;
|
||||
}
|
||||
if (document.activeElement !== $("lyrlang")) $("lyrlang").value = String(Math.max(0, Math.min(9, dev.dump.p[LYR_ID.lang] | 0)));
|
||||
if (document.activeElement !== $("lyrsrc")) $("lyrsrc").value = String(Math.max(0, Math.min(25, dev.dump.p[LYR_ID.src] | 0)));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user