Finish lossless lyric metadata packing and beta version; preserve transliterated cedillas and nasal vowels

This commit is contained in:
JUAN JIANT committed 2026-11-05 20:45:42 -03:00
1 parent f91fc0c84f
commit 08e6944e62
6 files changed
+14 -10

No files matched your search

+1 -1
View File
@@ -47,7 +47,7 @@
#define FELUCCA_ID "FM-1_900" /* package identity (build.py: the .fwsc marker string) */
#endif
#ifndef FELUCCA_VERSION
#define FELUCCA_VERSION "V10.6c-draft" /* (2026-11-03) V10.61: PROX tuned (the user: it works with the phone, but the phone had to go far away for PROX to let go; a narrower field, a quicker response): the PROX page's KNOB 1 MIN (0 .. 90 %: under it PROX is 0), KNOB 2 MAX (100 .. 10 %: over it PROX is full), both over the calibrated FAR .. NEAR, 10 % apart at least; KNOB 3 SPEED 1..5 (the level's smoothing 1/32 as before .. 1/2: quicker, noisier); saved as FAR / NEAR; 0, 100 and 1 as V10.60. (2026-11-03) V10.60: room (the user's ask): the conversion of DIGITAL's sounds to FM6 (fm4_convert.c) and the read of JIANT 0.1-0.5's projects (FUNB..FUN7, project.c proj_unpack) moved into the Bluetooth segment (without it: a DIGITAL sound loads as the FM6 factory preset that covers it, those old projects are not read); the app slot 4.3 KB free (was 0.8), the segment 2.7 KB; BTAPP_FN / BTAPP_RO in core.h. (2026-11-03) V10.59: FX > RPT 1/8 at slow tempos (the user: dimmed at 61 BPM): a REPEAT longer than the loop at 22 kHz (371 ms) records at 11 kHz, lo-fi (the effect's), up to 742 ms: 1/8 from 41 BPM (was 81), 1/16 from 21 (was 41); the faster ones as before, bit for bit. (2026-11-03) V10.58: users' reports: the master EQ (and TAPE) went back to flat on its own (going to GLO's pages, since V10.44): every read of a stored project or section (a slot checked, a section listed) set the EQ and TAPE playing; they now live in the project read and are applied only when it is loaded; MENU in BOTTOM and HUD showed its four cards under the panel (a blank band over it): the panel right under the tabs there, the cards at the foot as on every page of theirs; AIR's HOME: the beings swim under its cards (they crossed the tabs and the values); FX > EQ with SCOPE ON: the master's scope behind the curve. (2026-11-03) V10.57: USB > HOST takes an audio interface at 48 kHz too (the user's OP-Z, and the many interfaces with no 44,100): set to 48,000 when it has no 44,100, read at the I2S clock from a step of 48 / 44.1 (the reader's interpolation, its drift steering as before); packets of up to 50 frames taken. (2026-11-03) V10.56: USB IN+OUT no longer mixes the computer's or the phone's audio into the last track by itself (the user: recording from KOALA with IN+OUT on looped into a digital feedback, the app sending the FM-1's own output back): the input sounds where an INPUT track takes it; STEMS+IN keeps its own stem as before. (2026-11-03) V10.55: GEN's sounds right again: V10.42 replaced FM6 presets 8..12 and 14 and WHEEL 5, 6, and GEN still picked them by number for its roles (a SUB BASS played the bells, leads the electric pianos and plucks, a pedal bass the organs): its BELL EP PLUCK STRINGS SINE KEYS ORGAN DUB CHORD and KEYS take today's nearest (BELL MARIMBA TINE EP PLUCK PAD WAVE ORGAN GOSPEL JAZZ PERC); INPUT's meters keep FOLLOW's frame with the input silent; the host tests brought up to date with the UI (the DJ FILTER on LIVE > MANO, the roll's 13 px columns, INPUT in the engine lists). (2026-11-03) V10.54: the INPUT engine (the user's ask: the audio input routed, the track in an audio mode, an envelope follower): engine 15 plays the USB audio input (an interface on HOST, or the computer's USB IN+OUT) on its track: SOURCE IN 1 / IN 2 / 1+2 / STEREO (two tracks can take IN 1 and IN 2; STEREO keeps the image through the part's chain as IMAGE does), GAIN, GATE, PLAY THRU / KEYS (only while a note plays, at its envelope: a trance gate from the steps), WIDTH, RING (KEYS: a sine at the note), BITS, RATE; the track's FILTER DIST LEVEL PAN sends as any part's; EDIT INPUT shows both inputs' meters, GATE's level and FOLLOW; while a track is INPUT the last track's IN+OUT mix steps aside; MOD SRC FOLLOW, the input's envelope, on any track and any destination. (2026-11-03) V10.53: USB > HOST takes an audio interface too, an experiment (the user's ask: a USB audio input into the synth): a class compliant USB audio 1.0 capture (16-bit, mono or stereo, 44,1 kHz among its rates: Behringer UM2 / UCA and the like), alone or behind a powered hub, set to 44,1 kHz (SET_CUR) and read each frame (isochronous IN) into IN+OUT's ring: it plays through the last track (its LEVEL PAN and sends, as USB IN+OUT's host audio); usb_host_desc.h uh_parse_uac, tested; not yet on hardware. (2026-11-03) V10.52: a synth's STEREO page shows IMAGE at work (the user: no visual feedback): the field L .. R, each voice sounding a blob at its place, its size its level now, its note over it (IMAGE 0: the notes in a row), the silent ones a tick where they would sit, the span IMAGE opens as a bar. (2026-11-03) V10.51: the roll follows the playhead for real (the user: V10.47's did not): the bar playing was chosen in the roll's drawing, and a playhead out of the bar shown changed nothing the panel's redraw looks at (graph_signature): never drawn, never followed; now chosen there. (2026-11-03) V10.50: the user's fixes to V10.49: a synth's STEREO IMAGE its own parameter (P_SIMG, theLine truncated
#define FELUCCA_VERSION "V10.6c-dxv" /* (2026-11-03) V10.61: PROX tuned (the user: it works with the phone, but the phone had to go far away for PROX to let go; a narrower field, a quicker response): the PROX page's KNOB 1 MIN (0 .. 90 %: under it PROX is 0), KNOB 2 MAX (100 .. 10 %: over it PROX is full), both over the calibrated FAR .. NEAR, 10 % apart at least; KNOB 3 SPEED 1..5 (the level's smoothing 1/32 as before .. 1/2: quicker, noisier); saved as FAR / NEAR; 0, 100 and 1 as V10.60. (2026-11-03) V10.60: room (the user's ask): the conversion of DIGITAL's sounds to FM6 (fm4_convert.c) and the read of JIANT 0.1-0.5's projects (FUNB..FUN7, project.c proj_unpack) moved into the Bluetooth segment (without it: a DIGITAL sound loads as the FM6 factory preset that covers it, those old projects are not read); the app slot 4.3 KB free (was 0.8), the segment 2.7 KB; BTAPP_FN / BTAPP_RO in core.h. (2026-11-03) V10.59: FX > RPT 1/8 at slow tempos (the user: dimmed at 61 BPM): a REPEAT longer than the loop at 22 kHz (371 ms) records at 11 kHz, lo-fi (the effect's), up to 742 ms: 1/8 from 41 BPM (was 81), 1/16 from 21 (was 41); the faster ones as before, bit for bit. (2026-11-03) V10.58: users' reports: the master EQ (and TAPE) went back to flat on its own (going to GLO's pages, since V10.44): every read of a stored project or section (a slot checked, a section listed) set the EQ and TAPE playing; they now live in the project read and are applied only when it is loaded; MENU in BOTTOM and HUD showed its four cards under the panel (a blank band over it): the panel right under the tabs there, the cards at the foot as on every page of theirs; AIR's HOME: the beings swim under its cards (they crossed the tabs and the values); FX > EQ with SCOPE ON: the master's scope behind the curve. (2026-11-03) V10.57: USB > HOST takes an audio interface at 48 kHz too (the user's OP-Z, and the many interfaces with no 44,100): set to 48,000 when it has no 44,100, read at the I2S clock from a step of 48 / 44.1 (the reader's interpolation, its drift steering as before); packets of up to 50 frames taken. (2026-11-03) V10.56: USB IN+OUT no longer mixes the computer's or the phone's audio into the last track by itself (the user: recording from KOALA with IN+OUT on looped into a digital feedback, the app sending the FM-1's own output back): the input sounds where an INPUT track takes it; STEMS+IN keeps its own stem as before. (2026-11-03) V10.55: GEN's sounds right again: V10.42 replaced FM6 presets 8..12 and 14 and WHEEL 5, 6, and GEN still picked them by number for its roles (a SUB BASS played the bells, leads the electric pianos and plucks, a pedal bass the organs): its BELL EP PLUCK STRINGS SINE KEYS ORGAN DUB CHORD and KEYS take today's nearest (BELL MARIMBA TINE EP PLUCK PAD WAVE ORGAN GOSPEL JAZZ PERC); INPUT's meters keep FOLLOW's frame with the input silent; the host tests brought up to date with the UI (the DJ FILTER on LIVE > MANO, the roll's 13 px columns, INPUT in the engine lists). (2026-11-03) V10.54: the INPUT engine (the user's ask: the audio input routed, the track in an audio mode, an envelope follower): engine 15 plays the USB audio input (an interface on HOST, or the computer's USB IN+OUT) on its track: SOURCE IN 1 / IN 2 / 1+2 / STEREO (two tracks can take IN 1 and IN 2; STEREO keeps the image through the part's chain as IMAGE does), GAIN, GATE, PLAY THRU / KEYS (only while a note plays, at its envelope: a trance gate from the steps), WIDTH, RING (KEYS: a sine at the note), BITS, RATE; the track's FILTER DIST LEVEL PAN sends as any part's; EDIT INPUT shows both inputs' meters, GATE's level and FOLLOW; while a track is INPUT the last track's IN+OUT mix steps aside; MOD SRC FOLLOW, the input's envelope, on any track and any destination. (2026-11-03) V10.53: USB > HOST takes an audio interface too, an experiment (the user's ask: a USB audio input into the synth): a class compliant USB audio 1.0 capture (16-bit, mono or stereo, 44,1 kHz among its rates: Behringer UM2 / UCA and the like), alone or behind a powered hub, set to 44,1 kHz (SET_CUR) and read each frame (isochronous IN) into IN+OUT's ring: it plays through the last track (its LEVEL PAN and sends, as USB IN+OUT's host audio); usb_host_desc.h uh_parse_uac, tested; not yet on hardware. (2026-11-03) V10.52: a synth's STEREO page shows IMAGE at work (the user: no visual feedback): the field L .. R, each voice sounding a blob at its place, its size its level now, its note over it (IMAGE 0: the notes in a row), the silent ones a tick where they would sit, the span IMAGE opens as a bar. (2026-11-03) V10.51: the roll follows the playhead for real (the user: V10.47's did not): the bar playing was chosen in the roll's drawing, and a playhead out of the bar shown changed nothing the panel's redraw looks at (graph_signature): never drawn, never followed; now chosen there. (2026-11-03) V10.50: the user's fixes to V10.49: a synth's STEREO IMAGE its own parameter (P_SIMG, the lLine truncated
#endif
#if FELUCCA_OTA && !FELUCCA_FLASH
#error "FELUCCA_OTA needs FELUCCA_FLASH"
+4 -3
View File
@@ -604,6 +604,7 @@ static const ly_bank_t LY_BANK[3] = {
{LY_EN_TXT, LY_EN_OFF, LY_EN_META, LY_EN_GRP},
{LY_JA_TXT, LY_JA_OFF, LY_JA_META, LY_JA_GRP},
};
static uint32_t ly_meta(const ly_bank_t *b,uint32_t j) {return b->meta[j>>1]>>((j&1u)*4u)&15u;}
/* a word of category cat in the theme with at most maxs syllables (exact: just that many): its index, -1 none */
static int32_t ly_pick(uint32_t lang, uint32_t theme, uint32_t cat, uint32_t maxs, int exact, uint32_t *r)
{
@@ -613,7 +614,7 @@ static int32_t ly_pick(uint32_t lang, uint32_t theme, uint32_t cat, uint32_t max
return -1;
o = sy_rnd(r) % n;
for (k = 0; k < n; k++) {
uint32_t j = st + (o + k) % n, s = b->meta[j] & 15u;
uint32_t j = st + (o + k) % n, s = ly_meta(b,j) & 7u;
if (exact ? s == maxs : s <= maxs)
return (int32_t)j;
}
@@ -889,7 +890,7 @@ static uint32_t sy_gen_word(const track_t *t, sing_t *s, uint32_t lang, uint32_t
if (j < 0)
j = ly_pick(lang, th, cat, s->prem, 0, &s->rng);
if (j >= 0 && cat == 0u)
s->fem = (b->meta[j] >> 4) & 1u;
s->fem = (ly_meta(b,j) >> 3) & 1u;
pcat = cat;
}
if (j < 0) /* nothing fits: a noun or verb of exactly what is left */
@@ -914,7 +915,7 @@ static uint32_t sy_gen_word(const track_t *t, sing_t *s, uint32_t lang, uint32_t
s->w[m] = 0;
if (lang == LG_ES && s->fem && m && s->w[m - 1u] == 'o' && pcat == 2u)
s->w[m - 1u] = 'a'; /* the adjective after a feminine noun */
s->prem = (uint8_t)(s->prem - clamp(b->meta[j] & 15u, 1, s->prem));
s->prem = (uint8_t)(s->prem - clamp(ly_meta(b,j) & 7u, 1, s->prem));
}
return (uint32_t)j; /* (English: the bank's word j, as it is) */
}
+1 -1
View File
@@ -70,7 +70,7 @@ static const char SY_EXT_WORD_0[] LY_DICT_SEC = "lyubov\0serdtse\0noch\0luna\0mo
static const char SY_EXT_WORD_1[] LY_DICT_SEC = "liebe\0herz\0nacht\0mond\0meer\0welle\0himmel\0stern\0welt\0lied\0weg\0wind\0traum\0schlaf\0feuer\0licht";
static const char SY_EXT_WORD_2[] LY_DICT_SEC = "amour\0coeur\0nuit\0lune\0mer\0vague\0ciel\0soleil\0monde\0chanson\0route\0vent\0reve\0dormir\0feu\0flamme";
static const char SY_EXT_WORD_3[] LY_DICT_SEC = "ai\0xin\0ye\0yue\0hai\0lang\0tian\0xing\0ren\0ge\0lu\0feng\0meng\0shui\0huo\0guang";
static const char SY_EXT_WORD_4[] LY_DICT_SEC = "amor\0coracao~\0noite\0lua\0mar\0onda\0ceu\0estrela\0mundo\0canto\0caminho\0vento\0sonho\0dormir\0fogo\0luz";
static const char SY_EXT_WORD_4[] LY_DICT_SEC = "amor\0corasa~o\0noite\0lua\0mar\0onda\0ceu\0estrela\0mundo\0canto\0caminho\0vento\0sonho\0dormir\0fogo\0luz";
static const char SY_EXT_WORD_5[] LY_DICT_SEC = "mborayhu\0coraso~\0pyhare\0jasy\0para\0y\0yvaga\0mbyja\0ava\0purahei\0tape\0yvytu\0kerana\0ke\0tata\0tesape";
static const char *const SY_EXT_WORDS[] = {SY_EXT_WORD_0, SY_EXT_WORD_1, SY_EXT_WORD_2, SY_EXT_WORD_3, SY_EXT_WORD_4, SY_EXT_WORD_5};
#undef LR
+2 -2
View File
@@ -485,9 +485,9 @@ static void check_reading(void)
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)) {
if (n != (ly_meta(bk,k) & 7u)) {
if (bad_w++ < 8u)
printf("voice: %s %s: %u syllables here, %u in the bank\n", LN[l], w, n, bk->meta[k] & 15u);
printf("voice: %s %s: %u syllables here, %u in the bank\n", LN[l], w, n, ly_meta(bk,k) & 7u);
}
}
}
+4 -2
View File
@@ -515,7 +515,8 @@ def main():
bank_words.append(w)
offs.append(len(txt))
txt += w.encode() + b"\0"
meta.append(ns | (16 if fem else 0))
assert 0 <= ns < 8
meta.append(ns | (8 if fem else 0))
n += 1
counts[lang] = n
U = lang.upper()
@@ -531,7 +532,8 @@ def main():
L.append(f"static const uint8_t LY_{U}_TXT[{len(packed)}] = {{\n {c_bytes(packed)}}};")
offs = offs[::16] # (0.9.0) each 16th word's place (sing.c ly_word: then the 0s)
L.append(f"static const uint16_t LY_{U}_OFF[{len(offs)}] = {{\n {c_bytes(o*5 for o in offs)}}};")
L.append(f"static const uint8_t LY_{U}_META[{n}] = {{\n {c_bytes(meta)}}};")
packed_meta = bytes(meta[i] | ((meta[i+1] if i+1<n else 0)<<4) for i in range(0,n,2))
L.append(f"static const uint8_t LY_{U}_META[{len(packed_meta)}] = {{\n {c_bytes(packed_meta)}}};")
assert all(a < 512 and b < 128 for t in grp for a,b in t)
rows_c = ",\n ".join("{" + ", ".join(str(a | b<<9) for a, b in t) + "}" for t in grp)
L.append(f"static const uint16_t LY_{U}_GRP[{len(THEMES)}][{len(CATS)}] = {{\n {rows_c}}};")
+2 -1
View File
@@ -605,7 +605,8 @@ const parse = {
/* (JIANT 0.8.5) a lyric the device takes: printable ASCII, at most 63 characters; accents dropped (the device has none:
stress is not marked in singing), the enye as "ny" (as the device reads it: sing.c sy_es) */
function lyricText(s, language = "") {
let text = String(s ?? "").replace(/[’‘]/g, "'");
let text = String(s ?? "").replace(/[’‘]/g, "'").replace(/[çÇ]/g,"s")
.replace(/[ñÑ]/g, c => c === "ñ" ? "ny" : "NY");
if (language === "RU") {
const abc = "абвгдеёжзийклмнопрстуфхцчшщъыьэюя";
const latin = ["a","b","v","g","d","e","yo","zh","z","i","y","k","l","m","n","o","p","r","s","t","u","f","kh","ts","ch","sh","shch","","y","","e","yu","ya"];